--FIX pago de efectivo restante cuando se aplican multiples NC

This commit is contained in:
2025-02-12 17:02:55 -07:00
parent 4efe781a57
commit d642a1c3dd

View File

@@ -716,7 +716,7 @@ Partial Class Ventas_PVCobranza
End If
'GENERAR NC PARA AMORTIZACION
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() AndAlso TxtNCDev.Text.ToDecimal() > 0 Then
If MsgError = "" AndAlso ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Where(Function(x) x.Tipo = "Ant").Any() AndAlso TxtNCDev.Text.ToDecimal() > 0 Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.DataKey("Tipo") = "Ant" AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
@@ -737,8 +737,8 @@ Partial Class Ventas_PVCobranza
Exit For
Else
PagoAplicado += RespNC.Factura.Total
SaldoPendienteVenta = SaldoPendienteVenta - PagoAplicado
SaldoPendientePagos = SaldoPendientePagos - PagoAplicado
SaldoPendienteVenta -= RespNC.Factura.Total
SaldoPendientePagos -= RespNC.Factura.Total
For Each RowAnt As DataRow In RespNC.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then