Correcion existencias servicio de ecommerce E141
This commit is contained in:
@@ -406,6 +406,8 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Else
|
Else
|
||||||
retorno = "False"
|
retorno = "False"
|
||||||
End If
|
End If
|
||||||
|
Case "ActualizarPreciosJson"
|
||||||
|
retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False))
|
||||||
Case "ActualizarExistencias"
|
Case "ActualizarExistencias"
|
||||||
respuesta = ActualizarExistencias()
|
respuesta = ActualizarExistencias()
|
||||||
If respuesta Then
|
If respuesta Then
|
||||||
@@ -413,6 +415,8 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Else
|
Else
|
||||||
retorno = "False"
|
retorno = "False"
|
||||||
End If
|
End If
|
||||||
|
Case "ActualizarExistenciasJson"
|
||||||
|
retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False))
|
||||||
Case "ActualizarVendedores"
|
Case "ActualizarVendedores"
|
||||||
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||||
If respuesta Then
|
If respuesta Then
|
||||||
@@ -2118,6 +2122,26 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ActualizarPreciosJson(Todos As Boolean) As String
|
||||||
|
Dim payload = New JObject()
|
||||||
|
|
||||||
|
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = Nothing
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
'OBTERNER PRECIOS DE PUBLICO GENERAL
|
||||||
|
If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
|
||||||
|
DtPS = ObjPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtPS IsNot Nothing Then
|
||||||
|
payload.Add(New JProperty("products", GenerarPayloadPrecios(DtPS)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return payload.ToString()
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
||||||
Dim ArrayPS As New JArray
|
Dim ArrayPS As New JArray
|
||||||
For Each RowPS As DataRow In DtPS.Rows
|
For Each RowPS As DataRow In DtPS.Rows
|
||||||
@@ -2215,6 +2239,25 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function ActualizarExistenciasJson(Todos As Boolean) As String
|
||||||
|
Dim payload = New JObject()
|
||||||
|
|
||||||
|
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||||
|
|
||||||
|
Dim DtPS As DataTable = Nothing
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
|
||||||
|
DtPS = ObjPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtPS IsNot Nothing Then
|
||||||
|
payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return payload.ToString()
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
||||||
Dim ArrayPS As New JArray
|
Dim ArrayPS As New JArray
|
||||||
For Each RowPS As DataRow In DtPS.Rows
|
For Each RowPS As DataRow In DtPS.Rows
|
||||||
@@ -2233,7 +2276,7 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
|
#Region "A C T U A L I Z A R - V E N D E D O R E S"
|
||||||
|
|
||||||
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|||||||
Reference in New Issue
Block a user