From 6a8ba84dc820f39ee64ad953cac65c5d438a622e Mon Sep 17 00:00:00 2001 From: JPerez Date: Fri, 6 Jun 2025 13:03:15 -0700 Subject: [PATCH] --Sobrante y faltante cuando se aplican anticipos --- Ventas/PVCobranza.aspx.vb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 9b02686b4..835e0e09b 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -906,6 +906,23 @@ Partial Class Ventas_PVCobranza SaldoPendientePagos -= PagoEfectivo End If + If SobranteFaltante <> 0 Then + Dim Pago As New VentaPago + Pago.ImportePagoVenta = Math.Abs(SobranteFaltante) + Pago.ImportePago = Math.Abs(SobranteFaltante) + Pago.CveIE = -1 + Pago.CveMonedaPago = VentaActual.CveMoneda + Pago.Fecha = NowADS() + Pago.Referencia = VentaActual.SerieFolio + Pago.TipoPago = "XXX" + Pago.OtroGastoIngreso = SobranteFaltante + + Dim ErrorConta As Boolean = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta) + If ErrorConta Then + MsgError = "Error en aplicación de sobrante/faltante" + End If + End If + If SaldoPendienteVenta > 0 AndAlso Not ChkSobFaltante.Checked Then MsgError = "Tiene saldo pendiente por aplicar" End If