From e3d7a5970e97f964d3e505bc6e014976b4a7488c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 10 Mar 2023 20:06:35 -0700 Subject: [PATCH] Cambios de objetos de ventas a modelos --- App_Code/Modelos.vb | 34 +++++++++ Ventas/Ventas.aspx | 8 +- Ventas/Ventas.aspx.vb | 166 +++++++++++++++++++----------------------- 3 files changed, 115 insertions(+), 93 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 9897b9d96..1a35efe6f 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -301,6 +301,40 @@ Namespace Modelos #Region " OBJETOS Ventas" + + Public Class VentaDescuentos + Public Consec As Integer + Public ImporteDescuento As Decimal = 0 + Public CvePromocionDetalle As Integer = -1 + Public PU As Decimal = 0 + Public EsPUModificado As Boolean = False + Public ImporteProntoPago As Decimal = 0 + Public NombrePromo As String = "" + Public CveMarca As Integer = -1 + Public ObsDescuento As String = "" + End Class + + Public Class VentasBonificaciones + Public CveVentaRNCCargo As Integer = -1 + Public CveVentaBonificacion As Integer = -1 + Public ImporteBonificacion As Decimal = 0 + Public IVABonificacion As Decimal = 0 + End Class + + Public Class MensajeProntoPago + Public Property ObjFacturaProntoPago As Modelos.Factura + Public Property Mensaje As Modelos.Factura.MMensajeFactura + End Class + + Public Class MAnticipoRelacionado + Public Property CveVenta As Integer + Public Property FolioFiscal As String + End Class + + Public Class MVentaDetalleCotizacion + Public Property CveVentaDetalle As Integer + Public Property Cantidad As Decimal + End Class Public Enum TipoMensajeRespuesta TextoLimpio = 0 HTML = 1 diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 4448e8232..9b21741e3 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -9501,9 +9501,11 @@ step: 30 }); - $("#TabAlmacen_tab .ajax__tab_inner").click(function () { - CargaMovimientosInventario(); - }); + if(<%= Me.HabilitarCargaAlmacen %> == true){ + $("#TabAlmacen_tab .ajax__tab_inner").click(function () { + CargaMovimientosInventario(); + }); + } } diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d10787938..1476aafc4 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -348,11 +348,11 @@ Partial Class Ventas ViewState("DTRemisiones") = value End Set End Property - Private Property ListaDescuentos As List(Of Descuentos) + Private Property ListaDescuentos As List(Of Modelos.VentaDescuentos) Get - Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Descuentos))) + Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Modelos.VentaDescuentos))) End Get - Set(value As List(Of Descuentos)) + Set(value As List(Of Modelos.VentaDescuentos)) ViewState("ListaDescuentos") = value End Set End Property @@ -1402,11 +1402,11 @@ Partial Class Ventas End Set End Property - Private Property ListaAnticiposAplicados As List(Of MAnticipoRelacionado) + Private Property ListaAnticiposAplicados As List(Of Modelos.MAnticipoRelacionado) Get - Return If(IsNothing(ViewState("ListaAnticiposAplicados")), Nothing, CType(ViewState("ListaAnticiposAplicados"), List(Of MAnticipoRelacionado))) + Return If(IsNothing(ViewState("ListaAnticiposAplicados")), Nothing, CType(ViewState("ListaAnticiposAplicados"), List(Of Modelos.MAnticipoRelacionado))) End Get - Set(value As List(Of MAnticipoRelacionado)) + Set(value As List(Of Modelos.MAnticipoRelacionado)) ViewState("ListaAnticiposAplicados") = value End Set End Property @@ -2308,6 +2308,15 @@ Partial Class Ventas End Set End Property + Public Property HabilitarCargaAlmacen As Boolean + Get + Return CBool(IfNull(ViewState("HabilitarCargaAlmacen"), False, ViewState("HabilitarCargaAlmacen"))) + End Get + Set(value As Boolean) + ViewState("HabilitarCargaAlmacen") = value + End Set + End Property + #End Region '#Region "AuxiliarConta" @@ -2412,7 +2421,7 @@ Partial Class Ventas RemisionesLista = New List(Of Integer) Pedidos2Lista = New List(Of Integer) CotizacionesLista = New List(Of Integer) - ListaDescuentos = New List(Of Descuentos) + ListaDescuentos = New List(Of Modelos.VentaDescuentos) CuentasContablesInvalidas = New StringBuilder CvePrePoliza = 0 @@ -5154,9 +5163,9 @@ Partial Class Ventas 'RELACIONAR ANTICIPOS APLICADOS If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then DdlTipoRelacionAnticipo.SelectedValueExist(7) - ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)() + ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)() For Each RowAnt As DataRow In DtAntRelacionados.Rows - ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()}) + ListaAnticiposAplicados.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = RowAnt("CveVentaRelacionada").ToString().ToEntero(), .FolioFiscal = RowAnt("FolioFiscal").ToString()}) Next Else HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() @@ -8105,7 +8114,7 @@ Partial Class Ventas Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating 'Dim TipoDescuento As Integer Dim Cantidad, PU, CantidadInventario As Decimal - Dim ObjDescuento As New Descuentos + Dim ObjDescuento As New Modelos.VentaDescuentos Dim CuentaPredial As String Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6) @@ -11834,7 +11843,7 @@ Partial Class Ventas ' ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" ' If ListaAnticiposAplicados IsNot Nothing Then - ' For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados + ' For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados ' ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) ' Next ' End If @@ -12407,7 +12416,7 @@ Partial Class Ventas Next Else If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then - For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados + For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) Next Else @@ -13152,7 +13161,7 @@ Partial Class Ventas 'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO If CveAnticipoPadre > 0 Then If ListaAnticiposAplicados IsNot Nothing Then - For Each Ant As MAnticipoRelacionado In ListaAnticiposAplicados + For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, Ant.CveVenta) Then ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico") End If @@ -14067,14 +14076,14 @@ Partial Class Ventas CveIEAnticipo = row2.DataKey("CveIE").ToString().ToEntero() importeMovimiento = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal) Dim ImporteAnticipo As Decimal = importeMovimiento - Dim Importe11MX As Decimal = ImporteAnticipo - Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero() If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then ImporteAnticipo = row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal * row2.DataKey("SubTotalAnticipo").ToDecimal + Dim Importe11MX As Decimal = ImporteAnticipo + IdCtaContable = IdCtaContAnticipos CveSubProyectoContabilizar = CveSubProyectoVenta @@ -16691,7 +16700,7 @@ Partial Class Ventas If ListaAnticiposAplicados IsNot Nothing Then ListaAnticiposAplicados.Clear() Else - ListaAnticiposAplicados = New List(Of MAnticipoRelacionado) + ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado) End If HdnIVACalculado.Value = HdnIVAOriginal.Value @@ -16699,7 +16708,7 @@ Partial Class Ventas If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then Amortizacion += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal ' - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal) HdnIVACalculado.Value = (HdnIVACalculado.Value.ToDouble - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo").ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)).FormatoNumero(2) - ListaAnticiposAplicados.Add(New MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")}) + ListaAnticiposAplicados.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")}) 'HdnFolioFiscalNC.Value = gvr.DataKey("FolioFiscal") 'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero() @@ -18515,7 +18524,7 @@ Partial Class Ventas Return True End Function - Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Descuentos + Private Function CalcularDescuentos(CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Modelos.VentaDescuentos Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then @@ -18543,7 +18552,7 @@ Partial Class Ventas Dim CvePromocionDetalle As Integer = 0 Dim IncluyeImpuestos As Boolean = False Dim TipoAplicacion As Integer = 1 ' 1 - descuento, 2 en PU - Dim ObjDescuento As New Descuentos + Dim ObjDescuento As New Modelos.VentaDescuentos If DdlSubProyectoDatos.SelectedValue = "11842" Then '' E141, el subproyecto: Franquicia, no proceden las promociones Return ObjDescuento @@ -18758,7 +18767,7 @@ Partial Class Ventas Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal) - Dim ObjDescuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU) + Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU) If ObjDescuento.EsPUModificado Then PU = ObjDescuento.PU End If @@ -18856,7 +18865,7 @@ Partial Class Ventas Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero() - Dim Descuento As Descuentos = CalcularDescuentos(CvePS, Cantidad, PU) + Dim Descuento As Modelos.VentaDescuentos = CalcularDescuentos(CvePS, Cantidad, PU) AgregarProductoServicio(Cantidad, DdlUMPyME.SelectedValue.ToEntero(), DdlUMPyME.SelectedItem.Text, DdlClasificacionPyME.SelectedValue.ToEntero(), DdlClasificacionPyME.SelectedItem.Text, CvePS, DdlPSPyME.SelectedText, TxtObsPyME.Text, PU, Descuento.ImporteDescuento, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) @@ -18956,7 +18965,7 @@ Partial Class Ventas Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0, Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, - Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Descuentos = Nothing) As Boolean + Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing) As Boolean Dim Retorno As Boolean = False Try @@ -20008,7 +20017,7 @@ Partial Class Ventas Dim strPromos As New StringBuilder If Not String.IsNullOrEmpty(Titulo) Then - For Each Promo As Descuentos In ListaDescuentos + For Each Promo As Modelos.VentaDescuentos In ListaDescuentos If Not String.IsNullOrEmpty(Promo.ObsDescuento) Then strPromos.AppendFormat("{0}, ", Promo.ObsDescuento) End If @@ -26191,7 +26200,7 @@ Partial Class Ventas Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal() Dim PU As Decimal = TxtPrecioPyME.Text.ToDecimal() - Dim ObjDescuento As Descuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero(), Cantidad, PU) + Dim ObjDescuento As Modelos.VentaDescuentos = CalcularDescuentos(DdlPSPyME.SelectedValue.ToEntero(), Cantidad, PU) TxtDescuentoPyME.Text = ObjDescuento.ImporteDescuento.FormatoNumero(2).Replace(","c, "") @@ -28055,22 +28064,30 @@ Partial Class Ventas SaldoMaximoUtilizable = 0 End If Else - Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then - Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) - DivSMU.Visible = True + 'SI ES DISTRUIBUIDOR DEBE CARGAR EN BASE SU SALDO DE USADOS, SI ES PISO PUEDE PERMITIR APLICAR TODO SU SALDO + If ClienteEsDistribuidor Then + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + + Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + If SaldoMaximo > 0 Then + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + SaldoMaximoUtilizable = 0 + End If - Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() - If SaldoMaximo > 0 Then - SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() Else SaldoMaximoUtilizable = 0 End If - + ObjAcum.Dispose() Else - SaldoMaximoUtilizable = 0 + If DtNC IsNot Nothing Then + SaldoMaximoUtilizable = DtNC.SUMD("Saldo") + End If End If - ObjAcum.Dispose() + End If If CveVentaUsado > 0 Then @@ -28235,16 +28252,21 @@ Partial Class Ventas SaldoMaximoUtilizable = 0 End If Else - Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then - Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) - DivSMU.Visible = True - SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + If Me.ClienteEsDistribuidor Then + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then + Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) + DivSMU.Visible = True + SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal() + Else + 'DivSMU.Visible = False + SaldoMaximoUtilizable = 0 + End If + ObjAcum.Dispose() Else - 'DivSMU.Visible = False - SaldoMaximoUtilizable = 0 + SaldoMaximoUtilizable = TmpDTRNCDetalle.SUMD("Total") End If - ObjAcum.Dispose() + End If If CveVentaUsado > 0 Then @@ -28459,7 +28481,7 @@ Partial Class Ventas DivRNCBonificaciones.Visible = True DivRNCBonificacionesDetalle.Visible = False - Dim ListaBon As New List(Of VentasBonificaciones) + Dim ListaBon As New List(Of Modelos.VentasBonificaciones) Dim DtBon As DataTable = Nothing Dim SbFiltro As New StringBuilder() SbFiltro.Append("CveVenta IN(") @@ -28483,7 +28505,7 @@ Partial Class Ventas For Each bon In queryBonificacion SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion) - ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) + ListaBon.Add(New Modelos.VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) Next SbFiltro.Remove(SbFiltro.Length - 1, 1) SbFiltro.Append(")") @@ -28627,7 +28649,7 @@ Partial Class Ventas ListaVentasRNCCargos = CvesVentaRNCCargo.Split(","c) End If - Dim ListaBon As New List(Of VentasBonificaciones) + Dim ListaBon As New List(Of Modelos.VentasBonificaciones) Dim DtBon As DataTable = Nothing Dim SbFiltro As New StringBuilder() SbFiltro.Append("CveVenta IN(") @@ -28659,7 +28681,7 @@ Partial Class Ventas For Each bon In queryBonificacion SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion) - ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) + ListaBon.Add(New Modelos.VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) Next SbFiltro.Remove(SbFiltro.Length - 1, 1) @@ -31403,7 +31425,7 @@ Partial Class Ventas Dim CveMetodoPago As Integer = -1 Dim MetodoPagoDif As Boolean = False - Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing + Dim ListaVentaDetalleCotizacion As List(Of Modelos.MVentaDetalleCotizacion) = Nothing If ChkCotProductos.Checked Then For Each row As DataRow In DTSeleccionadas.Rows @@ -31533,13 +31555,8 @@ Partial Class Ventas ' Return Not ErrorAjuste 'End Function - Private Class MVentaDetalleCotizacion - Public Property CveVentaDetalle As Integer - Public Property Cantidad As Decimal - End Class - - Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of MVentaDetalleCotizacion) - Dim Retorno As New List(Of MVentaDetalleCotizacion) + Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of Modelos.MVentaDetalleCotizacion) + Dim Retorno As New List(Of Modelos.MVentaDetalleCotizacion) Dim DTTamanios As DataTable = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa) @@ -31549,7 +31566,7 @@ Partial Class Ventas Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal Dr("Cantidad") = tCantidad - Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad}) + Retorno.Add(New Modelos.MVentaDetalleCotizacion() With {.CveVentaDetalle = Dr("CveVentaDetalle").ToString().ToEntero(), .Cantidad = tCantidad}) Next @@ -31608,7 +31625,7 @@ Partial Class Ventas Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero() SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado) - Retorno.Add(New MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()}) + Retorno.Add(New Modelos.MVentaDetalleCotizacion() With {.CveVentaDetalle = CveVentaDetalleUsado, .Cantidad = drowPsTamaños("Cantidad").ToString().ToDecimal()}) End If Next @@ -34447,18 +34464,6 @@ Partial Class Ventas ' ObjBancos.Dispose() ' If ObjAC IsNot Nothing Then ObjAC.Dispose() 'End Sub - Partial Class Descuentos - Public Consec As Integer - Public ImporteDescuento As Decimal = 0 - Public CvePromocionDetalle As Integer = -1 - Public PU As Decimal = 0 - Public EsPUModificado As Boolean = False - Public ImporteProntoPago As Decimal = 0 - Public NombrePromo As String = "" - Public CveMarca As Integer = -1 - Public ObsDescuento As String = "" - End Class - Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs) CargaEventoBitacora() End Sub @@ -34727,19 +34732,10 @@ Partial Class Ventas #End Region - Partial Class VentasBonificaciones - Public CveVentaRNCCargo As Integer = -1 - Public CveVentaBonificacion As Integer = -1 - Public ImporteBonificacion As Decimal = 0 - Public IVABonificacion As Decimal = 0 - End Class - - - #Region " N O T A - D E - C R E D I T O - P R O N T O - P A G O" - Private Function GenerarNCProntoPago(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjCliente As ClsClientes, ByRef ObjConta As ClsContPAQi, ObjFactura As Modelos.Factura) As MensajeProntoPago - Dim Retorno As New MensajeProntoPago + Private Function GenerarNCProntoPago(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjCliente As ClsClientes, ByRef ObjConta As ClsContPAQi, ObjFactura As Modelos.Factura) As Modelos.MensajeProntoPago + Dim Retorno As New Modelos.MensajeProntoPago Dim Resp As New Modelos.Factura.MMensajeFactura Dim ObjFacturaProntoPago As Modelos.Factura = Nothing @@ -35207,11 +35203,6 @@ Partial Class Ventas Return DtVentasNC End Function - Public Class MensajeProntoPago - Public Property ObjFacturaProntoPago As Modelos.Factura - Public Property Mensaje As Modelos.Factura.MMensajeFactura - End Class - #End Region Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs) @@ -35468,11 +35459,6 @@ Partial Class Ventas ' UpParametros.Update() 'End Sub - Public Class MAnticipoRelacionado - Public Property CveVenta As Integer - Public Property FolioFiscal As String - End Class - Protected Sub LnkEditarDir_Click(sender As Object, e As EventArgs) DdlDireccionEnvio.Enabled = True LnkEditarDir.Visible = False @@ -36451,7 +36437,7 @@ Partial Class Ventas 'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL If RowLinea("TipoLinea").ToString() = "2" Then - TxtFechaPago.Text = Now.AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy") + TxtFechaPago.Text = TxtFecha.Text.ToDate().AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy") Else TxtFechaPago.Text = RowLinea("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy") End If