-- opción para seleccionar lote/caducidad en combo
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
.psagregar > div.comboxes {
|
||||
display: inline-block;
|
||||
width: 450px;
|
||||
width: 550px;
|
||||
}
|
||||
|
||||
.psagregar > div.codigo input {
|
||||
@@ -394,12 +394,11 @@
|
||||
Producto
|
||||
</th>
|
||||
<th width="100px">Observaciones</th>
|
||||
<th style="width: 88px" runat="server" id="ThSeccionAlmacen" visible="false">Sección Almacen</th>
|
||||
<th style="width: 88px" runat="server" id="ThSeccionAlmacen" visible="false">Sección Almacen</th>
|
||||
<th style="width: 88px" runat="server" id="ThSerie" visible="false">Serie</th>
|
||||
<th style="width: 88px" runat="server" id="ThLote" visible="false">Lote</th>
|
||||
<th style="width: 88px" runat="server" id="ThFechaCaducidad" visible="false">Fecha Caducidad</th>
|
||||
|
||||
<th width="160px">Comandos</th>
|
||||
<th width="80px">Comandos</th>
|
||||
</tr>
|
||||
</thea>
|
||||
<tr>
|
||||
@@ -421,8 +420,7 @@
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
|
||||
<div class="comboxes">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -440,6 +438,8 @@
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td runat="server" id="TdLoteCaducidad" visible="false">
|
||||
</td>
|
||||
<td runat="server" id="TdSerie" visible="false">
|
||||
<asp:Panel runat="server" DefaultButton="BtnSerieAddNew">
|
||||
<asp:TextBox ID="TxtnSerie" Visible="false" runat="server" Width="80px"></asp:TextBox>
|
||||
@@ -450,8 +450,7 @@
|
||||
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
</td>
|
||||
<td runat="server" id="TdFechaCaducidad" visible="false">
|
||||
|
||||
<table>
|
||||
<table id="tbFechaCaducidad" runat="server">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||
@@ -463,9 +462,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<asp:DropDownList ID="DdlLoteFechaCaducidad" Visible="false" CssClass="select2me" Width="100%" runat="server" CausesValidation="true" AutoPostBack="true" >
|
||||
<asp:ListItem Selected="True" Text="-" Value="|"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td align="center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="Texto" ValidationGroup="GrpAgregar" TabIndex="3" Text="Agregar" />
|
||||
@@ -500,7 +499,7 @@
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" CommandArgument='<%# Eval("No")%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el concepto?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
|
||||
<ItemStyle Width="80px" HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
|
||||
@@ -158,7 +158,6 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ViewState("FolioBusqueda") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ArchivoBitacora As String
|
||||
Get
|
||||
Return CType(ViewState("ArchivoBitacora"), String)
|
||||
@@ -167,6 +166,17 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ViewState("ArchivoBitacora") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property SeleccionLoteCaducidadCombo As Boolean
|
||||
Get
|
||||
If ViewState("SeleccionLoteCaducidadCombo") Is Nothing Then
|
||||
ViewState("SeleccionLoteCaducidadCombo") = False
|
||||
End If
|
||||
Return CType(ViewState("SeleccionLoteCaducidadCombo"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("SeleccionLoteCaducidadCombo") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -212,6 +222,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
DivTransitorio2.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then SeleccionLoteCaducidadCombo = True
|
||||
|
||||
'If UsuarioActual.CveEmpresa.Contiene(141, 152, 158, 159, 160, 161, 162, 163) Then
|
||||
' ChkEmitirTimbrado.Visible = False
|
||||
' divEmitir.Visible = False
|
||||
@@ -605,7 +617,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
Dim DrPS As DataRow = Nothing
|
||||
|
||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
|
||||
DrPS = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
|
||||
|
||||
If DrPS IsNot Nothing Then
|
||||
|
||||
@@ -618,9 +630,16 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
If DrPS("AplicaCaducidad").ToString = "True" Then
|
||||
If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then
|
||||
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If SeleccionLoteCaducidadCombo Then
|
||||
If DdlLoteFechaCaducidad.SelectedValue = "|" Then
|
||||
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then
|
||||
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -647,14 +666,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If CantidadRestante <= 0 Then Exit For
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
Else
|
||||
|
||||
'codigo temporal
|
||||
Dim tLote As String
|
||||
Dim tCaducidad As Date
|
||||
|
||||
@@ -662,17 +676,19 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
|
||||
|
||||
Dim tSerie As String = If(TxtnSerie.Visible, TxtnSerie.Text, "-1").Trim
|
||||
If SeleccionLoteCaducidadCombo Then
|
||||
Dim ArrayCaducidad As String() = DdlLoteFechaCaducidad.SelectedValue.Split("|"c)
|
||||
tLote = ArrayCaducidad(0)
|
||||
tCaducidad = ArrayCaducidad(1).ToDate
|
||||
End If
|
||||
|
||||
Dim Valido As Boolean = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, tSerie, tLote, tCaducidad)
|
||||
|
||||
If Valido Then
|
||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Function ValidaExistencia(Cantidad As Decimal, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
|
||||
@@ -737,7 +753,6 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
|
||||
Dim CveClasificacion As Integer
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
|
||||
If ChkEmitirTimbrado.Checked AndAlso ChkEmitirCartaPorte.Checked Then
|
||||
@@ -1369,36 +1384,46 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
|
||||
If DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS")
|
||||
Dim drP As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS")
|
||||
If drP IsNot Nothing Then
|
||||
|
||||
ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
'GvDatos.Columns(5).Visible = CBool(drP("AplicaSeccion"))
|
||||
|
||||
Dim AplicaSerie As Boolean = CBool(drP("AplicaSerie"))
|
||||
|
||||
ThSerie.Visible = AplicaSerie
|
||||
TdSerie.Visible = AplicaSerie
|
||||
TxtnSerie.Visible = AplicaSerie
|
||||
'GvDatos.Columns(6).Visible = CBool(drP("AplicaSerie"))
|
||||
|
||||
TxtnLote.Visible = CBool(drP("AplicaLote"))
|
||||
ThLote.Visible = CBool(drP("AplicaLote"))
|
||||
TdLote.Visible = CBool(drP("AplicaLote"))
|
||||
'GvDatos.Columns(7).Visible = CBool(drP("AplicaLote"))
|
||||
|
||||
|
||||
TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
'ThFechaCaducidad.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad")
|
||||
TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
'GvDatos.Columns(8).Visible = CBool(drP("AplicaCaducidad"))
|
||||
|
||||
If SeleccionLoteCaducidadCombo AndAlso (CBool(drP("AplicaLote")) OrElse CBool(drP("AplicaCaducidad"))) Then
|
||||
TxtnLote.Visible = False
|
||||
ThLote.Visible = CBool(drP("AplicaLote"))
|
||||
TdLote.Visible = CBool(drP("AplicaLote"))
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
tbFechaCaducidad.Visible = False
|
||||
DdlLoteFechaCaducidad.Visible = True
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue) Then
|
||||
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros("", DistinctColumns:={"Lote", "FechaCaducidad"}).Rows
|
||||
Dim Cad As String = ""
|
||||
If dr("FechaCaducidad").ToString <> "" Then Cad = $"- Cad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} {Cad}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
Else
|
||||
TxtnLote.Visible = CBool(drP("AplicaLote"))
|
||||
ThLote.Visible = CBool(drP("AplicaLote"))
|
||||
TdLote.Visible = CBool(drP("AplicaLote"))
|
||||
TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
DdlUnidad.Items.Clear()
|
||||
|
||||
Reference in New Issue
Block a user