Correcion conversion de dolares a pesos pago proveedores

This commit is contained in:
2021-11-29 16:37:25 -07:00
parent 697c1f67b3
commit fac0b93c29

View File

@@ -567,7 +567,7 @@
} }
function SumaValores() { function SumaValores(aplicaTC) {
var Importe = 0; var Importe = 0;
var Comision = 0.00; var Comision = 0.00;
@@ -581,7 +581,13 @@
if (textBoxes[i].value != '') { if (textBoxes[i].value != '') {
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', ''); idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText; Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
Importe = parseFloat(Importe) + parseFloat(textBoxes[i].value.split(',').join('')); 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(''));
}
Importe = parseFloat(Importe) + importeFactura;
} }
} }
if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) { if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) {
@@ -641,13 +647,15 @@
} }
function CambiaPesosDolares() { function CambiaPesosDolares() {
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2); let ImporteDolares = SumaValores(true);
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
$get('TxtImporte').value = FormatoNumero(ImporteDolares, 2);
$('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2))
if ($("#LbImporteME").length) { if ($("#LbImporteME").length) {
$get('LbImporteME').innerHTML = '$ ' + $get('TxtImporte').value + ' USD'; $get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false),2) + ' USD';
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) * ToDouble($get('TxtTC').value), 2); $get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2);
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2); $get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2);
} }
if ($get('TxtTotal') != null) { if ($get('TxtTotal') != null) {