From b4daee1dbae5f87fa65f59cdf1f9a27addf8b0fc Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 29 Jul 2020 14:47:42 -0700 Subject: [PATCH] secciones --- Inventarios/ResguardoMaterial.aspx | 18 +++++++------ Inventarios/ResguardoMaterial.aspx.vb | 37 +++++++++++++++++++-------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 939bb9015..d05dad8a8 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -284,11 +284,11 @@ - - + + <%-- @@ -439,7 +439,7 @@
- +
@@ -473,7 +473,7 @@ - + <%-- --%> @@ -490,13 +490,15 @@ - - - + + + + - xx + + diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index ae6976ed6..c2f7c86af 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -582,6 +582,18 @@ Partial Class Inventarios_ResguardoMaterial Protected Sub GvMLiberacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then e.Row.FCLabel("LblCantidad").Text = e.Row.FCLabel("LblCantidad").Text.FormatoNumero(2) + + If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero > 0 Then + Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt + e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() + If dtt.Rows.Count = 0 Then + e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + dtt.Dispose() + End If + End If End Sub @@ -661,13 +673,12 @@ Partial Class Inventarios_ResguardoMaterial End Sub Private Sub CargaGvMLiberacion() - GvM.Columns(5).Visible = False - For Each Dr As DataRow In DtMovimientosLiberacion.Rows - If Dr("Serie").ToString <> "" Then - GvM.Columns(5).Visible = True - Exit For - End If - Next + + GvMLiberacion.Columns(5).Visible = DtMovimientosLiberacion.MAX("Serie").ToString <> "" + GvMLiberacion.Columns(6).Visible = DtMovimientosLiberacion.MAX("Lote").ToString <> "" + GvMLiberacion.Columns(7).Visible = DtMovimientosLiberacion.MAX("FechaCaducidad").ToString.ToDate > MinFecha + GvMLiberacion.Columns(8).Visible = DtMovimientosLiberacion.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 Or DtMovimientosLiberacion.MAX("AplicaSeccion") = "True" + GvMLiberacion.DataSource = DtMovimientosLiberacion GvMLiberacion.DataBind() @@ -863,6 +874,7 @@ Partial Class Inventarios_ResguardoMaterial 'SALIDA ORIGEN - RESGUARDO CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenLiberación, 3, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservacionesLiberacion.Text, CvePersonal:=CvePersonalLiberacion, CveAlmacenDestino:=DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, CveProveedor:=CveProveedorLiberacion, CveCliente:=CveClienteLiberacion, MovimientoFijo:=True) FolioSalida = ObjInventario.Folio + Dim DiccionarioSecciones As New HybridDictionary If CveMovimientoSalida <= 0 Then TieneError = True @@ -873,11 +885,12 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Gvr As GridViewRow In GvMLiberacion.Rows If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Gvr.DataKey("Serie").ToString, Observaciones:=Gvr.DataKey("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For - + Else + DiccionarioSecciones.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue) End If End If Cont += 1 @@ -895,7 +908,8 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Dr("Observaciones").ToString) Then + Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For @@ -1038,4 +1052,7 @@ Partial Class Inventarios_ResguardoMaterial End If End Sub + Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged + CargaResguardos() + End Sub End Class