-- aplcia lote/caducidad

This commit is contained in:
2021-03-12 23:35:44 -07:00
parent 4904993ec4
commit 0e6969ff83
2 changed files with 11 additions and 10 deletions

View File

@@ -126,7 +126,7 @@
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento, AplicaLote, AplicaCaducidad" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento, AplicaLote, AplicaCaducidad,PS" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<%--<HeaderTemplate>
@@ -138,7 +138,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false"></asp:TextBox>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false" Style="text-align:right;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -69,8 +69,8 @@ Partial Class Inventarios_PrestamosdeProveedor
End If
GvD.Columns(6).Visible = ObjInv.DtResultados.MAX("Serie") <> ""
GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("Lote") <> ""
GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("AplicaLote") = "True" 'MAX("Lote") <> ""
GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("AplicaCaducidad") = "True" 'MAX("FechaCaducidad").ToDate > MinFecha
GvD.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
ObjInv.Dispose()
@@ -141,10 +141,11 @@ Partial Class Inventarios_PrestamosdeProveedor
Dim Lote As String = "-1"
Dim FechaCaducidad As Date = MinFecha
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
If gvr.DataKey("Lote") <> "" Then Lote = gvr.DataKey("Lote")
If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
If gvr.DataKey("AplicaLote") = "True" Then Lote = gvr.FCTextBox("TxtLote").Text ' gvr.DataKey("Lote")
If gvr.DataKey("AplicaCaducidad") = "True" Then FechaCaducidad = gvr.FCTextBox("TxtFechaCaducidad").Text.todate ' gvr.DataKey("Lote")
'If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie, Lote, FechaCaducidad, gvr.DataKey("PS"))
If Not Valido Then
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -273,7 +274,7 @@ Partial Class Inventarios_PrestamosdeProveedor
End If
End Sub
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date, PS As String) As Boolean
Dim Retorno = True
Dim Inv As New ClsInventarios
@@ -283,9 +284,9 @@ Partial Class Inventarios_PrestamosdeProveedor
If Existencia - Cantidad < 0 Then
If Existencia < 0 Then
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
Alert(String.Format("No hay existencia del producto: ", PS), TipoMensaje.MsgAdvertencia)
Else
Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
Alert(String.Format("Solo hay en existencia: {0} en el producto: {1}", Existencia, PS), TipoMensaje.MsgAdvertencia)
End If
Retorno = False
End If