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,49 +23814,61 @@ 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 obj As New Modelos.MPolizaVentaWS Dim DtUsados As DataTable = Nothing
'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre
obj.customer_last_name1 = ""
obj.customer_last_name2 = ""
obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False
obj.customer_car_brand = "00"
obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA If ObjVentas.GetVentasUsadosDetalle(ObjFactura.CveVenta) Then
obj.sale_date = Now DtUsados = ObjVentas.DtResultados.Copy()
obj.sale_paidby = "01" End If
obj.sale_type = "01" 'PISO
obj.sale_type_service = "01" 'PARTICULAR
obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.SubTotal
obj.sale_id = ObjFactura.CveVenta.ToString()
'DATOS DEL PRODUCTO For Each Row As DataRow In DtUsados.Rows
obj.product_code = "174925" Dim obj As New Modelos.MPolizaVentaWS
obj.product_unique_code = "65047187" 'DATOS DEL CLIENTE
obj.product_sale_type = "02" 'AJUSTE obj.customer_name = ObjFactura.Cliente.Nombre
obj.customer_last_name1 = ""
obj.customer_last_name2 = ""
obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False
obj.customer_car_brand = "00"
obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE USADO 'DATOS DE VENTA
obj.used_product = True obj.sale_date = ObjFactura.Fecha
obj.used_brand = "01" obj.sale_paidby = "01"
obj.used_bci = "25" obj.sale_type = "01" 'PISO
obj.used_month = 1 obj.sale_type_service = "02" 'COMERCIAL
obj.used_year = 2015 obj.sale_total = ObjFactura.Total
obj.used_sale_date = ObjFactura.Fecha obj.sale_discount = ObjFactura.Descuento
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
Return False 'DATOS DEL PRODUCTO
'EnviarPolizaVentaWS(obj) obj.product_code = Row("Codigo").ToString()
obj.product_unique_code = "" 'se indique el código único de la batería.
obj.product_sale_type = "01 " 'VENTA
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
'DATOS DE USADO
obj.used_product = True
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
obj.used_month = FechaUsado.Month
obj.used_year = FechaUsado.Year
obj.used_sale_date = FechaUsado
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