--GDiaz. pago con devolucion en cobranza

This commit is contained in:
2024-10-22 13:08:43 -07:00
parent 56bc2d67b3
commit 46b567c445
2 changed files with 252 additions and 148 deletions

View File

@@ -529,6 +529,14 @@ Partial Class Ventas_PVCobranza
'REALIZAR EL PAGO EN LA FACTURA
If respFactura IsNot Nothing AndAlso Not respFactura.TieneError Then
CveVenta = respFactura.CveVenta
If HdnTipoAmortizacion.Value = "4" Then
If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe")
SaldoPendiente = SaldoPendiente - PagoAplicado
End If
End If
End If
End If
@@ -793,6 +801,40 @@ Partial Class Ventas_PVCobranza
ObjFactura.PreparaTimbre()
If HdnTipoAmortizacion.Value = "4" Then
Dim DtAnticipos As New DataTable()
DtAnticipos.Columns.Add("CveVenta", GetType(Integer))
DtAnticipos.Columns.Add("Importe", GetType(Decimal))
DtAnticipos.Columns.Add("CveConceptoContable", GetType(Integer))
DtAnticipos.Columns.Add("CveIE", GetType(Integer))
DtAnticipos.Columns.Add("FolioFiscal", GetType(String))
DtAnticipos.Columns.Add("Descuentos", GetType(Decimal))
DtAnticipos.Columns.Add("TotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("SubTotalAnticipo", GetType(Decimal))
DtAnticipos.Columns.Add("CveMoneda", GetType(Decimal))
For Each GvRow As GridViewRow In GVAnticipos.Rows
If GvRow.FCCheckBox("Chk" & GvRow.RowIndex) IsNot Nothing AndAlso GvRow.FCCheckBox("Chk" & GvRow.RowIndex).Checked Then
Dim CveVenta = GvRow.DataKey("CveVenta").ToEntero()
Dim Importe = GvRow.FCTextBox(String.Format("TxtAnticipo{0}", GvRow.RowIndex)).Text.ToDecimal()
Dim CveConceptoContable = GvRow.DataKey("CveConceptoContable").ToEntero()
Dim CveIE = GvRow.DataKey("CveIE").ToEntero()
Dim FolioFiscal = GvRow.DataKey("FolioFiscal")
Dim Descuentos As Decimal = GvRow.DataKey("Descuentos").ToDecimal()
Dim TotalAnticipo As Decimal = GvRow.DataKey("TotalAnticipo").ToDecimal()
Dim SubTotalAnticipo As Decimal = GvRow.DataKey("SubTotalAnticipo").ToDecimal()
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
DtAnticipos.Rows.Add(CveVenta, Importe, CveConceptoContable, CveIE, FolioFiscal, Descuentos, TotalAnticipo, SubTotalAnticipo, CveMoneda)
End If
Next
ObjFactura.EsNCAmortizacion = True
ObjFactura.CveTipoAmortizacionAnticipo = 4
ObjFactura.DtAnticiposAplicados = DtAnticipos
End If
Dim SbAlert As New StringBuilder()
Try
@@ -1424,10 +1466,10 @@ Partial Class Ventas_PVCobranza
Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero()
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
'If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
' DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
'End If
'DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
End If
DdlTipoAmortizacionAnticipo.SelectedValueExist("4")
DdlTipoRelacionAnticipo.SelectedValueExist("-1")
@@ -1701,7 +1743,7 @@ Partial Class Ventas_PVCobranza
ListaAnticiposAplicados.Clear()
End If
'cuando es PAGO CON DEVOLUCION
Dim SbObs As New StringBuilder
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then