From aeee23fd814ff73599fc27e277a46c85b7e1e674 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 11 Feb 2020 21:03:12 -0700 Subject: [PATCH 1/2] Acumulado en reporte de comisiones --- Ventas/RepComisiones.aspx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Ventas/RepComisiones.aspx b/Ventas/RepComisiones.aspx index 293384f61..bedffe731 100644 --- a/Ventas/RepComisiones.aspx +++ b/Ventas/RepComisiones.aspx @@ -107,19 +107,23 @@ - <%----%> - <%----%> - + - <%-- - --%> - - - + + + + + + + + + + <%----%> + From 173de6ebe4b7138a03a06aa1d254594815974d38 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 11 Feb 2020 21:03:42 -0700 Subject: [PATCH 2/2] Refacturacion con anticipos y NC --- Ventas/Ventas.aspx | 24 +++++++++++++++----- Ventas/Ventas.aspx.vb | 51 +++++++++++++++++++++++++++++++------------ vwd.webinfo | 36 +++++++++++++++--------------- 3 files changed, 74 insertions(+), 37 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 0847b5a8f..7d7216312 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -6515,14 +6515,26 @@ } function LimitaSaldoRNCChk(TxtImporte, Saldo) { var Importe = 0; - if (TxtImporte.value != '') { - Importe = parseFloat(TxtImporte.value); + + if (TxtImporte.value.includes('.')) { + return; + } + if (TxtImporte.value.includes(',')) { + return; } - if (Importe > Saldo) { - TxtImporte.value = FormatoNumero(Saldo, 2); - } else { - TxtImporte.value = FormatoNumero(Importe, 2);; + var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$"); + + if (regex.test(TxtImporte.value)) { + if (TxtImporte.value != '') { + Importe = parseFloat(TxtImporte.value); + } + + if (Importe > Saldo) { + TxtImporte.value = FormatoNumero(Saldo, 2); + } else { + TxtImporte.value = FormatoNumero(Importe, 2);; + } } } diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3699d95db..f22ae9243 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6771,19 +6771,25 @@ Partial Class Ventas TieneAnticipo = True CveAnticipoPadre = row2.DataKey("CveVenta").ToEntero - ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo CveAnticipo = CveAnticipoPadre - ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal - FolioFiscalRelacionado = row2.DataKey("FolioFiscal") - ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + 'CUANDO ES REFACTURACION DEBE RELACIONAR CON LA FACTURA REFACTURADA + If NuevaFactura <> 1 Then + ObjFactura.CveVentaRelacion = CveAnticipoPadre 'relaciona al anticipo + ObjFactura.ImporteRelacion = row2.FCTextBox($"TxtAnticipo{actualindex}").Text.ToDecimal + FolioFiscalRelacionado = row2.DataKey("FolioFiscal") + ObjFactura.CveVentaPadre = row2.DataKey("CveVenta").ToEntero + Else + ObjFactura.CveVentaRelacion = CveDevolucion + End If End If actualindex = actualindex + 1 Next End If + Dim EsNCAmortizacion As Boolean = False - If DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then + If ObjFactura.TipoDocto = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then EsNCAmortizacion = True End If @@ -6847,7 +6853,14 @@ Partial Class Ventas ' cambiar la condicion para saber si hay seleccionado If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then Try - CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveAnticipoPadre, NCDescuento:=NCDescuento) + Dim CveVentaRelacionada As Integer = -1 + If NuevaFactura = 1 Then + CveVentaRelacionada = ObjFactura.CveVenta + Else + CveVentaRelacionada = CveAnticipoPadre + End If + + CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento) If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing, Nothing, NCDescuento:=NCDescuento) Then Obj2.Add(ObjFacturaDevolucion) @@ -7524,13 +7537,16 @@ Partial Class Ventas End If End If - If DtVentasNC Is Nothing Then InicializaDTVentasNC() - Dim Drt = DtVentasNC.NewRow - Drt("CveVenta") = ObjFactura.CveVenta - Drt("Importe") = 0 - Drt("FolioFiscal") = ObjFactura.FolioFiscal - DtVentasNC.Rows.Add(Drt) - DtVentasNC.AcceptChanges() + 'SI NO ES REFACTURACION + If NuevaFactura <> 1 Then + If DtVentasNC Is Nothing Then InicializaDTVentasNC() + Dim Drt = DtVentasNC.NewRow + Drt("CveVenta") = ObjFactura.CveVenta + Drt("Importe") = 0 + Drt("FolioFiscal") = ObjFactura.FolioFiscal + DtVentasNC.Rows.Add(Drt) + DtVentasNC.AcceptChanges() + End If End Sub @@ -7648,7 +7664,14 @@ Partial Class Ventas factura.RetIVA = TotalRetIVA factura.RetISR = TotalRetISR factura.Total = Total - factura.CveVentaPadre = CveVentaP + + 'SI ES REFACTURACION DEBE RELACIONAR CON LA VENTA NUEVA + If NuevaFactura = 1 Then + factura.CveVentaPadre = ObjFactura.CveVenta + Else + factura.CveVentaPadre = CveVentaP + End If + If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then DtVentasNC.Rows(0)("Importe") = Total diff --git a/vwd.webinfo b/vwd.webinfo index 8a63d860e..5155bd0b4 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -1,18 +1,20 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file