-- ajustes de serie/lote/caducidad
This commit is contained in:
@@ -240,23 +240,23 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divSeccionAlmacen" visible="false">
|
||||
<label class="col-md-4">Sección Almacén</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" runat="server" CssClass="form-control input-sm select2me" Width="100%" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" ></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divLote" visible="false">
|
||||
<label class="col-md-4">Lote</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtLote"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RFVLote" ControlToValidate="TxtLote" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lote''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCELote" runat="server" HighlightCssClass="vco" TargetControlID="RFVLote" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divFechaCaducidad" visible="false">
|
||||
<label class="col-md-4">Fecha Caducidad</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtFechaCaducidad"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RFVCaducidad" ControlToValidate="TxtFechaCaducidad" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingrése una." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
@@ -325,7 +325,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
@@ -349,7 +349,7 @@
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Serie/Lote" DataField="SerieLote" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" Visible="false" DataFormatString="{0:d}"></asp:BoundField>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -88,10 +88,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1)
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
|
||||
If ObjInventario.GetInventarioFisico(CveInventarioFisico, CveEmpresa, -1, -1) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
Dim CveEstatus = ObjInventario.DtResultados.FiltroPrimeroValor("CveEstatus")
|
||||
Select Case CveEstatus
|
||||
@@ -230,9 +228,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim Inventario As New ClsInventarios
|
||||
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
|
||||
If Inventario.DtResultados.Rows.Count > 0 Then
|
||||
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen") > 0
|
||||
GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0
|
||||
GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> ""
|
||||
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha
|
||||
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
|
||||
Else
|
||||
GvIFD.DataSource = Nothing
|
||||
@@ -259,48 +257,83 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim CveUnidadMedida As Integer
|
||||
Dim Codigo As String = If(TxtCodigo.Text.Trim <> "", TxtCodigo.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim SeccionAlmacen As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > -1, DdlSeccionAlmacen.SelectedItem.Text, "")
|
||||
Dim CveSeccionAlmacen As Integer = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1)
|
||||
Dim SerieLote As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Serie As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
|
||||
Dim FechaCaducidad As String = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
Dim CveMetodoInv As Integer = -1
|
||||
Dim FechaCaducidad As String=MinFecha.ToString
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
|
||||
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
|
||||
|
||||
Dim dr As DataRow
|
||||
dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
CveMetodoInv = dr("Inv_CveMetodoInventario").ToString.ToEntero
|
||||
'dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
|
||||
dr = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}'")
|
||||
|
||||
|
||||
|
||||
If dr IsNot Nothing Then
|
||||
|
||||
CveProducto = dr("CvePS").ToString.ToEntero
|
||||
CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
|
||||
CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
|
||||
'Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
|
||||
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
|
||||
Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
|
||||
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
UPAgregarPro.Update()
|
||||
|
||||
If CveMetodoInv = 5 And SerieLote = "" Then
|
||||
If AplicaSerie And Serie = "" Then
|
||||
RFVSerie.Enabled = True
|
||||
RFVSerie.Visible = True
|
||||
RFVSerie.SetFocusOnError = True
|
||||
RFVSerie.Validate()
|
||||
RFVSerie.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaLote And Lote = "" Then
|
||||
RFVLote.Enabled = True
|
||||
RFVLote.Visible = True
|
||||
RFVLote.SetFocusOnError = True
|
||||
RFVLote.Validate()
|
||||
RFVLote.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaCaducidad Then
|
||||
If TxtFechaCaducidad.Text.Trim = "" Then
|
||||
RFVCaducidad.Enabled = True
|
||||
RFVCaducidad.Visible = True
|
||||
RFVCaducidad.SetFocusOnError = True
|
||||
RFVCaducidad.Validate()
|
||||
RFVCaducidad.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
End If
|
||||
|
||||
RFVSerie.ValidationGroup = "GrpIngresar"
|
||||
RFVSerie.Enabled = False
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
|
||||
Alert($"La serie indicada <b>{SerieLote}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
RFVLote.ValidationGroup = "GrpIngresar"
|
||||
RFVLote.Enabled = False
|
||||
RFVCaducidad.ValidationGroup = "GrpIngresar"
|
||||
RFVCaducidad.Enabled = False
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
|
||||
Alert($"La serie indicada <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Consulto As Boolean = False
|
||||
Using Inventarios As New ClsInventarios
|
||||
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
|
||||
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = SerieLote <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1"
|
||||
GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900"
|
||||
|
||||
@@ -310,7 +343,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
|
||||
@@ -332,9 +365,11 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
TxtCodigoSerie.Text = ""
|
||||
TxtCodigo.Text = ""
|
||||
TxtCantidadProducto.Text = "1"
|
||||
DdlSeccionAlmacen.SelectedValue = "-1"
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
Else
|
||||
TxtCodigoSerie.Text = ""
|
||||
@@ -346,8 +381,10 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Else
|
||||
TxtCodigoBarras.Text = ""
|
||||
TxtCodigoSerie.Text = ""
|
||||
TxtCodigo.Text = ""
|
||||
DdlSeccionAlmacen.SelectedValue = "-1"
|
||||
TxtCodigo.Text = ""
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
|
||||
@@ -530,7 +567,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim AplicaLote As Boolean = Producto("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1"
|
||||
|
||||
divSeccionAlmacen.Visible = AplicaSeccion
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
@@ -234,7 +234,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
<asp:BoundField HeaderText="Existencia" DataField="CantidadAlmacen" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Inv. Físico" DataField="CantidadInventarioFisico" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Diferencia" DataField="Diferencia" DataFormatString="{0:#,###.##}" ItemStyle-Font-Bold="true" />
|
||||
|
||||
@@ -275,7 +275,7 @@ Partial Class Inventarios_RepAnomalias
|
||||
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
|
||||
Gv.Columns(4).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(5).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user