Codigos unicos en poliza virutal desde ventas

This commit is contained in:
2020-01-14 19:07:13 -07:00
parent 5eb389e995
commit 1818349432
3 changed files with 3584 additions and 3548 deletions

View File

@@ -758,11 +758,12 @@ Public Class ClsAcumuladores
End Try
Return Retorno
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
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -373,7 +373,7 @@
</asp:Content>
<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;">
<ContentTemplate>
<div class="portlet-title">
@@ -726,7 +726,7 @@
</ContentTemplate>
</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>
<div id="DivEstatusFac" runat="server" visible="false">
<div class="portlet-title">
@@ -812,10 +812,11 @@
</ContentTemplate>
</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>
<div id="DivTurno" runat="server" style="width:100%;text-align:center;">
Turno: <asp:Label runat="server" ID="LblTurno"></asp:Label>
<div id="DivTurno" runat="server" style="width: 100%; text-align: center;">
Turno:
<asp:Label runat="server" ID="LblTurno"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -1229,7 +1230,6 @@
</div>
<div class="row">
<div class="col-md-6">
<div class="row">
<asp:UpdatePanel ID="UpRemisiones" runat="server" UpdateMode="Conditional" RenderMode="Inline">
@@ -1248,7 +1248,6 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpAntNC" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
@@ -1291,9 +1290,32 @@
</asp:UpdatePanel>
</div>
</div>
<div class="col-md-6 ">
<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">
<table id="TbDescuentosRNC" border="0" rules="none" class="well TextTab" style="float: right;" runat="server" visible="false">
<tr align="right">
@@ -1312,6 +1334,8 @@
</tr>
</table>
</div>
</div>
</div>
<div class="col-md-6">
<table border="0" rules="none" class="well TextTab" style="float: right;">
<tr align="right">
@@ -1511,7 +1535,6 @@
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -3250,7 +3273,7 @@
<td>
<asp:TextBox ID="TxtObsAlmacen" runat="server" Rows="2" TextMode="MultiLine" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
</tr>
<tr align="left" id="TrKilometraje" runat="server" visible ="false">
<tr align="left" id="TrKilometraje" runat="server" visible="false">
<td>Kilometraje&nbsp;
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
</tr>
@@ -6425,8 +6448,8 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
<script type="text/javascript">
@@ -7592,4 +7615,4 @@
}
</script>
</asp:Content>
</asp:Content>

View File

@@ -4294,6 +4294,8 @@ Partial Class Ventas
End If
End If
CargaCodigoUnico()
UpPS.Update()
UpContado.Update()
UpEstatus.Update()
@@ -17349,19 +17351,22 @@ Partial Class Ventas
End Sub
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
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows(0)
If Dr IsNot Nothing Then
If Dr("CvePrecioLista").ToString.ToEntero > 0 Then
CvePreioLista = Dr("CvePrecioLista").ToString.ToEntero
CvePrecioLista = Dr("CvePrecioLista").ToString.ToEntero
End If
End If
End If
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
RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString.ToEntero
@@ -23900,15 +23905,21 @@ Partial Class Ventas
End Sub
#Region "P O L I Z A - V I R T U A L"
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
Dim DtUsados As DataTable = Nothing
Private Sub CargaCodigoUnico()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Rem" Then
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasPolizaVirtual(ObjFactura.CveVenta) Then
DtUsados = ObjAcum.DtResultados.Copy()
If ObjAcum.GetGarantiasPolizaVirtual(Me.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
GvCodigosUnicos.DataSource = ObjAcum.DtResultados
DivCodigosUnicos.Visible = True
End If
ObjAcum.Dispose()
GvCodigosUnicos.DataBind()
End If
End Sub
Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
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
'DATOS DEL CLIENTE
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)
'DATOS DEL PRODUCTO
obj.product_code = Row("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row("SerieLote").ToString() 'se indique el código único de la batería. (SERIE LOTE)
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("FechaAjuste").ToString().ToDateTime()
Dim FechaUsado As DateTime = Row.DataKey("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_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
EnviarPolizaVentaWS(obj)
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al generar la poliza virtual", ex)