Consignaciones Lote Fecha de caducidad, rep Recuperacion por Periodo
This commit is contained in:
@@ -72,6 +72,19 @@ Partial Class Inventarios_Consignaciones
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Property ValidaLoteCaducidad As Boolean
|
||||
Get
|
||||
If ViewState("ValidaLoteCaducidad") Is Nothing Then
|
||||
ViewState("ValidaLoteCaducidad") = False
|
||||
End If
|
||||
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ValidaLoteCaducidad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "Inicializa Valores"
|
||||
@@ -364,6 +377,32 @@ Partial Class Inventarios_Consignaciones
|
||||
CargaDatos(DdlRemisiones.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
Private Sub CargaDatos(CveConsignacionTemp As Integer)
|
||||
|
||||
If DdlConcepto.SelectedValue.ToEntero.Contiene(12, 8) Then
|
||||
Dim CveSubProyectoValidaCaducidad As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenFiltro.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||
'RMF condición temporal
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyectoValidaCaducidad.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
|
||||
ValidaLoteCaducidad = True
|
||||
|
||||
'activa lote
|
||||
ThLote.Visible = True
|
||||
ThCaducidad.Visible = True
|
||||
|
||||
|
||||
Else
|
||||
ValidaLoteCaducidad = False
|
||||
|
||||
'activa lote
|
||||
ThLote.Visible = False
|
||||
ThCaducidad.Visible = False
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
|
||||
If ObjInventario.ConsignacionesDetalle(CveConsignacionTemp, DdlAlmacenFiltro.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
@@ -538,6 +577,24 @@ Partial Class Inventarios_Consignaciones
|
||||
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", String.Format("RecalculaEdit({0},this,{1});", e.Row.FCTextBox("TxtCantidad").ClientID, e.Row.FCLabel("LbTotal").ClientID))
|
||||
End If
|
||||
|
||||
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||
e.Row.FCTextBox("TxtLote").Visible = True
|
||||
Else
|
||||
e.Row.FCTextBox("TxtLote").Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -940,8 +997,14 @@ Partial Class Inventarios_Consignaciones
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Dim Lote As String = "-1"
|
||||
Dim FechaCaducidad As Date = MinFecha
|
||||
If Gvr.FCTextBox("TxtLote").Text.Trim <> "" Then Lote = Gvr.FCTextBox("TxtLote").Text.Trim
|
||||
If Gvr.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha Then FechaCaducidad = Gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
|
||||
'AGREGAMOS MOVTOS DETALLE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Lote").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Lote, FechaCaducidad:=FechaCaducidad) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un Error al guardar los movimientos"
|
||||
Exit For
|
||||
@@ -1126,20 +1189,26 @@ Partial Class Inventarios_Consignaciones
|
||||
FolioSalida = ObjInventario.Folio
|
||||
End If
|
||||
|
||||
If CveMovimientoSalida > 0 Then
|
||||
If MovtoNew Then
|
||||
CveMovtosSalida.Add(CveMovimientoSalida)
|
||||
FoliosSalida.Add(FolioSalida)
|
||||
MovtoNew = False
|
||||
End If
|
||||
Else
|
||||
TextoError = "No se pudo generar el movimiento de salida correctamente"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
If CveMovimientoSalida > 0 Then
|
||||
If MovtoNew Then
|
||||
CveMovtosSalida.Add(CveMovimientoSalida)
|
||||
FoliosSalida.Add(FolioSalida)
|
||||
MovtoNew = False
|
||||
End If
|
||||
Else
|
||||
TextoError = "No se pudo generar el movimiento de salida correctamente"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Dim Lote As String = "-1"
|
||||
Dim FechaCaducidad As Date = MinFecha
|
||||
If Gvr.FCTextBox("TxtLote").Text.Trim <> "" Then Lote = Gvr.FCTextBox("TxtLote").Text.Trim
|
||||
If Gvr.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha Then FechaCaducidad = Gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
|
||||
'AGREGAMOS MOVTOS DETALLE
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", "") Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", Lote, FechaCaducidad:=FechaCaducidad) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un Error al guardar los movimientos detalle de la salida"
|
||||
Exit For
|
||||
@@ -1744,4 +1813,6 @@ Partial Class Inventarios_Consignaciones
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user