poliza virtual

This commit is contained in:
2019-12-13 01:00:14 -07:00
parent 97349a7d35
commit 2e1f6ef80b
2 changed files with 53 additions and 41 deletions

View File

@@ -93,7 +93,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
obj.sale_type = "01" 'PISO obj.sale_type = "01" 'PISO
obj.sale_type_service = "01" 'PARTICULAR obj.sale_type_service = "01" 'PARTICULAR
obj.sale_total = ObjFactura.Total obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.SubTotal obj.sale_discount = 0 'ObjFactura.SubTotal
obj.sale_id = GuidGenerator.GenerateTimeBasedGuid().ToString() obj.sale_id = GuidGenerator.GenerateTimeBasedGuid().ToString()
'Dim PS = ObjFactura.DtDetalle.Rows(0) 'Dim PS = ObjFactura.DtDetalle.Rows(0)

View File

@@ -6735,7 +6735,9 @@ Partial Class Ventas
'ENVIAR POLIZA VIRTUAL 'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
GeneraPolizaVentaWS(ObjFactura) If Not GeneraPolizaVentaWS(ObjVentas, ObjFactura) Then
ErrorList.Add("Ocurrió un error al registrar los movimientos de almacén del contrato de consignación")
End If
End If End If
End If End If
@@ -23812,7 +23814,14 @@ Partial Class Ventas
CargaRNC() CargaRNC()
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });") RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
End Sub End Sub
Protected Function GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) As Boolean Protected Function GeneraPolizaVentaWS(ByRef ObjVentas As ClsVentas, ObjFactura As Modelos.Factura) As Boolean
Dim DtUsados As DataTable = Nothing
If ObjVentas.GetVentasUsadosDetalle(ObjFactura.CveVenta) Then
DtUsados = ObjVentas.DtResultados.Copy()
End If
For Each Row As DataRow In DtUsados.Rows
Dim obj As New Modelos.MPolizaVentaWS Dim obj As New Modelos.MPolizaVentaWS
'DATOS DEL CLIENTE 'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre obj.customer_name = ObjFactura.Cliente.Nombre
@@ -23828,33 +23837,38 @@ Partial Class Ventas
obj.customer_car_year = ObjFactura.Fecha.Year obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA 'DATOS DE VENTA
obj.sale_date = Now obj.sale_date = ObjFactura.Fecha
obj.sale_paidby = "01" obj.sale_paidby = "01"
obj.sale_type = "01" 'PISO obj.sale_type = "01" 'PISO
obj.sale_type_service = "01" 'PARTICULAR obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.SubTotal obj.sale_discount = ObjFactura.Descuento
obj.sale_id = ObjFactura.CveVenta.ToString() obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
'DATOS DEL PRODUCTO 'DATOS DEL PRODUCTO
obj.product_code = "174925" obj.product_code = Row("Codigo").ToString()
obj.product_unique_code = "65047187" obj.product_unique_code = "" 'se indique el código único de la batería.
obj.product_sale_type = "02" 'AJUSTE obj.product_sale_type = "01 " 'VENTA
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
'DATOS DE USADO 'DATOS DE USADO
obj.used_product = True obj.used_product = True
obj.used_brand = "01" obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
obj.used_bci = "25" obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
obj.used_month = 1 obj.used_month = FechaUsado.Month
obj.used_year = 2015 obj.used_year = FechaUsado.Year
obj.used_sale_date = ObjFactura.Fecha obj.used_sale_date = FechaUsado
Return False EnviarPolizaVentaWS(obj)
'EnviarPolizaVentaWS(obj) Next
Return True
End Function End Function
Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS) Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS)
Dim Retorno As String = "[]"
Dim Respuesta As String = "[]"
Dim User As String = "cslth.2809@jcilink.com" Dim User As String = "cslth.2809@jcilink.com"
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076" Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
@@ -23898,14 +23912,12 @@ Partial Class Ventas
Dim content As New FormUrlEncodedContent(Parametros) Dim content As New FormUrlEncodedContent(Parametros)
Dim response = wc.PostAsync(Url, content).Result Dim response = wc.PostAsync(Url, content).Result
Retorno = response.Content.ReadAsStringAsync().Result Respuesta = response.Content.ReadAsStringAsync().Result
End Using End Using
Catch ex As Exception Catch ex As Exception
ex.GuardaLog(ex.Message) ex.GuardaLog(ex.Message)
End Try End Try
End Sub End Sub
End Class End Class