From 04d12eec4f36aedcd892275deb4b69e0410dc2b9 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 29 Jun 2020 16:23:47 -0700 Subject: [PATCH] agregando los cuatro campos de la tabla movimientos detalles --- Inventarios/PaquetesArmadoDesarmado.aspx | 24 +++++- Inventarios/PaquetesArmadoDesarmado.aspx.vb | 86 +++++++++++++-------- 2 files changed, 75 insertions(+), 35 deletions(-) diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx b/Inventarios/PaquetesArmadoDesarmado.aspx index b6b4271e3..403797160 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx +++ b/Inventarios/PaquetesArmadoDesarmado.aspx @@ -216,18 +216,38 @@
- + - + + + + + + + + + + + + + + + + + + + + +
diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index ba212c0e1..8af94a12a 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -240,14 +240,15 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Next + Dim AplicaSerie As String = "" If ErrorExistencias Then Alert(TextoExistencias, TipoMensaje.MsgAdvertencia) Else - CveTipoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("Inv_CveMetodoInventario").ToEntero + AplicaSerie = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimeroValor("AplicaSerie") BtnGuadarArmado.Visible = True End If - If CveTipoPS = 5 Then + If AplicaSerie = "True" Then DivSeriesPaqueteArmado.Visible = True Dim Dt As New DataTable Dt.Columns.Add("Row", GetType(Integer)) @@ -468,6 +469,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado For Each Gvr As GridViewRow In GvDatosArmado.Rows If Gvr.DataKey("Cantidad").ToString.ToDouble > 0 Then + 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 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 @@ -476,7 +480,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Exit For End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, Serie:=Dr("Serie").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, + CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -488,7 +493,9 @@ Partial Class Inventarios_PaquetesArmadoDesarmado End If Else - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.DataKey("Cantidad").ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, + Gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, + FechaCaducidad:=FechaCaducidad.ToDate) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -661,44 +668,44 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'If Tipo = 1 Then BtnGuadarArmado.Visible = False - DivSeriesPaqueteArmado.Visible = False - GvDatosArmado.Columns(4).Visible = False + DivSeriesPaqueteArmado.Visible = False + GvDatosArmado.Columns(4).Visible = False - LbPaqueteArmado.Text = "" - CvePaqueteArmado = -1 - LbCantidadArmado.Text = "" - LbAlmacenArmado.Text = "" - CveAlmacenArmado = -1 - LbFechaArmado.Text = "" - TxtObservacionesArmado.Text = "" - UpGeneralesArmado.Update() + LbPaqueteArmado.Text = "" + CvePaqueteArmado = -1 + LbCantidadArmado.Text = "" + LbAlmacenArmado.Text = "" + CveAlmacenArmado = -1 + LbFechaArmado.Text = "" + TxtObservacionesArmado.Text = "" + UpGeneralesArmado.Update() - GvDatosArmado.DataBind() - UpDatosArmado.Update() - UpSeriesPaqueteArmado.Update() + GvDatosArmado.DataBind() + UpDatosArmado.Update() + UpSeriesPaqueteArmado.Update() 'Else LbPaqueteDesarmado.Text = "" - CvePaqueteDesarmado = -1 - LbCantidadDesarmado.Text = "" - LbAlmacenDesarmado.Text = "" - CveAlmacenDesarmado = -1 - LbFechaDesarmado.Text = "" - TxtObservacionesDesarmado.Text = "" - UpGeneralesDesarmado.Update() + CvePaqueteDesarmado = -1 + LbCantidadDesarmado.Text = "" + LbAlmacenDesarmado.Text = "" + CveAlmacenDesarmado = -1 + LbFechaDesarmado.Text = "" + TxtObservacionesDesarmado.Text = "" + UpGeneralesDesarmado.Update() - BtnGuadarDesarmado.Visible = False - TotalDesarmado.Visible = False + BtnGuadarDesarmado.Visible = False + TotalDesarmado.Visible = False - DtSeriesDesarmado.Clear() - GvDatosDesarmado.Columns(4).Visible = False - DivSeriesPaqueteDesarmado.Visible = False - GvSeriesPaqueteDesarmado.DataBind() - BtnAgregarSerieDesarmado.Enabled = True + DtSeriesDesarmado.Clear() + GvDatosDesarmado.Columns(4).Visible = False + DivSeriesPaqueteDesarmado.Visible = False + GvSeriesPaqueteDesarmado.DataBind() + BtnAgregarSerieDesarmado.Enabled = True - LbTotalCalculado.Text = "0.00" + LbTotalCalculado.Text = "0.00" - GvDatosDesarmado.DataBind() + GvDatosDesarmado.DataBind() UpDatosDesarmado.Update() UpSeriesPaqueteDesarmado.Update() @@ -730,6 +737,19 @@ Partial Class Inventarios_PaquetesArmadoDesarmado e.Row.FCButton("BtnSerie").Visible = False End If + 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")) + 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