0 - Conta: Aplicación de pago a proveedores en pesos y dólares con una misma cuenta, ej. SCHNEIDER ELECTRIC MEXICO
This commit is contained in:
@@ -341,9 +341,10 @@
|
||||
<asp:Button ID="BtnIEGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
|
||||
<asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
|
||||
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
|
||||
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
|
||||
<asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup ="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" />
|
||||
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
|
||||
<asp:CheckBox Text="Descuento Masivo" ID="chkaplicaDescuentoMasivo" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuentoMasivo_CheckedChanged" AutoPostBack="true" Visible="false" />
|
||||
<asp:TextBox runat="server" ID="TxtDescuenoMasivo" ClientIDMode="Static" onkeyup="DescuenoMasivo(this)" Visible="false" Width="60px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuenoMasivo" FilterType="Custom" ValidChars="1234567890+" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -477,6 +478,15 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- 14 --%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Moneda</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
|
||||
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<%-- 15 --%>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Auxiliar</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
@@ -601,7 +611,6 @@
|
||||
var Facturas = '';
|
||||
|
||||
function FnSuma(t, txt, importe) {
|
||||
debugger;
|
||||
var chkPesosBancos = $get("ChkPagarPesos");
|
||||
var chkDolaresBancos = $get("ChkPagarDolares");
|
||||
|
||||
@@ -612,9 +621,9 @@
|
||||
}
|
||||
|
||||
if (chkPesosBancos && chkPesosBancos.checked) {
|
||||
CambiaPesosDolares()
|
||||
CambiaPesosDolares();
|
||||
} else if (chkDolaresBancos && chkDolaresBancos.checked) {
|
||||
CambiaDolaresPesos()
|
||||
CambiaDolaresPesos();
|
||||
}
|
||||
else {
|
||||
var Suma = SumaValores();
|
||||
@@ -622,7 +631,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function SumaValores(aplicaTC) {
|
||||
function SumaValores(aplicaTC, cveMonedaPago = 0) {
|
||||
|
||||
var Importe = 0;
|
||||
var Comision = 0.00;
|
||||
@@ -637,11 +646,43 @@
|
||||
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
|
||||
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
|
||||
let importeFactura = 0;
|
||||
if (aplicaTC && $get('TxtTC') != null) {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
} else {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
|
||||
if (cveMonedaPago == 0) {
|
||||
if (aplicaTC && $get('TxtTC') != null) {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
} else {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
} else {
|
||||
let cveMonedaCompra = textBoxes[i].getAttribute("cvemoneda");
|
||||
|
||||
switch (cveMonedaPago) {
|
||||
case 1: //PAGO CON PESOS
|
||||
|
||||
//SI SON DOLARES MULTIPLICAR POR TC
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
//MISMA MONEDA DEBE SOLO SUMAR
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
}
|
||||
|
||||
break;
|
||||
case 2: //PAGO CON DOLARES
|
||||
|
||||
//MISMA MONEDA DEBE SOLO SUMAR
|
||||
if (cveMonedaCompra == '2') {
|
||||
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||
//SI SON PESOS DIVIDIR ENTRE EL TC
|
||||
} else if (cveMonedaCompra == '1') {
|
||||
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) / parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Importe = parseFloat(Importe) + importeFactura;
|
||||
}
|
||||
}
|
||||
@@ -699,53 +740,91 @@
|
||||
}
|
||||
|
||||
if (chkPesosBancos && chkPesosBancos.checked) {
|
||||
CambiaPesosDolares()
|
||||
CambiaPesosDolares();
|
||||
} else if (chkDolaresBancos && chkDolaresBancos.checked) {
|
||||
CambiaDolaresPesos()
|
||||
CambiaDolaresPesos();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function CambiaPesosDolares() {
|
||||
let ImporteDolares = SumaValores(true);
|
||||
if ('<%= Me.FiltrarCuentas.ToString() %>' == '1') {
|
||||
let ImporteDolares = SumaValores(true);
|
||||
|
||||
$get('TxtImporte').value = FormatoNumero(ImporteDolares, 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2))
|
||||
$get('TxtImporte').value = FormatoNumero(ImporteDolares, 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2))
|
||||
|
||||
if ($("#LbImporteME").length) {
|
||||
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false), 2) + ' USD';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||
if ($("#LbImporteME").length) {
|
||||
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false), 2) + ' USD';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(parseFloat($get('TxtImporte').value.replace(',', '')) + parseFloat($get('TxtOtrosImportes').value.replace(',', '') * -1), 2);
|
||||
}
|
||||
|
||||
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
|
||||
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
|
||||
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
|
||||
} else {
|
||||
SumaDolaresPesos(1);
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(parseFloat($get('TxtImporte').value.replace(',', '')) + parseFloat($get('TxtOtrosImportes').value.replace(',', '') * -1), 2);
|
||||
}
|
||||
|
||||
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
|
||||
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
|
||||
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
|
||||
}
|
||||
|
||||
function CambiaDolaresPesos() {
|
||||
debugger;
|
||||
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
|
||||
if ('<%= Me.FiltrarCuentas.ToString() %>' == '1') {
|
||||
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
|
||||
|
||||
|
||||
if ($("#LbImporteMN").length) {
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) / ToDouble($get('TxtTC').value), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTC').value), 2);
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) + (ToDouble($get('TxtOtrosImportes').value.replace(',', '') * -1)), 2);
|
||||
}
|
||||
|
||||
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
|
||||
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
|
||||
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
|
||||
} else {
|
||||
SumaDolaresPesos(2);
|
||||
}
|
||||
}
|
||||
|
||||
function SumaDolaresPesos(cveMonedaPago) {
|
||||
|
||||
let ImporteSuma = parseFloat(SumaValores(false, cveMonedaPago));
|
||||
|
||||
$get('TxtImporte').value = FormatoNumero(ImporteSuma, 2);
|
||||
$('#LtlTotalMXN').text(FormatoNumero(ImporteSuma, 2))
|
||||
|
||||
debugger;
|
||||
if ($("#LbImporteMN").length) {
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(SumaValores(), 2) + ' MXN';
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) / ToDouble($get('TxtTC').value), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) / ToDouble($get('TxtTC').value), 2);
|
||||
|
||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')), 2);
|
||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value), 2);
|
||||
|
||||
switch (cveMonedaPago) {
|
||||
case 1:
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(ImporteSuma, 2) + ' MXN';
|
||||
break;
|
||||
case 2:
|
||||
$get('LbImporteMN').innerHTML = '$ ' + FormatoNumero(ImporteSuma, 2) + ' USD';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($get('TxtTotal') != null) {
|
||||
$get('TxtTotal').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) + (ToDouble($get('TxtOtrosImportes').value.replace(',', '') * -1)), 2);
|
||||
}
|
||||
|
||||
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(SumaValores(), 2);
|
||||
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(SumaValores() - ((SumaValores() / 1.16)), 2);
|
||||
if ($get('LblImporteTotal')) $get('LblImporteTotal').innerHTML = FormatoNumero(ImporteSuma, 2);
|
||||
if ($get('LblIVA')) $get('LblIVA').innerHTML = FormatoNumero(ImporteSuma - ((ImporteSuma / 1.16)), 2);
|
||||
if ($get('ChkAbonoCuenta')) $get('ChkAbonoCuenta').checked = (parseFloat($get('TxtImporte').value.replace(/,/g, '')) > 2000);
|
||||
|
||||
}
|
||||
@@ -790,7 +869,7 @@
|
||||
}
|
||||
|
||||
|
||||
function DescuenoMasivo(txt) {
|
||||
function DescuenoMasivo(txt) {
|
||||
$(".selDescuento").val(txt.value);
|
||||
$(".selDescuento").trigger("keyup");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user