Correcion en ventas

This commit is contained in:
2020-01-21 11:51:58 -07:00
parent 3aeb33f2b1
commit 7eb64f0243

View File

@@ -6383,8 +6383,7 @@ Partial Class Ventas
Continue For Continue For
End If End If
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then ' si tiene relacionada una OC,
'VALIDA EXISTENCIA 'VALIDA EXISTENCIA
CveProducto = dr("CvePS").ToString.ToEntero CveProducto = dr("CvePS").ToString.ToEntero
CveUnidad = dr("CveUM").ToString.ToEntero CveUnidad = dr("CveUM").ToString.ToEntero
@@ -6495,7 +6494,7 @@ Partial Class Ventas
'Valida si en caso de que el detalle tenga llantas o polizas se agreguén kilometraje/serie en la parte de observaciones(solo para el caso de empresas llanteras) 'Valida si en caso de que el detalle tenga llantas o polizas se agreguén kilometraje/serie en la parte de observaciones(solo para el caso de empresas llanteras)
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
If txtkilometraje.text.toentero = 0 Then If TxtKilometraje.Text.ToEntero = 0 Then
'cuando es la clasificacion de llantas 'cuando es la clasificacion de llantas
Dim FaltaObservacion As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion = 20342").ToEntero Dim FaltaObservacion As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion = 20342").ToEntero
If FaltaObservacion = 20342 Then If FaltaObservacion = 20342 Then
@@ -6914,8 +6913,7 @@ 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
Dim TipoPoliza As Integer = 1 GeneraPolizaVentaWS(ObjFactura)
GeneraPolizaVentaWS(ObjFactura, TipoPoliza)
End If End If
End If End If
@@ -9168,7 +9166,7 @@ Partial Class Ventas
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False), DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
Kilometraje:=TxtKilometraje.Text.todouble) Then Kilometraje:=TxtKilometraje.Text.ToDouble) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -15479,7 +15477,7 @@ Partial Class Ventas
If ConSalida AndAlso Not OcurrioError Then If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura) OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If End If
If Not OcurrioError Then If Not OcurrioError Then
@@ -15804,7 +15802,7 @@ Partial Class Ventas
OcurrioError = True OcurrioError = True
End Try End Try
Return OcurrioError Return Not OcurrioError
End Function End Function
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
@@ -23938,23 +23936,22 @@ Partial Class Ventas
GvCodigosUnicos.DataBind() GvCodigosUnicos.DataBind()
End If End If
End Sub End Sub
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura, TipoPoliza As Integer) Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía
Try Try
For Each Row As GridViewRow In GvCodigosUnicos.Rows For Each Row As GridViewRow In GvCodigosUnicos.Rows
If Row.RowType = DataControlRowType.DataRow Then If Row.RowType = DataControlRowType.DataRow Then
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
obj.customer_last_name1 = "." obj.customer_last_name1 = ""
obj.customer_last_name2 = "" obj.customer_last_name2 = ""
obj.customer_birthday = Nothing obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False obj.customer_advertising = False
obj.customer_car_brand = "01" obj.customer_car_brand = "00"
obj.customer_car_model = "01" obj.customer_car_model = "00"
obj.customer_car_year = ObjFactura.Fecha.Year obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA 'DATOS DE VENTA
@@ -23964,12 +23961,12 @@ Partial Class Ventas
obj.sale_type_service = "02" 'COMERCIAL obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.Descuento 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 = Row.DataKey("IdProductoPolizaVirtual").ToString() obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE) obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
obj.product_sale_type = "0" & TipoPoliza 'VENTA obj.product_sale_type = "01 " 'VENTA
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime() Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()