-- mejora aplicación pagos otras moendas

This commit is contained in:
2023-05-05 07:29:39 -07:00
parent b12fde09bd
commit e70366e1f1
2 changed files with 12 additions and 8 deletions

View File

@@ -5903,9 +5903,9 @@
if (t.checked)
{
if (DifSaldo > importevalue) {
txt.value = ToDouble(importevalue*TCC).toFixed(2);
txt.value = toFixed(ToDouble(importevalue*TCC),2);
} else {
txt.value = ToDouble(DifSaldo*TCC).toFixed(2);
txt.value = toFixed(ToDouble(DifSaldo*TCC),2);
}
} else {
txt.value = "";
@@ -5914,7 +5914,7 @@
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
}
@@ -5948,7 +5948,7 @@
txtvalue = ToDouble(txtvalue * TCAnticipo);
}
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
var SaldoCompra = toFixed(TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue),2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue;
//minimo entre saldocompra y el saldoanticipo
@@ -5971,6 +5971,11 @@
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2));
}
//funcion para truncar en lugar de redondear
function toFixed(num, fixed) {
var re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
return num.toString().match(re)[0];
}
function FnSumaValoresAnt() {
var totalPoints = 0;

View File

@@ -8586,9 +8586,8 @@ Partial Class Compras_Compras
Pago.TCPago = TipoCambioAnt
Pago.CveProveedor = gvr.DataKey("CveProveedor").ToEntero
If CompraActual.CveMoneda = 1 AndAlso Pago.CveMonedaPago = 2 Then
CompraActual.TC = Pago.TCPago
End If
If ChkPagarConPesos.Checked Then Pago.TCCambioMoneda = 1 / TipoCambioAnt
If ChkPagarConDolares.Checked Then Pago.TCCambioMoneda = TipoCambioAnt
Select Case gvr.DataKey("TipoDocto")
Case "NC", "DEV"
@@ -10061,7 +10060,7 @@ Partial Class Compras_Compras
e.Row.DBCampo("Saldo"),
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion),
e.Row.DBCampo("CveMoneda"),
tTCFecha,
e.Row.DBCampo("TCCompra").ToDouble,
DdlMoneda.SelectedValue,
IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text))) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO