From 556a479822e5a9cf271f7069e36fb3b38e8c464b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 16 Nov 2024 14:40:58 -0700 Subject: [PATCH] =?UTF-8?q?Econo=20-=20Aplicaci=C3=B3n=20anticipo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 36 ++++++++++++++++++++++++++++++++++++ Ventas/Ventas.aspx.vb | 7 +++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a0a451539..17eb43f04 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -9502,7 +9502,9 @@ Public Class ClsPaginas ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True + 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True @@ -9540,6 +9542,39 @@ Public Class ClsPaginas End If End If + If Pago.AplicaConceptoImpuestoPendiente Then + 'si tiene iva y su proporcion + If Not ErrorMovtos AndAlso VentaActual.IVA <> 0 Then + ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL + ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL + If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True + End If + 'si tiene RET IVA y su proporcion + If Not ErrorMovtos AndAlso VentaActual.RetIVA > 0 Then + ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL + ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL + If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True + End If + 'si tiene Ret ISR y su proporcion + If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then + ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL + ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL + If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True + End If + 'si tiene IEPS y su proporcion + If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then + ImporteMovimiento = (PorcentajePago * VentaActual.IEPS).RoundSQL + ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL + If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento + Dim Ret As New ConceptosRetenciones + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True + End If + End If + 'concepto pago If Pago.TipoPago = "B" AndAlso Not ErrorMovtos AndAlso AplicarConceptoAplicacion Then ' B A N C O S Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia) @@ -9683,6 +9718,7 @@ Public Class ClsPaginas Public Property CveClientePago As Integer = -1 Public Property ImporteFluctuacionAdicional As Decimal = 0 Public Property ValorMultiplicador As Decimal = 1 + Public Property AplicaConceptoImpuestoPendiente As Boolean = False End Class Public Class Venta diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7910d3c62..2a4c697b2 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -17474,10 +17474,12 @@ Partial Class Ventas Case "3", "295" importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) + importeMN = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal + If importeMovimiento <> 0 Then Dim Pago As New VentaPago - Pago.ImportePagoVenta = importeMovimiento + Pago.ImportePagoVenta = importeMN Pago.ImportePago = importeMovimiento Pago.CveIE = CveIEAnticipo Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero() @@ -17487,6 +17489,7 @@ Partial Class Ventas Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1" Pago.Referencia = gvr.DataKey("Folio") + Pago.AplicaConceptoImpuestoPendiente = (Not gvr.DataKey("RegresarImpuesto") = "1") AndAlso (VentaActual.IVA > 0 OrElse VentaActual.IEPS > 0) ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) @@ -17608,7 +17611,7 @@ Partial Class Ventas ObjConta.Commit() BtnAceptarAnticipos.Enabled = False - Alert(Msg.ToString(), TipoMensaje.MsgInformacion) + Alert(Msg.ToString(), TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();", ShowCloseButton:=False) End If ObjConta.Dispose()