From f35a5fd2d5ef62ce98834c93635264b9ab539494 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 17 Sep 2024 20:40:17 -0700 Subject: [PATCH] Puntos GDiaz: --Selectivas --- App_Code/ClsPaginas.vb | 1 + App_Code/ClsProductosServicios.vb | 120 ++++++++++++++++++++++++++- Inventarios/InventarioFisico.aspx | 57 +++++++------ Inventarios/InventarioFisico.aspx.vb | 45 ++++++++++ Ventas/CatSelectivas.aspx | 85 +++++++++++++++++++ Ventas/CatSelectivas.aspx.vb | 91 ++++++++++++++++++++ Ventas/ProductosServicios.aspx | 8 +- Ventas/ProductosServicios.aspx.vb | 18 +++- 8 files changed, 395 insertions(+), 30 deletions(-) create mode 100644 Ventas/CatSelectivas.aspx create mode 100644 Ventas/CatSelectivas.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a1016870a..5c271e406 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10821,6 +10821,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatMotivosDevoluciones.aspx".ToUpper(), 786) PaginaDict.Add("/Ventas/CatPSSubProyectosVendedores.aspx".ToUpper(), 787) PaginaDict.Add("/Ventas/CatMotivosCancelacion.aspx".ToUpper(), 788) + PaginaDict.Add("/Ventas/CatSelectivas.aspx".ToUpper(), 897) #End Region #Region "VIA" diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 0c659229c..511e9125e 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -415,7 +415,7 @@ Public Class ClsProductosServicios Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1, Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0, Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, - Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0) As Integer + Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0, Optional CveSelectiva As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -526,6 +526,7 @@ Public Class ClsProductosServicios .Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion .Add("@Imagen", SqlDbType.VarChar).Value = Imagen .Add("@PorcentajeMinimoUtilidad", SqlDbType.Decimal).Value = PorcentajeMinimoUtilidad + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva End With Try @@ -682,7 +683,8 @@ Public Class ClsProductosServicios Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0, Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1, Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0, - Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0) As Boolean + Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0, + Optional CveSelectiva As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -792,6 +794,7 @@ Public Class ClsProductosServicios .Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion .Add("@Imagen", SqlDbType.VarChar).Value = Imagen .Add("@PorcentajeMinimoUtilidad", SqlDbType.Decimal).Value = PorcentajeMinimoUtilidad + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva End With Try @@ -1663,6 +1666,119 @@ Public Class ClsProductosServicios End Function + Public Function AddSelectiva(Selectiva As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SelectivasAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@Selectiva", SqlDbType.VarChar).Value = Selectiva + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al Guardar la Selectiva.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Guardar la Selectiva.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateSelectiva(CveSelectiva As Integer, Selectiva As String, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SelectivasUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva + .Add("@Selectiva", SqlDbType.VarChar).Value = Selectiva + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al Guardar la Selectiva.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al Guardar la Selectiva.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetSelectiva(CveSelectiva As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SelectivasGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las selectivas.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las selectivas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveSelectiva(CveSelectiva As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SelectivasRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar las selectivas.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar las selectivas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetPSSelectiva(CveSelectiva As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Gral_SelectivasPSGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSelectiva", SqlDbType.Int).Value = CveSelectiva + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener las selectivas.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener las selectivas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + #Region "IMPUESTOS LOCALES" Public Function GetPSImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Inventarios/InventarioFisico.aspx b/Inventarios/InventarioFisico.aspx index ab41787cf..95b1574df 100644 --- a/Inventarios/InventarioFisico.aspx +++ b/Inventarios/InventarioFisico.aspx @@ -28,7 +28,8 @@
-
SubProyecto:
+
+ SubProyecto:
@@ -89,9 +90,9 @@ - + - + @@ -218,7 +219,7 @@
- + @@ -254,8 +255,7 @@
- - +
@@ -263,11 +263,22 @@
+
+
+
+ +
+ +
+ +
+
+
- + @@ -314,7 +325,7 @@ - + @@ -345,11 +356,10 @@
- - +
-
+
@@ -390,23 +400,22 @@
- - +
-
+
- +
- + - + @@ -420,7 +429,7 @@
-
+
@@ -438,12 +447,12 @@
- +
-
+
@@ -460,12 +469,12 @@ - + - + @@ -483,11 +492,11 @@
- +
- +
+
+ + + + +
@@ -276,7 +282,6 @@
-
@@ -350,6 +355,7 @@
+
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index f2f5634ac..a1a86883c 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -450,6 +450,9 @@ Partial Class ProductosyServicios DivPSAdicionales.Visible = True DivTipoAdicional.Visible = True DivPorMinimoUtilidad.Visible = True + DivSelectiva.Visible = True + + CargaSelectivas() End If CvePSAdicional = -1 @@ -473,7 +476,15 @@ Partial Class ProductosyServicios End If End Sub - + Private Sub CargaSelectivas() + Using ObjPS As New ClsProductosServicios + If ObjPS.GetSelectiva(-1, UsuarioActual.CveEmpresa) Then + DdlSelectiva.DataSource = ObjPS.DtResultados + End If + End Using + DdlSelectiva.DataBind() + DdlSelectiva.Items.Insert(0, New ListItem("-", "-1")) + End Sub Private Sub CargaCombosPSComplementos() DdlClaveSectorCOFEPRIS.DataSource = GlobalDT_SAT_CP_SectorCOFEPRIS @@ -1152,6 +1163,7 @@ Partial Class ProductosyServicios If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then TxtPorMinimoUtilidad.Text = ObjProductosServicios.DtResultados.Rows(0)("PorcentajeMinimoUtilidad").ToString + DdlSelectiva.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveSelectiva").ToString) End If Else Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) @@ -1550,7 +1562,7 @@ Partial Class ProductosyServicios CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked, NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, - PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) > 0 Then + PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal(), CveSelectiva:=DdlSelectiva.SelectedValue.ToEntero()) > 0 Then ViewState("CvePS") = ObjProductosServicios.CvePS For Each GVR As GridViewRow In GvImpuestosLocales.Rows If GVR.FCCheckBox("ChkDeduccion").Checked Then @@ -1624,7 +1636,7 @@ Partial Class ProductosyServicios RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked, NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), ActivoEcommerce:=ChkActivoEcommerce.Checked, EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, - CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) Then + CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal(), CveSelectiva:=DdlSelectiva.SelectedValue.ToEntero()) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then TieneError = True