diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx b/Inventarios/PaquetesArmadoDesarmado.aspx index 403797160..bfd8a8fee 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx +++ b/Inventarios/PaquetesArmadoDesarmado.aspx @@ -216,26 +216,21 @@
- + - + - + - + - - - - - - + @@ -243,11 +238,12 @@ - + - + +
@@ -488,7 +484,7 @@
- + @@ -509,6 +505,11 @@ + + + + + diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 8af94a12a..d76c06fd0 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -88,14 +88,16 @@ Partial Class Inventarios_PaquetesArmadoDesarmado ViewState("CveCliente") = value End Set End Property - Private Property CveTipoPS As Integer + + Private Property AplicaSerie As Boolean Get - Return CType(ViewState("CveTipoPS"), Integer) + Return CType(ViewState("AplicaSerie"), Boolean) End Get - Set(value As Integer) - ViewState("CveTipoPS") = value + Set(value As Boolean) + ViewState("AplicaSerie") = value End Set End Property + Private Property DtSeriesDesarmado As DataTable Get Return CType(ViewState("DtSeriesDesarmado"), DataTable) @@ -208,7 +210,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim ObjProductosServicios As New ClsProductosServicios Dim DtDatos As New DataTable - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero + Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("") + Dim AplicaSerie As Boolean = False + Dim CveUMTemp = drP("CveUM").ToString.ToEntero If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then DtDatos = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy Else @@ -240,15 +244,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Next - Dim AplicaSerie As String = "" + If ErrorExistencias Then Alert(TextoExistencias, TipoMensaje.MsgAdvertencia) Else - AplicaSerie = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("AplicaSerie") + AplicaSerie = CBool(drP("AplicaSerie")) BtnGuadarArmado.Visible = True End If - If AplicaSerie = "True" Then + If AplicaSerie Then DivSeriesPaqueteArmado.Visible = True Dim Dt As New DataTable Dt.Columns.Add("Row", GetType(Integer)) @@ -274,9 +278,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.DataSource = DtDatos GvDatosArmado.DataBind() - If ErrorExistencias Then - GvDatosArmado.Columns(4).Visible = False - End If + GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True" + 'GvDatosArmado.Columns(6).Visible = DtDatos.MAX("Serie", "") <> "" + GvDatosArmado.Columns(6).Visible = False 'DtDatos.MAX("Lote", "") <> "" + GvDatosArmado.Columns(7).Visible = False 'DtDatos.MAX("FechaCaducidad", "FechaCaducidad is not null").ToDate > MinFecha + + 'If ErrorExistencias Then + ' GvDatosArmado.Columns(4).Visible = False + 'End If UpDatosArmado.Update() UpGeneralesArmado.Update() @@ -285,7 +294,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado DtDatosDetalle.Clear() BtnGuadarDesarmado.Visible = False TotalDesarmado.Visible = False - CveTipoPS = -1 + AplicaSerie = False TxtSerieDesarmado.Text = "" CvePaqueteDesarmado = -1 TipoMovimiento = 2 @@ -299,7 +308,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado BtnAgregarSerieDesarmado.Enabled = True - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero + Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimero("") + + Dim CveUMTemp = drP("CveUM").ToString.ToEntero CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1) CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1) Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59") @@ -314,7 +325,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Alert($"No hay existencia suficiente del paquete ""{DdlPaqueteDesarmado.SelectedItem.Text}"" para desarmar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia) Exit Sub Else - CveTipoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("Inv_CveMetodoInventario").ToEntero + AplicaSerie = CBool(drP("AplicaSerie")) End If @@ -343,8 +354,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next End If - If CveTipoPS = 5 Then - GvDatosDesarmado.Columns(4).Visible = True + If AplicaSerie Then + DivSeriesPaqueteDesarmado.Visible = True CreaDtSeriesDesarmado() DtSeriesDesarmado.Clear() @@ -363,6 +374,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosDesarmado.DataSource = DtDatos GvDatosDesarmado.DataBind() + GvDatosDesarmado.Columns(4).Visible = CBool(DtDatos.MAX("AplicaSerie")) + GvDatosDesarmado.Columns(5).Visible = CBool(DtDatos.MAX("AplicaSeccion")) + BtnGuadarDesarmado.Visible = True TotalDesarmado.Visible = True @@ -404,7 +418,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Select Case (Tipo) Case 1 ' ARMADO For Each gvr As GridViewRow In GvDatosArmado.Rows - If gvr.DataKey("Inv_CveMetodoInventario").ToEntero = 5 Then + If gvr.DataKey("AplicaSerie") = "True" Then If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -413,7 +427,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next Case 2 ' DESARMADO For Each gvr As GridViewRow In GvDatosDesarmado.Rows - If gvr.DataKey("Inv_CveMetodoInventario").ToEntero = 5 Then + If gvr.DataKey("AplicaSerie") = "True" Then If gvr.DataKey("Cantidad").ToEntero <> DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec"))).Rows.Count Then Alert("Es necesario ingresas todas las series de los componentes.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -423,7 +437,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End Select 'VALIDA SI EL PAQUETE ES DE SERIE QUE SE INGRESEN TODAS LAS SERIES (CANTIDAD) - If CveTipoPS = 5 Then + If AplicaSerie Then Select Case (Tipo) Case 1 ' ARMADO For Each gvr As GridViewRow In GvSeriesPaqueteArmado.Rows @@ -458,7 +472,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Case 1 ' ARMADO 'SALIDA COMPONENTES - CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenArmado, 5, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ1") FolioSalida = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -472,7 +486,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim Lote As String = If(Gvr.FCTextBox("TxtLote").Text = "", "-1", Gvr.FCTextBox("TxtLote").Text) Dim FechaCaducidad As String = If(Gvr.FCTextBox("TxtCaducidad").Text = "", "-1", Gvr.FCTextBox("TxtCaducidad").Text) Dim CveSeccionAlmacen As Integer = Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero() - If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr.DataKey("AplicaSerie")) Then For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows If Not ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenArmado.SelectedValue.ToEntero, FechaMovto:=Fecha.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr("Serie").ToString, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) >= 1 Then MensajeError = String.Format("El Producto {0} con Serie: {1} no tiene existencia suficiente", Dr("PS"), Dr("Serie")) @@ -506,7 +520,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'ENTRADA PAQUETE If Not TieneError Then - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida) + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenArmado, 19, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesArmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ2") FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then @@ -520,14 +534,22 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Next PUTemp = PUTemp / LbCantidadArmado.Text.ToDecimal Dim CvePSTemp = CvePaqueteArmado - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimeroValor("CveUM").ToEntero + Dim CveSeccionAlmacen As Integer = -1 + Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteArmado).FiltroPrimero("") - If CveTipoPS = 5 Then + Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero + Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) + If AplicaSeccion Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenArmado, CvePaqueteArmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + + + If AplicaSerie Then Dim ContadorPaquete = 1 Dim DtSeriesComponentes As New DataTable For Each Gvr As GridViewRow In GvSeriesPaqueteArmado.Rows 'AGREGA MOVTO DETALLE DE LA ENTRADA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, -1, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.FCTextBox("TxtSerie").Text.Trim) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada" Exit For @@ -535,7 +557,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'INGRESA EN TABLA DE CONTROL DE PAQUETES CON SERIE For Each Gvr2 As GridViewRow In GvDatosArmado.Rows - If Gvr2.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr2.DataKey("AplicaSerie")) Then DtSeriesComponentes = New DataTable DtSeriesComponentes = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Copy Dim CantidadComponente = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr2.DataKey("Consec").ToEntero)).Rows.Count / LbCantidadArmado.Text.ToEntero @@ -552,7 +574,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado ContadorPaquete = ContadorPaquete + 1 Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, LbCantidadArmado.Text.ToDouble, CveUMTemp, CvePSTemp, PUTemp, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, LbCantidadArmado.Text.ToDouble, CveUMTemp, CvePSTemp, PUTemp, CveSeccionAlmacen:=CveSeccionAlmacen) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada" End If @@ -569,7 +591,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'SALIDA PAQUETE - CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 20, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), Modulo:="ARMPAQ3") FolioSalida = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -579,12 +601,18 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Dim CvePSTemp = CvePaqueteDesarmado - Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimeroValor("CveUM").ToEntero + Dim CveSeccionAlmacen As Integer = -1 + Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("") - If CveTipoPS = 5 Then + Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero + Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion")) + If AplicaSeccion Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + If AplicaSerie Then For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows 'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, -1, Serie:=Gvr.DataKey("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.DataKey("Serie").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida" Exit For @@ -598,7 +626,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDouble, CveUMTemp, CvePSTemp, 0, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, TxtCantidadDesarmado.Text.ToDouble, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de salida" End If @@ -607,7 +635,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'ENTRADA COMPONENTES If Not TieneError Then - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida) + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenDesarmado, 4, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesDesarmado.Text, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ARMPAQ4") FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then @@ -616,16 +644,20 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Else For Each Gvr As GridViewRow In GvDatosDesarmado.Rows If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then - If Gvr.DataKey("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then + If CBool(Gvr.DataKey("AplicaSeccion")) Then + CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero + End If + + If CBool(Gvr.DataKey("AplicaSerie")) Then For Each Dr As DataRow In DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec").ToEntero)).Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1, Serie:=Dr("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de entrada. Por favor vuelva a intentar." TieneError = True Exit For End If Next Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.FCTextBox("TxtCosto").Text.ToDecimal, CveSeccionAlmacen:=CveSeccionAlmacen) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de entrada. Por favor vuelva a intentar." TieneError = True Exit For @@ -662,7 +694,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Private Sub Limpia(Tipo As Integer) DtDatosDetalle.Clear() - CveTipoPS = -1 + AplicaSerie = False 'If Tipo = 1 Then @@ -719,20 +751,18 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Protected Sub GvDatosArmado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosArmado.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then + If CBool(e.Row.DBCampo("AplicaSerie")) Then e.Row.FCButton("BtnSerie").Visible = True e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°1", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) e.Row.FCLinkButton("BtnSeriePaquete").CommandArgument = e.Row.DBCampo("Consec") 'Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count 'e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - If CveTipoPS = 5 Then + If AplicaSerie Then e.Row.FCLinkButton("BtnSeriePaquete").Visible = True e.Row.FCLinkButton("BtnSeriePaquete").Attributes.Add("data-toggle", "tooltip") End If - GvDatosArmado.Columns(4).Visible = True - Else e.Row.FCButton("BtnSerie").Visible = False End If @@ -740,16 +770,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If e.Row.DataKey("AplicaSeccion") = "False" Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False Else - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() - e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenArmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + End If e.Row.FCTextBox("TxtCaducidad").Visible = e.Row.DataKey("AplicaCaducidad") = "True" e.Row.FCTextBox("TxtLote").Visible = e.Row.DataKey("AplicaLote") = "True" - e.Row.FCTextBox("TxtSerie").Visible = e.Row.DataKey("AplicaSerie") = "True" ''FUNCIONALIDAD PISTOLA DE CODIGOS 'If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then ' e.Row.FCTextBox("TbCantidadF").Enabled = False @@ -763,13 +791,17 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Protected Sub GvDatosDesarmado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosDesarmado.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then + If CBool(e.Row.DBCampo("AplicaSerie")) Then e.Row.FCButton("BtnSerie").Visible = True e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°2", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) Else e.Row.FCButton("BtnSerie").Visible = False End If - + If e.Row.DataKey("AplicaSeccion") = "False" Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False + Else + CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacenDesarmado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa) + End If e.Row.FCTextBox("TxtCosto").Attributes.Add("onkeyup", "SumaValores();")