Desarrollo poliza virtual
This commit is contained in:
@@ -1003,8 +1003,8 @@
|
|||||||
</table>
|
</table>
|
||||||
<%--</asp:Panel>--%>
|
<%--</asp:Panel>--%>
|
||||||
|
|
||||||
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
||||||
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle"
|
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle"
|
||||||
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
||||||
<Columns>
|
<Columns>
|
||||||
<%--0--%>
|
<%--0--%>
|
||||||
@@ -1287,12 +1287,12 @@
|
|||||||
<div class="col-md-6 ">
|
<div class="col-md-6 ">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<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">
|
||||||
<td style="border: 1px none white"><b>Descuentos. RNC.:</b></td>
|
<td style="border: 1px none white"><b>Descuentos. RNC.:</b></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:Label ID="LblDescuentosRNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
<asp:Label ID="LblDescuentosRNC" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00" Width="78px"></asp:Label></td>
|
||||||
<td align="right"> <asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
|
<td align="right"> <asp:LinkButton ID="LnkDescuentosRNC" runat="server" OnClick="LnkDescuentosRNC_Click" Text="<i class='fa fa-tag fa-lg font-green'></i>" AlternateText="Aplicacion de RNC" Style="cursor: pointer;" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr align="right">
|
<tr align="right">
|
||||||
@@ -5873,8 +5873,7 @@
|
|||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<asp:Button ID = "BtnModalAplicarRemisionesNC" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" data-toggle="modal" data-target="#ModalAplicarRemisionesNC"/>
|
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
</div>
|
</div>
|
||||||
@@ -6354,7 +6353,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<%--APLICAR REMISIONES DE NC--%>
|
<%--APLICAR REMISIONES DE NC--%>
|
||||||
<div id="ModalAplicarDescuentoNC" class="modal ADS fade" role="dialog">
|
<div id="ModalAplicarDescuentoNC" class="modal ADS fade" role="dialog">
|
||||||
<asp:UpdatePanel ID="UpDescNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDescNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
@@ -7544,28 +7543,34 @@
|
|||||||
$('#divAgregarCliente').modal('hide');
|
$('#divAgregarCliente').modal('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
function CompararNC() {
|
var ValidarRNC = false;
|
||||||
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
|
function AplicarValidarRNC(Valor)
|
||||||
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
|
{
|
||||||
|
ValidarRNC = Valor;
|
||||||
if (TotalRem == TotalNC) {
|
|
||||||
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
|
|
||||||
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
|
|
||||||
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
|
|
||||||
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000";
|
|
||||||
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000";
|
|
||||||
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000";
|
|
||||||
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
function CompararNC() {
|
||||||
|
if (ValidarRNC) {
|
||||||
|
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
|
||||||
|
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
|
||||||
|
|
||||||
function CerrarModalRemNC() {
|
if (TotalRem == TotalNC) {
|
||||||
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
|
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
|
||||||
|
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
|
||||||
|
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
|
||||||
|
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #ff0000";
|
||||||
|
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #ff0000";
|
||||||
|
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "#ff0000";
|
||||||
|
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "#ff0000";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CerrarModalRemNC() {
|
||||||
|
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
|
||||||
|
AplicarValidarRNC(true);
|
||||||
CompararNC();
|
CompararNC();
|
||||||
}
|
}
|
||||||
$('#ModalAplicarRemisionesNC').modal('hide');
|
$('#ModalAplicarRemisionesNC').modal('hide');
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Imports System.Xml
|
|||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
Imports System.Security.Cryptography.X509Certificates
|
Imports System.Security.Cryptography.X509Certificates
|
||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Net.Http
|
||||||
|
|
||||||
Partial Class Ventas
|
Partial Class Ventas
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -6731,6 +6732,12 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
'ENVIAR POLIZA VIRTUAL
|
||||||
|
If ErrorList.Count = 0 Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
|
||||||
|
GeneraPolizaVentaWS(ObjFactura)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 Then
|
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 Then
|
||||||
|
|
||||||
@@ -7597,7 +7604,6 @@ Partial Class Ventas
|
|||||||
'ObjFactura.AnticipoPosicion = DdlAmortizacionConceptos.SelectedValue.ToEntero
|
'ObjFactura.AnticipoPosicion = DdlAmortizacionConceptos.SelectedValue.ToEntero
|
||||||
'ObjFactura.AnticipoEnSubTotal = If(ChkAnticipoEnSubTotal.Checked, True, False)
|
'ObjFactura.AnticipoEnSubTotal = If(ChkAnticipoEnSubTotal.Checked, True, False)
|
||||||
'ObjFactura.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero
|
'ObjFactura.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero
|
||||||
'ObjFactura.CveTipoAmortizacionAnticipo = DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero
|
|
||||||
|
|
||||||
|
|
||||||
'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
|
'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
|
||||||
@@ -20928,9 +20934,11 @@ Partial Class Ventas
|
|||||||
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(344) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(344) = "1" Then
|
||||||
If TxtImportesRemisionesNC.Text.ToDecimal() <> TxtNCImporte.Text.ToDecimal() Then
|
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||||
Alert($"Los importes no coinciden", TipoMensaje.MsgAdvertencia)
|
If TxtImportesRemisionesNC.Text.ToDecimal() <> TxtNCImporte.Text.ToDecimal() Then
|
||||||
Exit Sub
|
Alert($"Los importes no coinciden", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
DdlTipoComprobante.SelectedValue = "Egs"
|
DdlTipoComprobante.SelectedValue = "Egs"
|
||||||
@@ -23802,6 +23810,102 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs)
|
||||||
CargaRNC()
|
CargaRNC()
|
||||||
RegistraScript("$('#ModalAplicarRemisionesNC').modal()")
|
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Function GeneraPolizaVentaWS(ObjFactura As Modelos.Factura) As Boolean
|
||||||
|
Dim obj As New Modelos.MPolizaVentaWS
|
||||||
|
'DATOS DEL CLIENTE
|
||||||
|
obj.customer_name = ObjFactura.Cliente.Nombre
|
||||||
|
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
|
||||||
|
|
||||||
|
'DATOS DE VENTA
|
||||||
|
obj.sale_date = Now
|
||||||
|
obj.sale_paidby = "01"
|
||||||
|
obj.sale_type = "01" 'PISO
|
||||||
|
obj.sale_type_service = "01" 'PARTICULAR
|
||||||
|
obj.sale_total = ObjFactura.Total
|
||||||
|
obj.sale_discount = ObjFactura.SubTotal
|
||||||
|
obj.sale_id = ObjFactura.CveVenta.ToString()
|
||||||
|
|
||||||
|
'DATOS DEL PRODUCTO
|
||||||
|
obj.product_code = "174925"
|
||||||
|
obj.product_unique_code = "65047187"
|
||||||
|
obj.product_sale_type = "02" 'AJUSTE
|
||||||
|
|
||||||
|
'DATOS DE USADO
|
||||||
|
obj.used_product = True
|
||||||
|
obj.used_brand = "01"
|
||||||
|
obj.used_bci = "25"
|
||||||
|
obj.used_month = 1
|
||||||
|
obj.used_year = 2015
|
||||||
|
obj.used_sale_date = ObjFactura.Fecha
|
||||||
|
|
||||||
|
Return False
|
||||||
|
'EnviarPolizaVentaWS(obj)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Protected Sub EnviarPolizaVentaWS(obj As Modelos.MPolizaVentaWS)
|
||||||
|
Dim Retorno As String = "[]"
|
||||||
|
|
||||||
|
Dim User As String = "cslth.2809@jcilink.com"
|
||||||
|
Dim Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076"
|
||||||
|
|
||||||
|
Try
|
||||||
|
Using wc As New HttpClient()
|
||||||
|
Dim Url = New Uri("http://polizavirtual.com.mx/webservice/api/Venta")
|
||||||
|
|
||||||
|
Dim Parametros = New List(Of KeyValuePair(Of String, String))
|
||||||
|
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("User", User))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("password", Password))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_name", obj.customer_name))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", obj.customer_last_name1))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", obj.customer_last_name1))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", obj.customer_birthday.ToString("yyyy-MM-dd HH:mm:ss")))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", obj.customer_phone))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_email", obj.customer_email))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", obj.customer_gender))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", obj.customer_advertising.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_date", obj.sale_date.ToString("yyyy-MM-dd HH:mm:ss")))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", obj.sale_paidby))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_type", obj.sale_type))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", obj.sale_type_service))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("product_code", obj.product_code))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", obj.product_unique_code))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", obj.product_sale_type))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_total", obj.sale_total.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_product", obj.used_product.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_brand", obj.used_brand))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_bci", obj.used_bci))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_month", obj.used_month.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_year", obj.used_year.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", obj.used_sale_date.ToString("yyyy-MM-dd HH:mm:ss")))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", obj.customer_car_brand.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", obj.customer_car_model.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", obj.customer_car_year.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", obj.sale_discount.ToString()))
|
||||||
|
Parametros.Add(New KeyValuePair(Of String, String)("sale_id", obj.sale_id.ToString()))
|
||||||
|
|
||||||
|
Dim content As New FormUrlEncodedContent(Parametros)
|
||||||
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
|
|
||||||
|
Retorno = response.Content.ReadAsStringAsync().Result
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
ex.GuardaLog(ex.Message)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
Reference in New Issue
Block a user