From 6acac06ed772f99625ee4d7a7cbca8f6f1b442e0 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Sep 2022 18:40:17 -0700 Subject: [PATCH 1/5] Cambios en lineas adicionales en ventas --- App_Code/ClsVentas.vb | 3 ++- Ventas/Ventas.aspx | 36 +++++++++++++------------ Ventas/Ventas.aspx.vb | 62 ++++++++++++++++++++++++++++--------------- 3 files changed, 62 insertions(+), 39 deletions(-) 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: + + + + + + + + + @@ -2406,7 +2417,8 @@ - + +
@@ -2417,12 +2429,12 @@
-
- Emitir + Emitir +
@@ -2431,8 +2443,8 @@
- - <%--
+ + <%--
@@ -3443,17 +3455,7 @@
- - - - - +
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 From 58c42f142997185ae1b30a2c5d8a2b452a938314 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Sep 2022 18:42:25 -0700 Subject: [PATCH 2/5] Iniciar con foco en folio al buscar factura --- Ventas/PopUpBuscarFolio.aspx | 2 +- Ventas/PopUpBuscarFolio.aspx.vb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Ventas/PopUpBuscarFolio.aspx b/Ventas/PopUpBuscarFolio.aspx index 0345bb706..90f60f9a4 100644 --- a/Ventas/PopUpBuscarFolio.aspx +++ b/Ventas/PopUpBuscarFolio.aspx @@ -59,7 +59,7 @@
Folio: - + Folio Fiscal (UUID): diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index bdc26edb0..cabab782b 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -26,6 +26,8 @@ Partial Class PopUpBuscarFolio CargaClasificaciones() CargaPS(-1) 'CargaCodigoCliente() + + RegistraScript($"$('#{TxtFolio.ClientID}').focus();", "A1") End If End Sub From a08c401d09dee4a0a318bc3df8d8813f5a11cfb2 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Sep 2022 18:44:48 -0700 Subject: [PATCH 3/5] Validacion de fecha de ajuste --- Ventas/PV.aspx | 3 ++- Ventas/PV.aspx.vb | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 5cfaa7423..0e383970e 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2959,7 +2959,7 @@
- +
@@ -3174,6 +3174,7 @@ +
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index ef79851d5..c9c50c886 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -7130,12 +7130,22 @@ Partial Class PV 'End Sub Private Function CalculaMesesUso() As Boolean - Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1) + Dim FechaI As Date = Now + + If IsDate(TxtFechaAjuste.Text) Then + FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1) + Else + TxtMesesUso.Text = "" + Alert("La fecha de ajuste no tiene el formato correcto", TipoMensaje.MsgAdvertencia) + Return False + End If + Dim FechaF As Date = Now If FechaI.AddDays(-1) > FechaF Then + TxtMesesUso.Text = "" TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy") - Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.ToastAdventencia) + Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.MsgAdvertencia) Return False End If From c15c18a64563974a6c88149874947e6b81177497 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Sep 2022 18:45:13 -0700 Subject: [PATCH 4/5] Correcion de reporte de entradas y salidas de usados --- Empresas/140/Formatos/RepEntradasUsados.rdlc | 35 ++++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Empresas/140/Formatos/RepEntradasUsados.rdlc b/Empresas/140/Formatos/RepEntradasUsados.rdlc index 535e4b852..9ff9577d8 100644 --- a/Empresas/140/Formatos/RepEntradasUsados.rdlc +++ b/Empresas/140/Formatos/RepEntradasUsados.rdlc @@ -25,10 +25,18 @@ CodigoPS System.String + + Inicial + System.String + E_Almacen System.String + + E_Pub + System.String + E_Traspaso System.String @@ -37,6 +45,10 @@ E_Compra System.String + + E_Otros + System.String + S_Almacen System.String @@ -537,17 +549,18 @@ - + true true - 0 + =Fields!Inicial.Value @@ -556,7 +569,7 @@ - TipoAgrupador + Inicial @@ -630,7 +643,7 @@ - Paqueteria1 + E_Pub @@ -741,7 +754,7 @@ - Fecha + E_Otros