--FIX. Forma de pago al factura remsion en cajas

This commit is contained in:
2024-06-17 18:13:14 -07:00
parent e1a0c03cde
commit 1d1fb0e8a5

View File

@@ -591,6 +591,39 @@ Partial Class Ventas_PVCobranza
ObjFactura.DtRemisionesPS = DtRemisionesPS
ObjFactura.DtRemisiones = DtRemisiones
Dim DtPagos As DataTable = New DataTable("DtPagosFactura")
DtPagos.Columns.Add(New DataColumn("CveFormaPago", GetType(Integer)))
DtPagos.Columns.Add(New DataColumn("Importe", GetType(Decimal)))
If TxtImporteCredito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({4, TxtImporteCredito.Text.ToDecimal})
End If
If TxtImporteDebito.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({18, TxtImporteDebito.Text.ToDecimal})
End If
If TxtImporteCheque.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({2, TxtImporteCheque.Text.ToDecimal})
End If
If TxtImporteTransferencia.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({3, TxtImporteTransferencia.Text.ToDecimal})
End If
If TxtImporteEfectivo.Text.ToDecimal > 0 Then
DtPagos.Rows.Add({1, TxtImporteEfectivo.Text.ToDecimal})
End If
Dim PagoMaximo = DtPagos.MAX("Importe")
Dim CveFormaPago As Integer = DtPagos.FiltroPrimeroValor("CveFormaPago", $"Importe = {PagoMaximo}").ToEntero()
If CveFormaPago > 0 Then
ObjFactura.CveFormaPago33 = CveFormaPago
ObjFactura.CveMetodoPago33 = 1
End If
For Each Dr As DataRow In ObjFactura.DtRemisionesPS.Rows
ObjFactura.AgregarPS(Dr("CvePS").ToString().ToEntero(), Dr("Cantidad").ToString().ToDecimal(), Dr("PU").ToString().ToDecimal(), Dr("Descuento").ToString().ToDecimal, Dr("Obs").ToString(), CveUM:=Dr("CveUM").ToString().ToEntero(),
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero(),