ahora se sugiere el lote con prioridad a sacar del almacen basandose en la fecha de caducidad
This commit is contained in:
@@ -516,7 +516,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>'></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="F.Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
|
||||
@@ -851,6 +851,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If AplicaCaducidad Then GvDatos.Columns(9).Visible = True
|
||||
GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
|
||||
SugerirFechaLote()
|
||||
End If
|
||||
GvDatos.DataSource = DtDatos
|
||||
|
||||
@@ -3819,5 +3820,85 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "sugerir caducidad"
|
||||
Private Sub SugerirFechaLote()
|
||||
Dim ObjInventarios As New ClsInventarios()
|
||||
Dim FechasExcluidas As New List(Of String)
|
||||
FechasExcluidas.Add(MinFecha.ToDate.ToString)
|
||||
Dim MaxRows As Integer = DtDatos.Rows.Count - 1
|
||||
|
||||
For contador As Integer = 0 To MaxRows
|
||||
Dim DtRow As DataRow = DtDatos.Rows(contador)
|
||||
Dim AplicaCaducidad As Boolean = DtRow.Item("AplicaCaducidad").ToString = "True"
|
||||
Dim AplicaLote As Boolean = DtRow.Item("AplicaLote").ToString = "True"
|
||||
Dim Cantidad As Integer = DtRow.Item("CantidadC").ToString.ToEntero
|
||||
Dim FechasExcluidasFiltro As String = String.Format("FechaCaducidad NOT IN('{0}')", String.Join("','", FechasExcluidas))
|
||||
If AplicaCaducidad Or AplicaLote Then
|
||||
Dim CvePS As Integer = DtRow.Item("CvePS").ToString.ToEntero
|
||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
Dim MinimumRow As DataRow = ObjInventarios.DtResultados.FiltroPrimero(FechasExcluidasFiltro, "FechaCaducidad")
|
||||
DtRow.Item("FechaCaducidad") = MinimumRow.Item("FechaCaducidad").ToString
|
||||
DtRow.Item("Lote") = MinimumRow.Item("Lote").ToString
|
||||
Dim CantidadDisponible As Integer = MinimumRow.Item("Cantidad").ToString.ToEntero
|
||||
DtRow.Item("CantidadF") = CantidadDisponible
|
||||
DtRow.Item("CantidadS") = CantidadDisponible
|
||||
|
||||
If Cantidad > CantidadDisponible Then
|
||||
Dim RowFaltante As DataRow = DtDatos.NewRow()
|
||||
Dim CantidadFaltante As Integer = (Cantidad - CantidadDisponible)
|
||||
RowFaltante.Item("CantidadC") = CantidadFaltante
|
||||
RowFaltante.Item("CantidadF") = CantidadFaltante
|
||||
RowFaltante.Item("CantidadS") = CantidadFaltante
|
||||
DtRow.Item("CantidadC") = CantidadDisponible
|
||||
For Each Column As DataColumn In DtDatos.Columns
|
||||
If Not Column.ColumnName.Contiene("CantidadC", "CantidadF", "CantidadS") Then
|
||||
RowFaltante.Item(Column.ColumnName) = DtRow.Item(Column.ColumnName)
|
||||
End If
|
||||
Next
|
||||
FechasExcluidas.Add(MinimumRow.Item("FechaCaducidad").ToString)
|
||||
DtDatos.Rows.Add(RowFaltante)
|
||||
MaxRows += 1
|
||||
Else
|
||||
DtRow.Item("CantidadF") = Cantidad
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
'For Each DtRow As DataRow In DtDatos.Rows
|
||||
' Dim AplicaCaducidad As Boolean = DtRow.Item("AplicaCaducidad").ToString = "True"
|
||||
' Dim AplicaLote As Boolean = DtRow.Item("AplicaLote").ToString = "True"
|
||||
' Dim Cantidad As Integer = DtRow.Item("CantidadC").ToString.ToEntero
|
||||
' Dim FechasExcluidasFiltro As String = String.Format("FechaCaducidad NOT IN('{0}')", String.Join("','", FechasExcluidas))
|
||||
' If AplicaCaducidad Or AplicaLote Then
|
||||
' Dim CvePS As Integer = DtRow.Item("CvePS").ToString.ToEntero
|
||||
' If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' Dim MinimumRow As DataRow = ObjInventarios.DtResultados.FiltroPrimero(FechasExcluidasFiltro, "FechaCaducidad")
|
||||
' DtRow.Item("FechaCaducidad") = MinimumRow.Item("FechaCaducidad").ToString
|
||||
' DtRow.Item("Lote") = MinimumRow.Item("Lote").ToString
|
||||
' Dim CantidadDisponible As Integer = MinimumRow.Item("Cantidad").ToString.ToEntero
|
||||
' DtRow.Item("CantidadF") = CantidadDisponible
|
||||
|
||||
' If Cantidad > CantidadDisponible Then
|
||||
' Dim RowFaltante As DataRow = DtDatos.NewRow()
|
||||
' RowFaltante.Item("CantidadC") = (Cantidad - CantidadDisponible)
|
||||
' RowFaltante.Item("CantidadF") = (Cantidad - CantidadDisponible)
|
||||
' RowFaltante.Item("CantidadS") = (Cantidad - CantidadDisponible)
|
||||
' For Each Column As DataColumn In DtDatos.Columns
|
||||
' If Not Column.ColumnName.Contiene("CantidadC", "CantidadF", "CantidadS") Then
|
||||
' RowFaltante.Item(Column.ColumnName) = DtRow.Item(Column.ColumnName)
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' DtDatos.Rows.Add(RowFaltante)
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
ObjInventarios.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.select2-selection__rendered {
|
||||
margin-top: 0px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
@@ -119,10 +124,10 @@
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional" >
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkSeries" Visible="false" runat="server"><i class="fa fa-list"></i> Series Disponibles</asp:LinkButton>
|
||||
@@ -131,7 +136,10 @@
|
||||
<asp:LinkButton ID="LnkCaducidad" Visible="false" runat="server"><i class="fa fa-list"></i> Caducidad de producto</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex"> </a>
|
||||
<asp:HyperLink runat="server" ID="HlAyuda" NavigateUrl="/Documentacion/DocumentacionInventarios.aspx#Kardex"><i class="fa fa-question-circle"></i> Ayuda</asp:HyperLink>
|
||||
<%--<div>
|
||||
<a target="_blank" class="ayuda" href="../Documentacion/DocumentacionInventarios.aspx#Kardex"> </a>
|
||||
</div>--%>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -159,8 +167,7 @@
|
||||
<label class="col-md-1 truncate" style="max-width: 80px;">Almacén:</label>
|
||||
<div class="col-md-2">
|
||||
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 175px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"
|
||||
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -370,7 +377,7 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Concepto" ItemStyle-Width="170px" HeaderText="Movimiento" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Almacen" ItemStyle-Width="140px" HeaderText="Almacen" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Almacen" ItemStyle-Width="140px" HeaderText="Almacén" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Folio">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="hlFolio" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveMovimiento", "/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}")%>' Target="_blank" />
|
||||
|
||||
@@ -236,10 +236,10 @@ Partial Class Inventarios_Kardex
|
||||
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
|
||||
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
|
||||
|
||||
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
|
||||
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del día <b> $ {TC.FormatoNumero(4)} </b>"
|
||||
|
||||
If TxtSerie.Text <> "" Then
|
||||
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por numero de serie: <b> {TxtSerie.Text} </b>"
|
||||
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por número de serie: <b> {TxtSerie.Text} </b>"
|
||||
Else
|
||||
LtIndicador_MensajeSerie.Text = ""
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user