SMS 2024.02.08 EntregaAlmacen.aspx nueva columna con combo de los lote/caducidades del ps
This commit is contained in:
@@ -7,6 +7,8 @@ Imports System.IO
|
||||
Imports System.Web.Management
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports MoreLinq
|
||||
Imports Telerik.Web.UI
|
||||
|
||||
Partial Class Inventarios_EntregaAlmacen
|
||||
Inherits ClsPaginas
|
||||
@@ -715,9 +717,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If DtDatos.SUM("CantidadS") <= 0 Then
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
|
||||
Else
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
|
||||
End If
|
||||
|
||||
If CveAlmacenTraspasoDestino > 0 And Not (TipoMovimiento = 2 And TipoDocto.Contiene("Rem", "Ped")) Then
|
||||
@@ -920,9 +922,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
CveVentaSurtir = -1
|
||||
CveOSSurtir = -1
|
||||
If DtDatos.SUM("CantidadS") <= 0 Then
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario gvEscondeColumna"
|
||||
Else
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario"
|
||||
GvDatos.CssClass = "table table-striped table-hover Widthall gvInventario"
|
||||
End If
|
||||
|
||||
If CveAlmacenTraspasoDestino > 0 Then
|
||||
@@ -1000,9 +1002,16 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If AplicaSeccion Then GvDatos.Columns(7).Visible = True
|
||||
If AplicaLote Then GvDatos.Columns(8).Visible = True
|
||||
If AplicaCaducidad Then GvDatos.Columns(9).Visible = True
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvDatos.Columns(9).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
If AplicaLote Then GvDatos.Columns(9).Visible = True
|
||||
If AplicaCaducidad Then GvDatos.Columns(10).Visible = True
|
||||
|
||||
If AplicaLote Or AplicaCaducidad Then
|
||||
GvDatos.Columns(8).Visible = True
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then
|
||||
GvDatos.Columns(10).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
End If
|
||||
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
|
||||
|
||||
'SugerirFecha()
|
||||
@@ -1117,24 +1126,29 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
Else
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim DvFechaCaducidad As HtmlGenericControl = TryCast(e.Row.FindControl("DvFechaCaducidad"), HtmlGenericControl)
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
DvFechaCaducidad.Visible = True
|
||||
' e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
|
||||
|
||||
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
|
||||
If (e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha) OrElse UsuarioActual.TienePermisoProceso(364) OrElse UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
e.Row.FCTextBox("TxtCaducidad").ReadOnly = False
|
||||
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
End If
|
||||
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
'e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
'e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
'e.Row.FCTextBox("TxtCaducidad").Enabled = True
|
||||
DvFechaCaducidad.Visible = False
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||
@@ -1190,8 +1204,60 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
|
||||
If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
|
||||
|
||||
CargarCaducidadProducto(e.Row.DataKey("CvePS").ToEntero, e.Row.FCDropDownList("DdlCaducidadProducto"))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCaducidadProducto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, DropDownList)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim AplicaLote As Boolean = Boolean.Parse(GvRow.DataKey("AplicaLote"))
|
||||
Dim AplicaCaducidad As Boolean = Boolean.Parse(GvRow.DataKey("AplicaCaducidad"))
|
||||
Dim DdlCaducidadProducto As DropDownList = GvRow.FCDropDownList("DdlCaducidadProducto")
|
||||
|
||||
Dim ArrayCaducidad As String() = DdlCaducidadProducto.SelectedValue.Split("|"c)
|
||||
Dim Lote As String = ArrayCaducidad(0)
|
||||
Dim FechaCaducidad As String = ArrayCaducidad(1)
|
||||
|
||||
|
||||
|
||||
If AplicaLote Then
|
||||
GvRow.FCTextBox("TxtLote").Text = Lote
|
||||
End If
|
||||
|
||||
If AplicaCaducidad Then
|
||||
GvRow.FCTextBox("TxtCaducidad").Text = FechaCaducidad
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargarCaducidadProducto(CvePS As Integer, ByRef DdlLoteFechaCaducidad As DropDownList)
|
||||
|
||||
Dim almacenes As String = DdlAlmacen.SelectedValue
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
End If
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
|
||||
If ObjInventarios.GetExistenciasCaducidad(CvePS, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
|
||||
For Each dr As DataRow In ObjInventarios.DtResultados.Rows
|
||||
DdlLoteFechaCaducidad.Items.Add(New ListItem($"Lote: {dr("Lote").ToString} - Caducidad: {dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}", $"{dr("Lote").ToString}|{dr("FechaCaducidad").ToString.ToDate.ToString("dd/MM/yyyy")}"))
|
||||
Next
|
||||
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDocumentos(tCveVenta As Integer)
|
||||
@@ -4458,6 +4524,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Return Respuesta
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user