mejora en lote/caducidad
This commit is contained in:
@@ -491,8 +491,25 @@
|
|||||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="40%" />
|
||||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="20%" Visible="false"/>
|
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="20%" Visible="false"/>
|
||||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="20%" Visible="false"/>
|
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||||
<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" ItemStyle-Width="20%" Visible="false"/>
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtLote" Width="80px" class="form-control input-sm" runat="server" Visible="false"></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||||||
|
<asp:TextBox ID="TxtCaducidad" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server" Visible="false"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
<asp:TemplateField HeaderText="Sección" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:DropDownlist ID="DdlSeccionAlmacen" runat="server" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="form-control input-sm select2me" />
|
<asp:DropDownlist ID="DdlSeccionAlmacen" runat="server" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="form-control input-sm select2me" />
|
||||||
|
|||||||
@@ -83,6 +83,15 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property ValidaLoteCaducidad As Boolean
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("ValidaLoteCaducidad") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Private Property CantidadTotal As Decimal
|
Private Property CantidadTotal As Decimal
|
||||||
Get
|
Get
|
||||||
@@ -502,41 +511,6 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'ThSerie.Visible = False
|
|
||||||
'TrSerie.Visible = False
|
|
||||||
'TxtnSerie.Visible = False
|
|
||||||
'GvM.Columns(5).Visible = False
|
|
||||||
'GvM.Columns(4).Visible = False
|
|
||||||
|
|
||||||
'Dim Contador As Integer = 0
|
|
||||||
'Dim UltimoRenglon As Integer = DtMovimientos.Rows.Count - 1
|
|
||||||
'Dim MostrarSerie As Boolean = False
|
|
||||||
'Dim MostrarSeccion As Boolean = False
|
|
||||||
'While Contador <= UltimoRenglon And (Not MostrarSerie And Not MostrarSeccion)
|
|
||||||
' Dim Dr As DataRow = DtMovimientos.Rows(Contador)
|
|
||||||
' MostrarSerie = If(Not MostrarSerie, Dr("Serie").ToString <> "", True)
|
|
||||||
' MostrarSeccion = If(Not MostrarSerie, Dr("SeccionAlmacen").ToString <> "", True)
|
|
||||||
' Contador += 1
|
|
||||||
'End While
|
|
||||||
|
|
||||||
'ThSerie.Visible = MostrarSerie
|
|
||||||
'TrSerie.Visible = MostrarSerie
|
|
||||||
'GvM.Columns(5).Visible = MostrarSerie
|
|
||||||
|
|
||||||
'GvM.Columns(4).Visible = MostrarSeccion
|
|
||||||
|
|
||||||
'For Each Dr As DataRow In DtMovimientos.Rows
|
|
||||||
' If Dr("Serie").ToString <> "" Then
|
|
||||||
' ThSerie.Visible = True
|
|
||||||
' TrSerie.Visible = True
|
|
||||||
' GvM.Columns(5).Visible = True
|
|
||||||
' Exit For
|
|
||||||
' End If
|
|
||||||
' If Dr("SeccionAlmacen").ToString <> "" Then
|
|
||||||
' GvM.Columns(4).Visible = True
|
|
||||||
' End If
|
|
||||||
'Next
|
|
||||||
|
|
||||||
GvM.DataSource = DtMovimientos
|
GvM.DataSource = DtMovimientos
|
||||||
GvM.DataBind()
|
GvM.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -608,6 +582,23 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
dtt.Dispose()
|
dtt.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
|
||||||
|
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||||
|
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||||
|
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||||
|
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||||
|
e.Row.FCTextBox("TxtLote").Visible = True
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtLote").Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -689,8 +680,8 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
Private Sub CargaGvMLiberacion()
|
Private Sub CargaGvMLiberacion()
|
||||||
|
|
||||||
GvMLiberacion.Columns(5).Visible = DtMovimientosLiberacion.MAX("Serie").ToString <> ""
|
GvMLiberacion.Columns(5).Visible = DtMovimientosLiberacion.MAX("Serie").ToString <> ""
|
||||||
GvMLiberacion.Columns(6).Visible = DtMovimientosLiberacion.MAX("Lote").ToString <> ""
|
GvMLiberacion.Columns(6).Visible = DtMovimientosLiberacion.MAX("AplicaLote").ToString = "True"
|
||||||
GvMLiberacion.Columns(7).Visible = DtMovimientosLiberacion.MAX("FechaCaducidad").ToString.ToDate > MinFecha
|
GvMLiberacion.Columns(7).Visible = DtMovimientosLiberacion.MAX("AplicaCaducidad").ToString = "True" ' .ToDate > MinFecha
|
||||||
GvMLiberacion.Columns(8).Visible = DtMovimientosLiberacion.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 Or DtMovimientosLiberacion.MAX("AplicaSeccion") = "True"
|
GvMLiberacion.Columns(8).Visible = DtMovimientosLiberacion.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 Or DtMovimientosLiberacion.MAX("AplicaSeccion") = "True"
|
||||||
|
|
||||||
|
|
||||||
@@ -896,6 +887,8 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
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, Modulo:="ResgMat3")
|
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, Modulo:="ResgMat3")
|
||||||
FolioSalida = ObjInventario.Folio
|
FolioSalida = ObjInventario.Folio
|
||||||
Dim DiccionarioSecciones As New HybridDictionary
|
Dim DiccionarioSecciones As New HybridDictionary
|
||||||
|
Dim DiccionarioLote As New HybridDictionary
|
||||||
|
Dim DiccionarioCaducidad As New HybridDictionary
|
||||||
|
|
||||||
If CveMovimientoSalida <= 0 Then
|
If CveMovimientoSalida <= 0 Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
@@ -906,12 +899,19 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
Dim Cont As Integer = 0
|
Dim Cont As Integer = 0
|
||||||
For Each Gvr As GridViewRow In GvMLiberacion.Rows
|
For Each Gvr As GridViewRow In GvMLiberacion.Rows
|
||||||
If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
|
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, CveSeccionAlmacen:=Gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Gvr.DataKey("Serie").ToString, Observaciones:=Gvr.DataKey("Observaciones").ToString) Then
|
Dim Lote As String = "-1"
|
||||||
|
Dim FechaCaducidad As Date = MinFecha
|
||||||
|
If Gvr.datakey("Lote") <> "" Then Lote = Gvr.datakey("Lote")
|
||||||
|
If Gvr.datakey("FechaCaducidad").todate > MinFecha Then FechaCaducidad = Gvr.datakey("FechaCaducidad").todate
|
||||||
|
|
||||||
|
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, Lote:=Lote, FechaCaducidad:=FechaCaducidad, Observaciones:=Gvr.DataKey("Observaciones").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").toentero) Then
|
||||||
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
|
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
|
||||||
TieneError = True
|
TieneError = True
|
||||||
Exit For
|
Exit For
|
||||||
Else
|
Else
|
||||||
DiccionarioSecciones.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue)
|
DiccionarioSecciones.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue)
|
||||||
|
DiccionarioLote.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCTextBox("TxtLote").Text)
|
||||||
|
DiccionarioCaducidad.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCTextBox("TxtCaducidad").Text.todate)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Cont += 1
|
Cont += 1
|
||||||
@@ -932,7 +932,11 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
Importe = ObjInventario.DtResultados.SUMD("Total").RoundAD
|
Importe = ObjInventario.DtResultados.SUMD("Total").RoundAD
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero
|
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
|
Dim Lote As String = "-1"
|
||||||
|
Dim FechaCaducidad As Date = MinFecha
|
||||||
|
If DiccionarioLote(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString <> "" Then Lote = DiccionarioLote(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString
|
||||||
|
If DiccionarioCaducidad(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.todate > MinFecha Then FechaCaducidad = DiccionarioCaducidad(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.todate
|
||||||
|
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, Lote:=Lote, FechaCaducidad:=FechaCaducidad, Observaciones:=Dr("Observaciones").ToString) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
|
MensajeError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
Exit For
|
Exit For
|
||||||
@@ -1099,6 +1103,14 @@ Partial Class Inventarios_ResguardoMaterial
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged
|
Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged
|
||||||
|
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestinoLiberacion.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||||
|
'RMF condición temporal
|
||||||
|
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
|
||||||
|
ValidaLoteCaducidad = True
|
||||||
|
Else
|
||||||
|
ValidaLoteCaducidad = False
|
||||||
|
End If
|
||||||
|
|
||||||
CargaResguardos()
|
CargaResguardos()
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user