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)
|
||||||
|
|||||||
@@ -373,7 +373,7 @@
|
|||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
<div style="display: table;width:100%">
|
<div style="display: table; width: 100%">
|
||||||
<asp:UpdatePanel ID="UpCliente" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
|
<asp:UpdatePanel ID="UpCliente" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 473px;">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
@@ -726,7 +726,7 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpEstatus" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="margin-left:auto">
|
<asp:UpdatePanel ID="UpEstatus" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="margin-left: auto">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div id="DivEstatusFac" runat="server" visible="false">
|
<div id="DivEstatusFac" runat="server" visible="false">
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
@@ -812,10 +812,11 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" Visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 20%;display: flex;flex-direction:row;color:white;background-color:#c49f47">
|
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" Visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 20%; display: flex; flex-direction: row; color: white; background-color: #c49f47">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div id="DivTurno" runat="server" style="width:100%;text-align:center;">
|
<div id="DivTurno" runat="server" style="width: 100%; text-align: center;">
|
||||||
Turno: <asp:Label runat="server" ID="LblTurno"></asp:Label>
|
Turno:
|
||||||
|
<asp:Label runat="server" ID="LblTurno"></asp:Label>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
@@ -1229,7 +1230,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<asp:UpdatePanel ID="UpRemisiones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
<asp:UpdatePanel ID="UpRemisiones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
@@ -1248,7 +1248,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<asp:UpdatePanel ID="UpAntNC" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
<asp:UpdatePanel ID="UpAntNC" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
@@ -1291,9 +1290,32 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6 ">
|
<div class="col-md-6 ">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div id="DivCodigosUnicos" class="row" runat="server" visible="false">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:UpdatePanel ID="UpCodigosUnicos" runat="server" UpdateMode="Conditional" RenderMode="Inline">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:GridView ID="GvCodigosUnicos" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="SerieLote,IdProductoPolizaVirtual,FechaAjuste,IdModelo,CveBCIUsado" ClientIDMode="Static" EmptyDataText="" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Código Único">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtCodigoUnico" runat="server" Text='<%# Eval("SerieLote") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
@@ -1312,6 +1334,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<table border="0" rules="none" class="well TextTab" style="float: right;">
|
<table border="0" rules="none" class="well TextTab" style="float: right;">
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
@@ -1511,7 +1535,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
@@ -3250,7 +3273,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<asp:TextBox ID="TxtObsAlmacen" runat="server" Rows="2" TextMode="MultiLine" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
|
<asp:TextBox ID="TxtObsAlmacen" runat="server" Rows="2" TextMode="MultiLine" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr align="left" id="TrKilometraje" runat="server" visible ="false">
|
<tr align="left" id="TrKilometraje" runat="server" visible="false">
|
||||||
<td>Kilometraje
|
<td>Kilometraje
|
||||||
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
|
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -6425,8 +6448,8 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@@ -7592,4 +7615,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -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,15 +23905,21 @@ 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
|
End If
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
|
GvCodigosUnicos.DataBind()
|
||||||
|
End If
|
||||||
|
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
|
||||||
|
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
|
||||||
@@ -23933,21 +23944,22 @@ Partial Class Ventas
|
|||||||
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