From df097389c2d4e71bbcad070768c00df6d0efeee9 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 22 Dec 2024 09:15:56 -0700 Subject: [PATCH] =?UTF-8?q?--=20cobro=20de=20cr=C3=A9dito.=20generaci?= =?UTF-8?q?=C3=B3n=20de=20plazo=20cobranza?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/PVCobranza.aspx | 3 ++- Ventas/PVCobranza.aspx.vb | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index 955d39ca5..4b73dfda4 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -328,7 +328,7 @@ + DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza"> @@ -615,6 +615,7 @@
+ diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 874ea9b7f..2bfd8e851 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -402,6 +402,7 @@ Partial Class Ventas_PVCobranza LtlFolio.Text = GvRow.DataKey("SerieFolio") LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago") + HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza") If UsuarioActual.CveEmpresa = 189 AndAlso GvRow.DataKey("TipoDocto") = "Rem" Then DivAnticipo.Visible = True @@ -536,13 +537,14 @@ Partial Class Ventas_PVCobranza Dim respFactura As Modelos.Factura.MMensajeFactura = Nothing Dim respNC As Modelos.Factura.MMensajeFactura = Nothing Dim RegistrarPago As Boolean = True + Dim PlazoCobranza As Integer = HdnPlazoCobranza.Value.ToEntero Try 'FACTURAR LA REMISION PARA HACER EL PAGO If UsuarioActual.CveEmpresa.Contiene(189, 197) AndAlso VentaActual.TipoDocto = "Rem" Then CveVentaRemision = HdnCveVenta.Value.ToEntero - respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes, ObservacionesAlmacen, VentaContado) + respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes, ObservacionesAlmacen, VentaContado, PlazoCobranza) If respFactura Is Nothing Then MsgError = "Ocurrió un error al generar la factura" @@ -773,7 +775,7 @@ Partial Class Ventas_PVCobranza UpL.Update() End Sub - Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes, ObservacionesAlmacen As String, VentaConta As Boolean) As Modelos.Factura.MMensajeFactura + Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes, ObservacionesAlmacen As String, VentaConta As Boolean, PlazoCobranza As Integer) As Modelos.Factura.MMensajeFactura Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing Dim SbAlert As New StringBuilder() @@ -799,6 +801,7 @@ Partial Class Ventas_PVCobranza ObjFactura.RemisionesLista = RemisionesLista ObjFactura.DtRemisionesPS = DtRemisionesPS ObjFactura.DtRemisiones = DtRemisiones + ObjFactura.FechaPago = ObjFactura.Fecha.AddDays(PlazoCobranza) Dim DtPagos As DataTable = New DataTable("DtPagosFactura") DtPagos.Columns.Add(New DataColumn("CveFormaPago", GetType(Integer))) @@ -821,6 +824,7 @@ Partial Class Ventas_PVCobranza ObjFactura.CveFormaPago33 = CveFormaPago ObjFactura.CveMetodoPago33 = 1 End If + ObjFactura.FechaPago = Now 'venta de cantado el mismo dia Else 'venta a crédito ObjFactura.CveFormaPago33 = 20 ' por definir