Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -4174,7 +4174,10 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then
|
||||
If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
|
||||
Dim AplicaAmortizacion As Boolean = False
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True
|
||||
|
||||
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
|
||||
GvNC.DataSource = ObjVentas.DtResultados
|
||||
TmpDTNCVinculadas = ObjVentas.DtResultados
|
||||
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
|
||||
@@ -4187,7 +4190,7 @@ Partial Class Ventas
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If GvNC.Rows.Count > 0 Then
|
||||
ImgAntiPend.Visible = False
|
||||
@@ -5742,8 +5745,8 @@ Partial Class Ventas
|
||||
Dim Cantidad, PU, Descuento, CantidadInventario As Decimal
|
||||
Dim CuentaPredial As String
|
||||
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
PU = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal, 6)
|
||||
Descuento = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal, NumeroDecimales)
|
||||
PU = (GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal).RoundSQL(6)
|
||||
Descuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
|
||||
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
|
||||
|
||||
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
|
||||
@@ -14125,7 +14128,7 @@ Partial Class Ventas
|
||||
Dim Row As DataRow = Nothing
|
||||
Dim TotalCalculableImpuestos As Decimal = 0
|
||||
Dim TotalCalculableImpuestosIVA As Decimal = 0
|
||||
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||
PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||
|
||||
Row = TmpDT.NewRow()
|
||||
Row("CveProyecto") = CveProyecto
|
||||
@@ -23935,11 +23938,20 @@ Partial Class Ventas
|
||||
|
||||
#Region "P O L I Z A - V I R T U A L"
|
||||
Private Sub CargaCodigoUnico()
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
|
||||
DivCodigosUnicos.Visible = True
|
||||
If ObjAcum.GetPolizasVirtuales(Me.CveVenta) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||
Dim RowPoliza As DataRow = ObjAcum.DtResultados.Rows(0)
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
|
||||
DivCodigosUnicos.Visible = True
|
||||
End If
|
||||
|
||||
If Not CBool(RowPoliza("Enviada").ToString()) Then
|
||||
LnkEnviarPolizaVirtual.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
GvCodigosUnicos.DataBind()
|
||||
@@ -23947,47 +23959,56 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||
Try
|
||||
'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía
|
||||
Dim TipoPoliza As Integer = 0
|
||||
For Each Row As GridViewRow In GvCodigosUnicos.Rows
|
||||
If Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim CvePolizaVirtual As Integer = Row.DataKey("CvePolizaVirtual").ToEntero()
|
||||
|
||||
Dim obj As New Modelos.MPolizaVentaWS
|
||||
'DATOS DEL CLIENTE
|
||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||
obj.customer_last_name1 = ""
|
||||
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
|
||||
obj.customer_car_brand = Row.DataKey("IdMarcaAuto").ToString().Trim()
|
||||
obj.customer_car_model = Row.DataKey("IdModeloAuto").ToString().Trim()
|
||||
obj.customer_car_year = Row.DataKey("AnioVehiculo").ToString().ToEntero()
|
||||
|
||||
'DATOS DE VENTA
|
||||
obj.sale_date = ObjFactura.Fecha
|
||||
obj.sale_paidby = "01"
|
||||
obj.sale_type = "01" 'PISO
|
||||
obj.sale_type_service = "02" 'COMERCIAL
|
||||
obj.sale_total = ObjFactura.Total
|
||||
obj.sale_discount = ObjFactura.Descuento
|
||||
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||
obj.sale_type_service = "0" & Row.DataKey("TipoServicio").ToString().Trim()
|
||||
obj.sale_total = Row.DataKey("Total").ToString().ToDecimal()
|
||||
obj.sale_discount = Row.DataKey("Descuento").ToString().ToDecimal()
|
||||
obj.sale_id = ObjFactura.CveVenta.ToString
|
||||
|
||||
'DATOS DEL PRODUCTO
|
||||
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_sale_type = "01 " 'VENTA
|
||||
|
||||
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
|
||||
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString().Trim()
|
||||
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text.Trim() 'se indique el código único de la batería. (SERIE LOTE)
|
||||
obj.product_sale_type = "0" & Row.DataKey("TipoPoliza").ToString().Trim()
|
||||
|
||||
'DATOS DE USADO
|
||||
obj.used_product = True
|
||||
obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO
|
||||
obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI
|
||||
obj.used_month = FechaUsado.Month
|
||||
obj.used_year = FechaUsado.Year
|
||||
obj.used_sale_date = FechaUsado
|
||||
obj.used_product = CBool(Row.DataKey("TieneUsado").ToString())
|
||||
|
||||
If obj.used_product Then
|
||||
Dim FechaUsado As DateTime = Row.DataKey("FechaUsado").ToString().ToDateTime()
|
||||
|
||||
obj.used_brand = Row.DataKey("IdModelo").ToString().Trim() 'MARCAR DEL USADO
|
||||
obj.used_bci = Row.DataKey("IdBCI").ToString().Trim() 'VALOR DEL BCI
|
||||
obj.used_month = FechaUsado.Month
|
||||
obj.used_year = FechaUsado.Year
|
||||
obj.used_sale_date = FechaUsado
|
||||
End If
|
||||
|
||||
|
||||
EnviarPolizaVentaWS(obj, CvePolizaVirtual)
|
||||
|
||||
EnviarPolizaVentaWS(obj)
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
@@ -23997,11 +24018,11 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS) As Boolean
|
||||
Protected Function EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS, CvePolizaVirtual As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Respuesta As String = "[]"
|
||||
|
||||
Dim User As String = "cslth.2809@jcilink.com"
|
||||
Dim User As String = "cslth.7777@lth.com"
|
||||
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
|
||||
|
||||
Try
|
||||
@@ -24048,13 +24069,22 @@ Partial Class Ventas
|
||||
Dim resp = JArray.Parse(Respuesta)
|
||||
|
||||
If resp.Count > 0 Then
|
||||
Dim Msg = resp(0)("Descripcion").ToString()
|
||||
Dim Msg As New StringBuilder()
|
||||
Msg.AppendFormat("Mensaje Poliza Virtual: {0}", resp(0)("Descripcion").ToString())
|
||||
|
||||
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508") Then
|
||||
Alert(Msg, TipoMensaje.MsgInformacion)
|
||||
Retorno = True
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now) Then
|
||||
Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
Else
|
||||
Alert(Msg, TipoMensaje.MsgAdvertencia)
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, False, Now) Then
|
||||
Alert(Msg.ToString(), TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjAcum.Dispose()
|
||||
End If
|
||||
Else
|
||||
Alert("No se envió la poliza virtual", TipoMensaje.MsgAdvertencia)
|
||||
@@ -24068,6 +24098,13 @@ Partial Class Ventas
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Protected Sub LnkEnviarPolizaVirtual_Click(sender As Object, e As EventArgs)
|
||||
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contains("Rem") Then
|
||||
CreaObjetosVenta()
|
||||
GeneraPolizaVentaWS(ObjFactura)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -24112,4 +24149,5 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user