mejora en la exitencia de serie
This commit is contained in:
@@ -857,7 +857,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim FechaCaducidad As Date
|
Dim FechaCaducidad As Date
|
||||||
|
|
||||||
Dim TextoExistencia As StringBuilder = New StringBuilder
|
Dim TextoExistencia As StringBuilder = New StringBuilder
|
||||||
Dim Existencia As Double
|
Dim Existencia As Decimal
|
||||||
Dim CantidadenGrid As Decimal
|
Dim CantidadenGrid As Decimal
|
||||||
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de existencia:<br/>")
|
TextoExistencia.Append("Los siguiente productos se ajustaron por falta de existencia:<br/>")
|
||||||
If Not CargadoDeMov Then
|
If Not CargadoDeMov Then
|
||||||
@@ -884,7 +884,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad))
|
CantidadenGrid = DtMovimientos.SUMD("Cantidad", String.Format("CvePS = {0} AND CveUM = {1} {2} {3} {4} ", dr("CvePS"), dr("CveUM"), If(Not dr("Serie").ToString.Contiene("-1", ""), $" AND Serie = '{dr("Serie")}'", ""), tLote, tFechaCaducidad))
|
||||||
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
|
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
|
||||||
'si hay existencia en almacen costeado, lo tengo que sacar
|
'si hay existencia en almacen costeado, lo tengo que sacar
|
||||||
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
Existencia = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'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 = 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)
|
||||||
@@ -892,12 +892,10 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
'DtMovimientos.SUM("Cantidad", String.Format("CvePS = {0}", dr("CvePS").ToString.ToEntero))
|
'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
|
'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
|
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||||
If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") Then
|
If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") OrElse (Serie <> "-1" AndAlso Serie <> "") Then
|
||||||
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
|
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
|
||||||
ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("Existencia", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("Existencia", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'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
|
Existencia = ExistenciaEspecificada - CantidadenGrid
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user