- Serie, Lote Caducidad, SeccionAlmacen
This commit is contained in:
@@ -510,20 +510,30 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha))
|
||||
|
||||
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(TxtnLote.Visible, TxtnLote.Text, ""), FechaCaducidad:=If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha), Limpia:=FuncionalidadSinSerie)
|
||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(TxtnLote.Visible, TxtnLote.Text, ""), FechaCaducidad:=If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha), CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, Fechacaducidad As Date) As Boolean
|
||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
|
||||
Dim Retorno = True
|
||||
|
||||
Dim ExistenciaEspecificada As Decimal
|
||||
Dim CantidadEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(Serie <> "-1", $" AND Serie = '{Serie}'", "")}")
|
||||
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=Serie, Lote:=Lote, FechaCaducidad:=Fechacaducidad, PendientePorSurtir:=1)
|
||||
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
|
||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||
If FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "" Then
|
||||
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
Else
|
||||
ExistenciaEspecificada = Existencia
|
||||
End If
|
||||
Inv.Dispose()
|
||||
|
||||
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUnidadMedida} {If(Serie <> "-1", $" AND Serie = '{Serie}'", "")}") < 0 Then
|
||||
If Existencia < 0 Then
|
||||
If Existencia - Cantidad - CantidadEnGrid < 0 ORELSE ExistenciaEspecificada - Cantidad - CantidadEnGrid < 0 Then
|
||||
If Existencia < 0 OrElse ExistenciaEspecificada < 0 Then
|
||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||
Else
|
||||
@@ -535,7 +545,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True)
|
||||
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1)
|
||||
If Cantidad <= 0 Then
|
||||
Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
@@ -558,10 +568,13 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
registro.Item("Observaciones") = Observaciones
|
||||
registro.Item("Serie") = Serie
|
||||
registro.Item("Lote") = Lote
|
||||
registro.Item("FechaCaducidad") = FechaCaducidad
|
||||
If FechaCaducidad > MinFecha Then registro.Item("FechaCaducidad") = FechaCaducidad
|
||||
registro.Item("CveClasificacion") = CveClasificacion
|
||||
registro.Item("CveAF") = -1
|
||||
registro.Item("EstatusExistencia") = "1"
|
||||
registro.Item("CveSeccionAlmacen") = CveSeccionAlmacen
|
||||
registro.Item("SeccionAlmacen") = SeccionAlmacen
|
||||
registro.Item("CveSeccionAlmacenDestino") = CveSeccionAlmacenDestino
|
||||
|
||||
registro.Item("TotalImporte") = 0
|
||||
registro.Item("PU") = 0
|
||||
@@ -678,15 +691,33 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
'VALIDA LA EXISTENCIA DEL ALMACEN DE ORIGEN
|
||||
Dim ErrorExistencia = False
|
||||
Dim Serie, Lote As String
|
||||
Dim CveSeccionAlmacen As Integer
|
||||
Dim FechaCaducidad As Date
|
||||
|
||||
Dim TextoExistencia As StringBuilder = New StringBuilder
|
||||
Dim Existencia As Double
|
||||
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de exitencia:<br/>")
|
||||
Dim CantidadenGrid As Decimal
|
||||
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de existencia:<br/>")
|
||||
If Not CargadoDeMov Then
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(dr("Serie").ToString = "", "-1", dr("Serie").ToString), PendientePorSurtir:=1)
|
||||
Existencia -= DtMovimientos.SUM("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
CveSeccionAlmacen = If(dr("CveSeccionAlmacen").ToString = "", -1, dr("CveSeccionAlmacen").ToString.ToEntero)
|
||||
Serie = If(dr("Serie").ToString = "", "-1", dr("Serie").ToString)
|
||||
Lote = If(dr("Lote").ToString = "", "-1", dr("Lote").ToString)
|
||||
FechaCaducidad = If(dr("FechaCaducidad").ToString = "", MinFecha, dr("FechaCaducidad").ToString.ToDate)
|
||||
|
||||
Dim ExistenciaEspecificada As Decimal = 0
|
||||
CantidadenGrid = DtMovimientos.SUMD("Cantidad", $"CvePS = {dr("CvePS").ToString.ToEntero} AND CveUM = {dr("CveUM").ToString.ToEntero} {If(dr("Serie").ToString <> "-1", $" AND Serie = '{dr("Serie").ToString}'", "")}")
|
||||
Existencia = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
Existencia -= CantidadenGrid
|
||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||
If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") Then
|
||||
ExistenciaEspecificada = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||
Existencia = ExistenciaEspecificada - CantidadenGrid
|
||||
End If
|
||||
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
@@ -701,7 +732,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Next
|
||||
Else
|
||||
For Each gvr As GridViewRow In GvDatos.Rows
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Serie:=If(gvr.DataKey("Serie").ToString = "", "-1", gvr.DataKey("Serie").ToString), PendientePorSurtir:=1)
|
||||
CveSeccionAlmacen = If(gvr.DataKey("CveSeccionAlmacen") = "", -1, gvr.DataKey("CveSeccionAlmacen").ToEntero)
|
||||
Serie = If(gvr.DataKey("Serie") = "", "-1", gvr.DataKey("Serie"))
|
||||
Lote = If(gvr.DataKey("Lote") = "", "-1", gvr.DataKey("Lote"))
|
||||
FechaCaducidad = If(gvr.DataKey("FechaCaducidad") = "", MinFecha, gvr.DataKey("FechaCaducidad").ToDate)
|
||||
|
||||
Existencia = ObjInventario.GetExistenciasPS(gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=1)
|
||||
Existencia -= gvr.FCTextBox("TxtCantidad2").Text.ToEntero
|
||||
If Existencia < 0 Then
|
||||
ErrorExistencia = True
|
||||
@@ -764,7 +800,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Else
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In DtMovimientos.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
@@ -819,7 +855,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacenDestino").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
@@ -1119,35 +1155,33 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TxtnLote.Visible = False
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
|
||||
EscondeColumnasGVM(DtMovimientos)
|
||||
|
||||
If DdlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS")
|
||||
If drP IsNot Nothing Then
|
||||
If CBool(drP("AplicaSeccion")) Then
|
||||
ThSeccionAlmacen.Visible = True
|
||||
TdSeccionAlmacen.Visible = True
|
||||
DdlSeccionAlmacen.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaSerie")) Then
|
||||
ThSerie.Visible = True
|
||||
TdSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaLote")) Then
|
||||
TxtnLote.Visible = True
|
||||
ThLote.Visible = True
|
||||
TdLote.Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
End If
|
||||
If CBool(drP("AplicaCaducidad")) Then
|
||||
TxtnFechaCaducidad.Visible = True
|
||||
ThFechaCaducidad.Visible = True
|
||||
TdFechaCaducidad.Visible = True
|
||||
GvDatos.Columns(8).Visible = True
|
||||
End If
|
||||
|
||||
ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion"))
|
||||
'GvDatos.Columns(5).Visible = CBool(drP("AplicaSeccion"))
|
||||
|
||||
|
||||
ThSerie.Visible = CBool(drP("AplicaSerie"))
|
||||
TdSerie.Visible = CBool(drP("AplicaSerie"))
|
||||
TxtnSerie.Visible = CBool(drP("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"))
|
||||
TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad"))
|
||||
'GvDatos.Columns(8).Visible = CBool(drP("AplicaCaducidad"))
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -1193,44 +1227,54 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End Sub
|
||||
|
||||
Private Sub EscondeColumnasGVM(DtTemp As DataTable)
|
||||
TxtnSerie.Visible = False
|
||||
ThSerie.Visible = False
|
||||
TdSerie.Visible = False
|
||||
GvDatos.Columns(5).Visible = False
|
||||
|
||||
TxtnLote.Visible = False
|
||||
ThLote.Visible = False
|
||||
TdLote.Visible = False
|
||||
GvDatos.Columns(6).Visible = False
|
||||
GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> ""
|
||||
GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> ""
|
||||
GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha
|
||||
GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0
|
||||
|
||||
TxtnFechaCaducidad.Visible = False
|
||||
ThFechaCaducidad.Visible = False
|
||||
TdFechaCaducidad.Visible = False
|
||||
GvDatos.Columns(7).Visible = False
|
||||
''TxtnSerie.Visible = False
|
||||
''ThSerie.Visible = False
|
||||
''TdSerie.Visible = False
|
||||
'GvDatos.Columns(5).Visible = False
|
||||
|
||||
If DtTemp.MAX("Serie").ToString <> "" Then
|
||||
TxtnSerie.Visible = True
|
||||
ThSerie.Visible = True
|
||||
TdSerie.Visible = True
|
||||
GvDatos.Columns(5).Visible = True
|
||||
End If
|
||||
If DtTemp.MAX("Lote").ToString <> "" Then
|
||||
TxtnLote.Visible = True
|
||||
ThLote.Visible = True
|
||||
TdLote.Visible = True
|
||||
GvDatos.Columns(6).Visible = True
|
||||
'TxtnLote.Visible = False
|
||||
'ThLote.Visible = False
|
||||
'TdLote.Visible = False
|
||||
'GvDatos.Columns(6).Visible = False
|
||||
|
||||
'TxtnFechaCaducidad.Visible = False
|
||||
'ThFechaCaducidad.Visible = False
|
||||
'TdFechaCaducidad.Visible = False
|
||||
'GvDatos.Columns(7).Visible = False
|
||||
|
||||
|
||||
'If DtTemp.MAX("Serie").ToString <> "" Then
|
||||
' TxtnSerie.Visible = True
|
||||
' ThSerie.Visible = True
|
||||
' TdSerie.Visible = True
|
||||
' GvDatos.Columns(5).Visible = True
|
||||
'End If
|
||||
'If DtTemp.MAX("Lote").ToString <> "" Then
|
||||
' TxtnLote.Visible = True
|
||||
' ThLote.Visible = True
|
||||
' TdLote.Visible = True
|
||||
' GvDatos.Columns(6).Visible = True
|
||||
'End If
|
||||
'If DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha Then
|
||||
' TxtnFechaCaducidad.Visible = True
|
||||
' ThFechaCaducidad.Visible = True
|
||||
' TdFechaCaducidad.Visible = True
|
||||
' GvDatos.Columns(7).Visible = True
|
||||
|
||||
'End If
|
||||
|
||||
TxtnFechaCaducidad.Visible = True
|
||||
ThFechaCaducidad.Visible = True
|
||||
TdFechaCaducidad.Visible = True
|
||||
GvDatos.Columns(7).Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("EstatusExistencia").ToEntero < 0 Then
|
||||
If e.Row.DBCampo("EstatusExistencia").ToEntero <0 Then
|
||||
e.Row.Cells(0).BackColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
@@ -1399,6 +1443,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Dtt IsNot Nothing Then
|
||||
GvDatosRecepcion.DataSource = Dtt
|
||||
GvDatosRecepcion.DataBind()
|
||||
|
||||
GvDatosRecepcion.Columns(6).Visible = Dtt.MAX("Serie") <> ""
|
||||
GvDatosRecepcion.Columns(7).Visible = Dtt.MAX("Lote") <> ""
|
||||
GvDatosRecepcion.Columns(8).Visible = Dtt.MAX("FechaCaducidad") <> ""
|
||||
GvDatosRecepcion.Columns(9).Visible = Dtt.MAX("Serie") <> ""
|
||||
'Dt.Dispose()
|
||||
End If
|
||||
|
||||
@@ -1447,6 +1496,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Else
|
||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad")))
|
||||
If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenRecepcion.SelectedValue.ToEntero > 0 Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenRecepcion.SelectedValue.ToEntero)
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End If
|
||||
|
||||
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||
@@ -1695,7 +1750,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, gvr.DataKey("CveAF").ToString.ToEntero, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, gvr.DataKey("PU").ToString.ToDecimal, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
|
||||
Reference in New Issue
Block a user