Cambios de objetos de ventas a modelos
This commit is contained in:
@@ -301,6 +301,40 @@ Namespace Modelos
|
|||||||
|
|
||||||
|
|
||||||
#Region " OBJETOS Ventas"
|
#Region " OBJETOS Ventas"
|
||||||
|
<Serializable>
|
||||||
|
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
|
||||||
|
<Serializable>
|
||||||
|
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
|
||||||
|
<Serializable>
|
||||||
|
Public Class MensajeProntoPago
|
||||||
|
Public Property ObjFacturaProntoPago As Modelos.Factura
|
||||||
|
Public Property Mensaje As Modelos.Factura.MMensajeFactura
|
||||||
|
End Class
|
||||||
|
<Serializable>
|
||||||
|
Public Class MAnticipoRelacionado
|
||||||
|
Public Property CveVenta As Integer
|
||||||
|
Public Property FolioFiscal As String
|
||||||
|
End Class
|
||||||
|
<Serializable>
|
||||||
|
Public Class MVentaDetalleCotizacion
|
||||||
|
Public Property CveVentaDetalle As Integer
|
||||||
|
Public Property Cantidad As Decimal
|
||||||
|
End Class
|
||||||
Public Enum TipoMensajeRespuesta
|
Public Enum TipoMensajeRespuesta
|
||||||
TextoLimpio = 0
|
TextoLimpio = 0
|
||||||
HTML = 1
|
HTML = 1
|
||||||
|
|||||||
@@ -9501,9 +9501,11 @@
|
|||||||
step: 30
|
step: 30
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
|
if(<%= Me.HabilitarCargaAlmacen %> == true){
|
||||||
CargaMovimientosInventario();
|
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
|
||||||
});
|
CargaMovimientosInventario();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -348,11 +348,11 @@ Partial Class Ventas
|
|||||||
ViewState("DTRemisiones") = value
|
ViewState("DTRemisiones") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Private Property ListaDescuentos As List(Of Descuentos)
|
Private Property ListaDescuentos As List(Of Modelos.VentaDescuentos)
|
||||||
Get
|
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
|
End Get
|
||||||
Set(value As List(Of Descuentos))
|
Set(value As List(Of Modelos.VentaDescuentos))
|
||||||
ViewState("ListaDescuentos") = value
|
ViewState("ListaDescuentos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -1402,11 +1402,11 @@ Partial Class Ventas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property ListaAnticiposAplicados As List(Of MAnticipoRelacionado)
|
Private Property ListaAnticiposAplicados As List(Of Modelos.MAnticipoRelacionado)
|
||||||
Get
|
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
|
End Get
|
||||||
Set(value As List(Of MAnticipoRelacionado))
|
Set(value As List(Of Modelos.MAnticipoRelacionado))
|
||||||
ViewState("ListaAnticiposAplicados") = value
|
ViewState("ListaAnticiposAplicados") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -2308,6 +2308,15 @@ Partial Class Ventas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
#End Region
|
||||||
|
|
||||||
'#Region "AuxiliarConta"
|
'#Region "AuxiliarConta"
|
||||||
@@ -2412,7 +2421,7 @@ Partial Class Ventas
|
|||||||
RemisionesLista = New List(Of Integer)
|
RemisionesLista = New List(Of Integer)
|
||||||
Pedidos2Lista = New List(Of Integer)
|
Pedidos2Lista = New List(Of Integer)
|
||||||
CotizacionesLista = New List(Of Integer)
|
CotizacionesLista = New List(Of Integer)
|
||||||
ListaDescuentos = New List(Of Descuentos)
|
ListaDescuentos = New List(Of Modelos.VentaDescuentos)
|
||||||
|
|
||||||
CuentasContablesInvalidas = New StringBuilder
|
CuentasContablesInvalidas = New StringBuilder
|
||||||
CvePrePoliza = 0
|
CvePrePoliza = 0
|
||||||
@@ -5154,9 +5163,9 @@ Partial Class Ventas
|
|||||||
'RELACIONAR ANTICIPOS APLICADOS
|
'RELACIONAR ANTICIPOS APLICADOS
|
||||||
If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then
|
If DbRowVenta("CveTipoRelacion").ToString().ToEntero() = 7 AndAlso DtAntRelacionados IsNot Nothing AndAlso DtAntRelacionados.Rows.Count > 0 Then
|
||||||
DdlTipoRelacionAnticipo.SelectedValueExist(7)
|
DdlTipoRelacionAnticipo.SelectedValueExist(7)
|
||||||
ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)()
|
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)()
|
||||||
For Each RowAnt As DataRow In DtAntRelacionados.Rows
|
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
|
Next
|
||||||
Else
|
Else
|
||||||
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
|
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
|
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
|
||||||
'Dim TipoDescuento As Integer
|
'Dim TipoDescuento As Integer
|
||||||
Dim Cantidad, PU, CantidadInventario As Decimal
|
Dim Cantidad, PU, CantidadInventario As Decimal
|
||||||
Dim ObjDescuento As New Descuentos
|
Dim ObjDescuento As New Modelos.VentaDescuentos
|
||||||
Dim CuentaPredial As String
|
Dim CuentaPredial As String
|
||||||
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
||||||
PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6)
|
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"
|
' ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||||
|
|
||||||
' If ListaAnticiposAplicados IsNot Nothing Then
|
' 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)
|
' ObjFactura.Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||||
' Next
|
' Next
|
||||||
' End If
|
' End If
|
||||||
@@ -12407,7 +12416,7 @@ Partial Class Ventas
|
|||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
|
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)
|
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
@@ -13152,7 +13161,7 @@ Partial Class Ventas
|
|||||||
'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO
|
'SI TIENE UN ANTICIPO TAMBIEN DEBE RELACIONARLO
|
||||||
If CveAnticipoPadre > 0 Then
|
If CveAnticipoPadre > 0 Then
|
||||||
If ListaAnticiposAplicados IsNot Nothing 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
|
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")
|
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||||
End If
|
End If
|
||||||
@@ -14067,14 +14076,14 @@ Partial Class Ventas
|
|||||||
CveIEAnticipo = row2.DataKey("CveIE").ToString().ToEntero()
|
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)
|
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 ImporteAnticipo As Decimal = importeMovimiento
|
||||||
Dim Importe11MX As Decimal = ImporteAnticipo
|
|
||||||
|
|
||||||
Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero()
|
Dim CveMonedaAnticipo As Integer = row2.DataKey("CveMoneda").ToString().ToEntero()
|
||||||
|
|
||||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
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
|
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
|
IdCtaContable = IdCtaContAnticipos
|
||||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||||
|
|
||||||
@@ -16691,7 +16700,7 @@ Partial Class Ventas
|
|||||||
If ListaAnticiposAplicados IsNot Nothing Then
|
If ListaAnticiposAplicados IsNot Nothing Then
|
||||||
ListaAnticiposAplicados.Clear()
|
ListaAnticiposAplicados.Clear()
|
||||||
Else
|
Else
|
||||||
ListaAnticiposAplicados = New List(Of MAnticipoRelacionado)
|
ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
HdnIVACalculado.Value = HdnIVAOriginal.Value
|
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
|
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)
|
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)
|
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")
|
'HdnFolioFiscalNC.Value = gvr.DataKey("FolioFiscal")
|
||||||
|
|
||||||
'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero()
|
'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero()
|
||||||
@@ -18515,7 +18524,7 @@ Partial Class Ventas
|
|||||||
Return True
|
Return True
|
||||||
|
|
||||||
End Function
|
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
|
Dim Descuento As Decimal = HdnDescuento.Value.ToDecimal
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
||||||
@@ -18543,7 +18552,7 @@ Partial Class Ventas
|
|||||||
Dim CvePromocionDetalle As Integer = 0
|
Dim CvePromocionDetalle As Integer = 0
|
||||||
Dim IncluyeImpuestos As Boolean = False
|
Dim IncluyeImpuestos As Boolean = False
|
||||||
Dim TipoAplicacion As Integer = 1 ' 1 - descuento, 2 en PU
|
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
|
If DdlSubProyectoDatos.SelectedValue = "11842" Then '' E141, el subproyecto: Franquicia, no proceden las promociones
|
||||||
Return ObjDescuento
|
Return ObjDescuento
|
||||||
@@ -18758,7 +18767,7 @@ Partial Class Ventas
|
|||||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||||
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.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
|
If ObjDescuento.EsPUModificado Then
|
||||||
PU = ObjDescuento.PU
|
PU = ObjDescuento.PU
|
||||||
End If
|
End If
|
||||||
@@ -18856,7 +18865,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim CvePS As Integer = DdlPSPyME.SelectedValue.ToEntero()
|
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,
|
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)
|
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 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 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 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
|
Dim Retorno As Boolean = False
|
||||||
Try
|
Try
|
||||||
@@ -20008,7 +20017,7 @@ Partial Class Ventas
|
|||||||
Dim strPromos As New StringBuilder
|
Dim strPromos As New StringBuilder
|
||||||
If Not String.IsNullOrEmpty(Titulo) Then
|
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
|
If Not String.IsNullOrEmpty(Promo.ObsDescuento) Then
|
||||||
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
||||||
End If
|
End If
|
||||||
@@ -26191,7 +26200,7 @@ Partial Class Ventas
|
|||||||
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
Dim Cantidad As Decimal = TxtCantidadPyME.Text.ToDecimal()
|
||||||
Dim PU As Decimal = TxtPrecioPyME.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, "")
|
TxtDescuentoPyME.Text = ObjDescuento.ImporteDescuento.FormatoNumero(2).Replace(","c, "")
|
||||||
|
|
||||||
@@ -28055,22 +28064,30 @@ Partial Class Ventas
|
|||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoUtilizable = 0
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
'SI ES DISTRUIBUIDOR DEBE CARGAR EN BASE SU SALDO DE USADOS, SI ES PISO PUEDE PERMITIR APLICAR TODO SU SALDO
|
||||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
If ClienteEsDistribuidor Then
|
||||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
DivSMU.Visible = True
|
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
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoUtilizable = 0
|
||||||
End If
|
End If
|
||||||
|
ObjAcum.Dispose()
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
If DtNC IsNot Nothing Then
|
||||||
|
SaldoMaximoUtilizable = DtNC.SUMD("Saldo")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveVentaUsado > 0 Then
|
If CveVentaUsado > 0 Then
|
||||||
@@ -28235,16 +28252,21 @@ Partial Class Ventas
|
|||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoUtilizable = 0
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
If Me.ClienteEsDistribuidor Then
|
||||||
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
|
||||||
DivSMU.Visible = True
|
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
|
||||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
DivSMU.Visible = True
|
||||||
|
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||||
|
Else
|
||||||
|
'DivSMU.Visible = False
|
||||||
|
SaldoMaximoUtilizable = 0
|
||||||
|
End If
|
||||||
|
ObjAcum.Dispose()
|
||||||
Else
|
Else
|
||||||
'DivSMU.Visible = False
|
SaldoMaximoUtilizable = TmpDTRNCDetalle.SUMD("Total")
|
||||||
SaldoMaximoUtilizable = 0
|
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveVentaUsado > 0 Then
|
If CveVentaUsado > 0 Then
|
||||||
@@ -28459,7 +28481,7 @@ Partial Class Ventas
|
|||||||
DivRNCBonificaciones.Visible = True
|
DivRNCBonificaciones.Visible = True
|
||||||
DivRNCBonificacionesDetalle.Visible = False
|
DivRNCBonificacionesDetalle.Visible = False
|
||||||
|
|
||||||
Dim ListaBon As New List(Of VentasBonificaciones)
|
Dim ListaBon As New List(Of Modelos.VentasBonificaciones)
|
||||||
Dim DtBon As DataTable = Nothing
|
Dim DtBon As DataTable = Nothing
|
||||||
Dim SbFiltro As New StringBuilder()
|
Dim SbFiltro As New StringBuilder()
|
||||||
SbFiltro.Append("CveVenta IN(")
|
SbFiltro.Append("CveVenta IN(")
|
||||||
@@ -28483,7 +28505,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
For Each bon In queryBonificacion
|
For Each bon In queryBonificacion
|
||||||
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
|
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
|
Next
|
||||||
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
||||||
SbFiltro.Append(")")
|
SbFiltro.Append(")")
|
||||||
@@ -28627,7 +28649,7 @@ Partial Class Ventas
|
|||||||
ListaVentasRNCCargos = CvesVentaRNCCargo.Split(","c)
|
ListaVentasRNCCargos = CvesVentaRNCCargo.Split(","c)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ListaBon As New List(Of VentasBonificaciones)
|
Dim ListaBon As New List(Of Modelos.VentasBonificaciones)
|
||||||
Dim DtBon As DataTable = Nothing
|
Dim DtBon As DataTable = Nothing
|
||||||
Dim SbFiltro As New StringBuilder()
|
Dim SbFiltro As New StringBuilder()
|
||||||
SbFiltro.Append("CveVenta IN(")
|
SbFiltro.Append("CveVenta IN(")
|
||||||
@@ -28659,7 +28681,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
For Each bon In queryBonificacion
|
For Each bon In queryBonificacion
|
||||||
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
|
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
|
Next
|
||||||
|
|
||||||
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
SbFiltro.Remove(SbFiltro.Length - 1, 1)
|
||||||
@@ -31403,7 +31425,7 @@ Partial Class Ventas
|
|||||||
Dim CveMetodoPago As Integer = -1
|
Dim CveMetodoPago As Integer = -1
|
||||||
Dim MetodoPagoDif As Boolean = False
|
Dim MetodoPagoDif As Boolean = False
|
||||||
|
|
||||||
Dim ListaVentaDetalleCotizacion As List(Of MVentaDetalleCotizacion) = Nothing
|
Dim ListaVentaDetalleCotizacion As List(Of Modelos.MVentaDetalleCotizacion) = Nothing
|
||||||
|
|
||||||
If ChkCotProductos.Checked Then
|
If ChkCotProductos.Checked Then
|
||||||
For Each row As DataRow In DTSeleccionadas.Rows
|
For Each row As DataRow In DTSeleccionadas.Rows
|
||||||
@@ -31533,13 +31555,8 @@ Partial Class Ventas
|
|||||||
' Return Not ErrorAjuste
|
' Return Not ErrorAjuste
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
Private Class MVentaDetalleCotizacion
|
Private Function CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) As List(Of Modelos.MVentaDetalleCotizacion)
|
||||||
Public Property CveVentaDetalle As Integer
|
Dim Retorno As New List(Of Modelos.MVentaDetalleCotizacion)
|
||||||
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)
|
|
||||||
|
|
||||||
Dim DTTamanios As DataTable = ClsPaginas.GlobalDTAcumTamaños(UsuarioActual.CveEmpresa)
|
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
|
Dim tCantidad = If(ChkCotProductos.Checked, GvCotPS.Rows(IndiceGVCotDataKey(GvCotPS, Dr("CveVentaDetalle").ToString())).FCTextBox("TxtCantidadCot").Text.ToDecimal, Dr("Cantidad")).ToString().ToDecimal
|
||||||
Dr("Cantidad") = tCantidad
|
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
|
Next
|
||||||
|
|
||||||
@@ -31608,7 +31625,7 @@ Partial Class Ventas
|
|||||||
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero()
|
||||||
SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado)
|
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
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -34447,18 +34464,6 @@ Partial Class Ventas
|
|||||||
' ObjBancos.Dispose()
|
' ObjBancos.Dispose()
|
||||||
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
' If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||||
'End Sub
|
'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)
|
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
|
||||||
CargaEventoBitacora()
|
CargaEventoBitacora()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -34727,19 +34732,10 @@ Partial Class Ventas
|
|||||||
#End Region
|
#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"
|
#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
|
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 MensajeProntoPago
|
Dim Retorno As New Modelos.MensajeProntoPago
|
||||||
|
|
||||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||||
Dim ObjFacturaProntoPago As Modelos.Factura = Nothing
|
Dim ObjFacturaProntoPago As Modelos.Factura = Nothing
|
||||||
@@ -35207,11 +35203,6 @@ Partial Class Ventas
|
|||||||
Return DtVentasNC
|
Return DtVentasNC
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Class MensajeProntoPago
|
|
||||||
Public Property ObjFacturaProntoPago As Modelos.Factura
|
|
||||||
Public Property Mensaje As Modelos.Factura.MMensajeFactura
|
|
||||||
End Class
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAplicarRNCDevolucion_Click(sender As Object, e As EventArgs)
|
||||||
@@ -35468,11 +35459,6 @@ Partial Class Ventas
|
|||||||
' UpParametros.Update()
|
' UpParametros.Update()
|
||||||
'End Sub
|
'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)
|
Protected Sub LnkEditarDir_Click(sender As Object, e As EventArgs)
|
||||||
DdlDireccionEnvio.Enabled = True
|
DdlDireccionEnvio.Enabled = True
|
||||||
LnkEditarDir.Visible = False
|
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
|
'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL
|
||||||
If RowLinea("TipoLinea").ToString() = "2" Then
|
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
|
Else
|
||||||
TxtFechaPago.Text = RowLinea("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
|
TxtFechaPago.Text = RowLinea("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user