Metodo de existencias en base a la tabla

This commit is contained in:
2020-05-30 10:28:07 -07:00
parent 5bc03f116c
commit 4ec20ede1c

View File

@@ -1839,6 +1839,44 @@ Public Class ClsProductosServicios
Return Retorno Return Retorno
End Function End Function
Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ProductosExistenciasWSGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Lote", SqlDbType.VarChar).Value = Lote
.Add("@Batch", SqlDbType.VarChar).Value = Batch
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
#Region "Porcentaje Productos" #Region "Porcentaje Productos"