Codigos unicos en poliza virutal desde ventas
This commit is contained in:
@@ -758,11 +758,12 @@ Public Class ClsAcumuladores
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer) As Boolean
|
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
7029
Ventas/Ventas.aspx
7029
Ventas/Ventas.aspx
File diff suppressed because it is too large
Load Diff
@@ -4294,6 +4294,8 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaCodigoUnico()
|
||||||
|
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
UpContado.Update()
|
UpContado.Update()
|
||||||
UpEstatus.Update()
|
UpEstatus.Update()
|
||||||
@@ -17349,19 +17351,22 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
|
||||||
Dim CvePreioLista As Integer = -1
|
Dim CvePrecioLista As Integer = -1
|
||||||
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
If DdlSubProyectoDatos.SelectedValue.ToEntero > 0 Then
|
||||||
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
|
||||||
If Dr IsNot Nothing Then
|
If Dr IsNot Nothing Then
|
||||||
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
|
||||||
CvePreioLista = Dr("CvePrecioLista").ToString.ToEntero
|
CvePrecioLista = Dr("CvePrecioLista").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ObjCliente As New ClsClientes
|
Dim ObjCliente As New ClsClientes
|
||||||
|
|
||||||
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim, TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CvePreioLista) Then
|
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
|
||||||
|
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, TxtEstadoCliente.Text.Trim,
|
||||||
|
TxtPaisCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
|
||||||
|
DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista) Then
|
||||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||||
RegistraScript("hideDivEC();")
|
RegistraScript("hideDivEC();")
|
||||||
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
|
||||||
@@ -23900,54 +23905,61 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "P O L I Z A - V I R T U A L"
|
#Region "P O L I Z A - V I R T U A L"
|
||||||
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
Private Sub CargaCodigoUnico()
|
||||||
Dim DtUsados As DataTable = Nothing
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
|
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
|
||||||
DtUsados = ObjAcum.DtResultados.Copy()
|
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
|
||||||
|
DivCodigosUnicos.Visible = True
|
||||||
|
End If
|
||||||
|
ObjAcum.Dispose()
|
||||||
|
GvCodigosUnicos.DataBind()
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
End Sub
|
||||||
|
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
|
||||||
Try
|
Try
|
||||||
For Each Row As DataRow In DtUsados.Rows
|
For Each Row As GridViewRow In GvCodigosUnicos.Rows
|
||||||
Dim obj As New Modelos.MPolizaVentaWS
|
If Row.RowType = DataControlRowType.DataRow Then
|
||||||
'DATOS DEL CLIENTE
|
Dim obj As New Modelos.MPolizaVentaWS
|
||||||
obj.customer_name = ObjFactura.Cliente.Nombre
|
'DATOS DEL CLIENTE
|
||||||
obj.customer_last_name1 = ""
|
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||||
obj.customer_last_name2 = ""
|
obj.customer_last_name1 = ""
|
||||||
obj.customer_birthday = Nothing
|
obj.customer_last_name2 = ""
|
||||||
obj.customer_phone = ObjFactura.Cliente.Telefono
|
obj.customer_birthday = Nothing
|
||||||
obj.customer_email = ObjFactura.Cliente.Mail
|
obj.customer_phone = ObjFactura.Cliente.Telefono
|
||||||
obj.customer_gender = "03" 'OTRO GENERO
|
obj.customer_email = ObjFactura.Cliente.Mail
|
||||||
obj.customer_advertising = False
|
obj.customer_gender = "03" 'OTRO GENERO
|
||||||
obj.customer_car_brand = "00"
|
obj.customer_advertising = False
|
||||||
obj.customer_car_model = "00"
|
obj.customer_car_brand = "00"
|
||||||
obj.customer_car_year = ObjFactura.Fecha.Year
|
obj.customer_car_model = "00"
|
||||||
|
obj.customer_car_year = ObjFactura.Fecha.Year
|
||||||
|
|
||||||
'DATOS DE VENTA
|
'DATOS DE VENTA
|
||||||
obj.sale_date = ObjFactura.Fecha
|
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 = "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 = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
|
||||||
|
|
||||||
'DATOS DEL PRODUCTO
|
'DATOS DEL PRODUCTO
|
||||||
obj.product_code = Row("IdProductoPolizaVirtual").ToString()
|
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
|
||||||
obj.product_unique_code = Row("SerieLote").ToString() '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 = "01 " 'VENTA
|
obj.product_sale_type = "01 " 'VENTA
|
||||||
|
|
||||||
Dim FechaUsado As DateTime = Row("FechaAjuste").ToString().ToDateTime()
|
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
|
||||||
|
|
||||||
'DATOS DE USADO
|
'DATOS DE USADO
|
||||||
obj.used_product = True
|
obj.used_product = True
|
||||||
obj.used_brand = Row("IdModelo").ToString() 'MARCAR DEL USADO
|
obj.used_brand = Row.DataKey("IdModelo").ToString() 'MARCAR DEL USADO
|
||||||
obj.used_bci = Row("CveBCIUsado").ToString() 'VALOR DEL BCI
|
obj.used_bci = Row.DataKey("IdBCI").ToString() 'VALOR DEL BCI
|
||||||
obj.used_month = FechaUsado.Month
|
obj.used_month = FechaUsado.Month
|
||||||
obj.used_year = FechaUsado.Year
|
obj.used_year = FechaUsado.Year
|
||||||
obj.used_sale_date = FechaUsado
|
obj.used_sale_date = FechaUsado
|
||||||
|
|
||||||
EnviarPolizaVentaWS(obj)
|
EnviarPolizaVentaWS(obj)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
OnError("Ocurrió un error al generar la poliza virtual", ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user