-- prefiltrado de serv domicilio

This commit is contained in:
2021-03-16 08:34:01 -07:00
parent e8fff29f30
commit 0ef3396d24

View File

@@ -583,8 +583,15 @@ Partial Class Inventarios_EntregaAlmacen
HLFolio.Text = DtDatos.Rows(0)("SerieFolio").ToString()
If UsuarioActual.TienePermisoProceso(201) Then
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
End If
End If
'filtra los Almacenes de domicilio
If DtDatos.Rows(0)("ServicioDomicilio").ToString() = "True" Then
StrAlmacenes = String.Format("{0} AND Almacen like '%Domicilio%' ", StrAlmacenes)
Else
StrAlmacenes = String.Format("{0} AND NOT (Almacen like '%Domicilio%') ", StrAlmacenes)
End If
LbObservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString()
LbObservacionesAlmacen.Text = DtDatos.Rows(0)("ObservacionesAlmacen").ToString()
CveVentaSurtir = CveVenta
@@ -3064,8 +3071,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveMovimientoEntrada As Integer
Dim FolioEntrada As Integer
Dim ErrorMovInv As Boolean
Dim DtDetalle As New DataTable
Dim DtDetalleLote As New DataTable
Dim DtDetalle As New DataTable
Dim TextoError = ""
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
@@ -3175,7 +3181,7 @@ Partial Class Inventarios_EntregaAlmacen
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
'DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
For Each Dr1 As DataRow In DtDetalle.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
@@ -3183,17 +3189,17 @@ Partial Class Inventarios_EntregaAlmacen
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
For Each Dr1 As DataRow In DtDetalleLote.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
Exit For
End If
Next
Next
'ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
' For Each Dr1 As DataRow In DtDetalleLote.Rows
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
' Exit For
' End If
' Next
Else 'NORMAL
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
@@ -3219,12 +3225,8 @@ Partial Class Inventarios_EntregaAlmacen
If CveMovimientoEntrada > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim CveSeccionAlmacen As Integer = -1
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
'If CBool(Dr("AplicaSeccion")) Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
'Else
' CveSeccionAlmacen = -1
'End If
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then