From 7605cae8e06950a57dd861c3872e569c31341c8d Mon Sep 17 00:00:00 2001 From: Raul Pimienta Date: Wed, 4 Sep 2019 18:25:45 -0700 Subject: [PATCH] SeccionAlmacen en PS --- App_Code/ClsInventarios.vb | 49 ++++++++++++++ Ventas/ProductosServicios.aspx | 107 +++++++++++++++++++++++++++--- Ventas/ProductosServicios.aspx.vb | 82 +++++++++++++++++++++++ 3 files changed, 228 insertions(+), 10 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e5b2e1482..05f3aaefd 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4663,6 +4663,55 @@ Public Class ClsInventarios End Try Return Retorno End Function + Public Function AddProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function GetProductosServiciosAlmacenSeccion(CvePS As Integer, CveAlmacen As Integer, CveAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacenSeccion", SqlDbType.Int).Value = CveAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + Public Function RemoveProductosServiciosAlmacenSeccion(CvePSAlmacenSeccion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_ProductosServiciosAlmacenSeccionRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePSAlmacenSeccion", SqlDbType.Int).Value = CvePSAlmacenSeccion + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el ps de la seccion de almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + #End Region diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index a58e7234a..38921f40b 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -209,9 +209,9 @@ - - + +
Seleccione @@ -548,10 +548,12 @@
+
+
@@ -715,6 +717,7 @@
Seleccionar Todos +
@@ -932,8 +935,47 @@
+
+
+ + +
+
+
+
+ + Secciones de Almacen +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+
+
+
- @@ -1005,25 +1047,29 @@ Característica - + + Opción - + + Fecha Ing. - + + Usuario - + + @@ -1664,6 +1710,7 @@

El producto seleccionado en el recuadro de arriba sera unificado en el producto actual +

@@ -1895,6 +1942,7 @@

Tipo de Clasificación: +

@@ -1904,6 +1952,7 @@   +
@@ -1972,6 +2021,45 @@
+ + <%-- MODAL PS ADICIONALES --%> + + <%-- FIN MODAL PS ADICIONALES --%> @@ -2149,9 +2237,8 @@ var initcarusel2 = initcarusel; - function ADSReady() - { - setPoscicion(); + function ADSReady() { + setPoscicion(); } //TERMINA: ECOMMERCE diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 165888d40..873cd7766 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -97,6 +97,15 @@ Partial Class ProductosyServicios ViewState("CvePSAdicional") = value End Set End Property + Public Property DtSeccionAlmacen() As DataTable + Get + Return CType(ViewState("DtSeccionAlmacen"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtSeccionAlmacen") = value + End Set + End Property + #End Region @@ -137,6 +146,7 @@ Partial Class ProductosyServicios CargarAlias() CargaExistencias() + CargaGvSeccionAlmacen() Else 'Configuración de Modalidad Insert RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") @@ -275,6 +285,11 @@ Partial Class ProductosyServicios CargaDdlFraccionArancelaria() CveSATPS = -1 + CargaCombosSeccionAlmacen() + DivSeccionAlmacen.Visible = UsuarioActual.Empresa.Funcionalidad(563).ToString = "1" + + CreaDtSeccionAlmacen() + If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContables() If Not (Request("CvePS") IsNot Nothing AndAlso IsNumeric(Request("CvePS")) AndAlso Request("CvePS").ToEntero > 0) Then DivUsoClasificacion.Visible = True @@ -2462,4 +2477,71 @@ Partial Class ProductosyServicios DdlCategoriaToxicidad.SelectedValue = "000" End If End Sub + +#Region "SECCION ALMACEN" + + Private Sub CreaDtSeccionAlmacen() + DtSeccionAlmacen = New DataTable + DtSeccionAlmacen.Columns.Add("CvePSAlmacenSeccion", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("CvePS", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("CveAlmacen", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("Almacen", GetType(String)) + DtSeccionAlmacen.Columns.Add("CveAlmacenSeccion", GetType(Integer)) + DtSeccionAlmacen.Columns.Add("AlmacenSeccion", GetType(String)) + End Sub + Private Sub CargaGvSeccionAlmacen() + Dim ObjInv As New ClsInventarios + If ObjInv.GetProductosServiciosAlmacenSeccion(CvePS, -1, -1) Then + GvSeccionAlmacen.DataSource = ObjInv.DtResultados + DtSeccionAlmacen = ObjInv.DtResultados + End If + ObjInv.Dispose() + GvSeccionAlmacen.DataBind() + UpSeccionAlmacen.Update() + End Sub + + + Private Sub CargaCombosSeccionAlmacen() + DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveAlmacen) + DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1")) + DdlAlmacen.DataBind() + + DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveAlmacen) + DdlSeccionAlmacen.Items.Add(New ListItem("Seleccione", "-1")) + DdlSeccionAlmacen.DataBind() + + End Sub + + Protected Sub LnkSeccionAlmacenAdd_Click(sender As Object, e As EventArgs) + DdlAlmacen.SelectedIndex = 0 + DdlSeccionAlmacen.SelectedIndex = 0 + RegistraScript("$('#DivAddSeccionAlmacen').modal();") + UpModalSeccionAlmacen.Update() + End Sub + Protected Sub LnkEditarSeccionAlmacen_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + DdlAlmacen.SelectedValueExist(gvRow.DataKey("CvAlmacen")) + DdlSeccionAlmacen.SelectedValueExist(gvRow.DataKey("CveAlmacenSeccion")) + RegistraScript("$('#DivAddSeccionAlmacen').modal();") + UpModalSeccionAlmacen.Update() + End Sub + Protected Sub LnkRemoveSeccionAlmacen_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + If gvRow.DataKey("CvePSAlmacenSeccion").ToEntero > 0 Then + DtSeccionAlmacen.Rows(gvRow.RowIndex)("CvePS") = -1 + Else + DtSeccionAlmacen.Rows(gvRow.RowIndex.ToEntero).Delete() + End If + DtSeccionAlmacen.AcceptChanges() + GvSeccionAlmacen.DataSource = DtSeccionAlmacen + GvSeccionAlmacen.DataBind() + End Sub + + Protected Sub BtnAddSeccionAlmacen_Click(sender As Object, e As EventArgs) + + End Sub + +#End Region + + End Class