se agregaron la seccion, serie, lote y fecha caducidad al realizar inventario fisico
This commit is contained in:
@@ -229,7 +229,7 @@
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<label class="col-md-4">Código.Barras</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras" ></asp:TextBox>
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divSerie" visible="false">
|
||||
@@ -259,12 +259,22 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
|
||||
<div class="row" style="margin-top: 5px" runat="server" id="divSeccion" visible="false">
|
||||
<label class="col-md-4">Sección Almacén:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList runat="server" ID="DdlSeccionAlmacen" CssClass="select2me" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" Width="100%">
|
||||
<%--<asp:ListItem Selected="True" Value="-1">Seleccione</asp:ListItem>--%>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvSeccionAlmacen" ControlToValidate="DdlSeccionAlmacen" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion Almacen''</b> es necesario, por favor ingrése una." Display="Dynamic" InitialValue="-1"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,15 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
ViewState("DtVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveAlmacenes As String
|
||||
Get
|
||||
Return ViewState("CveAlmacenes").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("CveAlmacenes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -135,13 +144,16 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
Dim str As New StringBuilder
|
||||
Dim CveAlmacenesStr As New StringBuilder
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dt.Rows
|
||||
str.AppendFormat("{0},", dr("almacen"))
|
||||
CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen"))
|
||||
Next
|
||||
End If
|
||||
LblAlmacenes.Text = str.ToString
|
||||
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
@@ -260,8 +272,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim Serie As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
|
||||
Dim FechaCaducidad As String=MinFecha.ToString
|
||||
Dim FechaCaducidad As String = MinFecha.ToString
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
Dim SeccionAlmacen As String = ""
|
||||
|
||||
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
|
||||
|
||||
@@ -279,11 +292,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
|
||||
Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
|
||||
Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
|
||||
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
|
||||
UPAgregarPro.Update()
|
||||
|
||||
If AplicaSerie And Serie = "" Then
|
||||
@@ -294,7 +309,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
RFVSerie.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaLote And Lote = "" Then
|
||||
If AplicaLote And (Lote = "" Or Lote = "-1") Then
|
||||
RFVLote.Enabled = True
|
||||
RFVLote.Visible = True
|
||||
RFVLote.SetFocusOnError = True
|
||||
@@ -313,6 +328,37 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
End If
|
||||
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
End If
|
||||
If AplicaSeccion Then
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim SeccionesAlmacenDelProducto As New DataTable
|
||||
If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
|
||||
End If
|
||||
'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
|
||||
'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
|
||||
If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
|
||||
CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
|
||||
Else
|
||||
divSeccion.Visible = AplicaSeccion
|
||||
If DdlSeccionAlmacen.Items.Count = 0 Then
|
||||
DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
If DdlSeccionAlmacen.SelectedValue = "-1" Then
|
||||
RfvSeccionAlmacen.Enabled = True
|
||||
RfvSeccionAlmacen.Visible = True
|
||||
RfvSeccionAlmacen.SetFocusOnError = True
|
||||
RfvSeccionAlmacen.Validate()
|
||||
RfvSeccionAlmacen.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
|
||||
End If
|
||||
|
||||
RFVSerie.ValidationGroup = "GrpIngresar"
|
||||
RFVSerie.Enabled = False
|
||||
@@ -320,6 +366,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
RFVLote.Enabled = False
|
||||
RFVCaducidad.ValidationGroup = "GrpIngresar"
|
||||
RFVCaducidad.Enabled = False
|
||||
RfvSeccionAlmacen.ValidationGroup = "GrpIngresar"
|
||||
RfvSeccionAlmacen.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
|
||||
@@ -331,7 +379,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Using Inventarios As New ClsInventarios
|
||||
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
|
||||
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> ""
|
||||
@@ -344,7 +392,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("PSCodigo").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
|
||||
@@ -371,6 +419,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
divSeccion.Visible = False
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
Else
|
||||
TxtCodigoSerie.Text = ""
|
||||
@@ -386,6 +435,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
divSeccion.Visible = False
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
|
||||
|
||||
@@ -198,6 +198,7 @@
|
||||
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<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" DataFormatString="{0:d}" />
|
||||
@@ -232,6 +233,7 @@
|
||||
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<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" DataFormatString="{0:d}" />
|
||||
|
||||
@@ -194,6 +194,9 @@ Partial Class Inventarios_RepAnomalias
|
||||
e.Row.Cells(8).Text = "0"
|
||||
End If
|
||||
|
||||
If e.Row.Cells(7).Text = MinFecha Then
|
||||
e.Row.Cells(7).Text = ""
|
||||
End If
|
||||
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
|
||||
|
||||
End If
|
||||
@@ -273,9 +276,10 @@ Partial Class Inventarios_RepAnomalias
|
||||
#End Region
|
||||
|
||||
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").ToDate > MinFecha
|
||||
Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
|
||||
Gv.Columns(5).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user