diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6af729f4c..916f8d655 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5603,7 +5603,7 @@ Public Class ClsVentas End Function - Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1) As Boolean + Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1, Optional FechaVencimientoConsulta As DateTime = MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_LineasAdicionalesSaldoGet") @@ -5615,6 +5615,7 @@ Public Class ClsVentas .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo + .Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta End With Try SqlAdapter.Fill(Data) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 180aa01e7..4f54a399f 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -713,6 +713,17 @@ +
| Linea Adicional: | -
- |
-
- |
-
| Forma de entrega: |
@@ -7825,7 +7827,7 @@
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index de40d3115..7df6471b7 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2249,12 +2249,12 @@ Partial Class Ventas
End Set
End Property
- Private Property CveClasificacionLineaAdicional As Integer
+ Private Property CveCategoriaLineaAdicional As Integer
Get
- Return IfNull(ViewState("CveClasificacionLineaAdicional"), "-1", ViewState("CveClasificacionLineaAdicional")).ToString().ToEntero()
+ Return IfNull(ViewState("CveCategoriaLineaAdicional"), "-1", ViewState("CveCategoriaLineaAdicional")).ToString().ToEntero()
End Get
Set(value As Integer)
- ViewState("CveClasificacionLineaAdicional") = value
+ ViewState("CveCategoriaLineaAdicional") = value
End Set
End Property
@@ -8844,11 +8844,21 @@ Partial Class Ventas
'VALIDAR LINEAS ADICIONALES
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
- 'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
- If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
- For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
- If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
- Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
+ If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
+ For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
+ Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
+
+ If RowClasificacion IsNot Nothing Then
+ Dim CveCategoria As Integer = Row("CveCategoria").ToString().ToEntero()
+ Dim Categoria As String = Row("Categoria").ToString()
+
+ If Me.CveCategoriaLineaAdicional <> CveCategoria Then
+ Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Else
+ Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Next
@@ -14683,12 +14693,12 @@ Partial Class Ventas
End If
'Factura
- If Not ObjEventos.AddEventoBitacora($"Remisión facturada : {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
+ If Not ObjEventos.AddEventoBitacora($"Venta facturada de Remisión: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
ErrorPrepoliza = True
End If
'Remision
- If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
+ If Not ObjEventos.AddEventoBitacora($"Remisión facturada en Venta: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
ErrorPrepoliza = True
End If
Next
@@ -18079,11 +18089,11 @@ Partial Class Ventas
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=-1) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
- DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"Saldo > 0 OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
+ DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= {Now.ToString("dd/MM/yyyy")}) OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
End If
End If
Else
- If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -18104,7 +18114,7 @@ Partial Class Ventas
End If
- UPCondicionesPago.Update()
+ UpParametros.Update()
End Sub
@@ -35302,26 +35312,36 @@ Partial Class Ventas
If ObjVentas.DtResultados.Rows.Count > 0 Then
TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal()
- Me.CveClasificacionLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveClasificacionPS").ToString().ToEntero()
+ Me.CveCategoriaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveCategoria").ToString().ToEntero()
Me.CveMonedaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveMoneda").ToString().ToEntero()
End If
End If
End Using
Else
Me.SaldoLineaAdicional = 0
- Me.CveClasificacionLineaAdicional = 0
+ Me.CveCategoriaLineaAdicional = 0
End If
- UPCondicionesPago.Update()
+ UpParametros.Update()
End Sub
Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs)
'VALIDAR LINEAS ADICIONALES
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
- 'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
- If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
- For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
- If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
- Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ 'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
+ If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
+ For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
+ Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
+
+ If RowClasificacion IsNot Nothing Then
+ Dim CveCategoria As Integer = Row("CveCategoria").ToString().ToEntero()
+ Dim Categoria As String = Row("Categoria").ToString()
+
+ If Me.CveCategoriaLineaAdicional <> CveCategoria Then
+ Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Else
+ Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Next
|