- mejora en manejo de TXTTC

This commit is contained in:
2023-10-24 08:45:15 -07:00
parent 4eb757fd31
commit 85cc1bd5fc
2 changed files with 15 additions and 7 deletions

View File

@@ -570,19 +570,21 @@
var chkPesosBancos = $get("ChkPagarPesos"); var chkPesosBancos = $get("ChkPagarPesos");
var chkDolaresBancos = $get("ChkPagarDolares"); var chkDolaresBancos = $get("ChkPagarDolares");
if (t.checked) { if (t.checked) {
txt.value = FormatoNumero(importe, 2); txt.value = FormatoNumero(importe, 2);
} else { } else {
txt.value = ""; txt.value = "";
} }
if (chkPesosBancos) { if (chkPesosBancos && chkPesosBancos.checked) {
CambiaPesosDolares() CambiaPesosDolares()
} else if (chkDolaresBancos) { } else if (chkDolaresBancos && chkDolaresBancos.checked) {
CambiaDolaresPesos() CambiaDolaresPesos()
} }
else {
var Suma = SumaValores();
$get('TxtImporte').value = FormatoNumero(Suma, 2);
}
} }
function SumaValores(aplicaTC) { function SumaValores(aplicaTC) {
@@ -637,6 +639,8 @@
function FnCambia(chk, txt, saldo, op, text, Tipo) { function FnCambia(chk, txt, saldo, op, text, Tipo) {
debugger; debugger;
var chkPesosBancos = $get("ChkPagarPesos");
var chkDolaresBancos = $get("ChkPagarDolares");
if (op == 1) { if (op == 1) {
if (txt.value != '') { if (txt.value != '') {
chk.checked = true; chk.checked = true;
@@ -659,8 +663,12 @@
$get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtOtrosImportes').value * -1)), 2); $get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtOtrosImportes').value * -1)), 2);
} }
CambiaPesosDolares() if (chkPesosBancos && chkPesosBancos.checked) {
CambiaDolaresPesos() CambiaPesosDolares()
} else if (chkDolaresBancos && chkDolaresBancos.checked) {
CambiaDolaresPesos()
}
} }

View File

@@ -1143,7 +1143,6 @@ Partial Class Bancos_ProveedoresAbonar
RegistraScript("CambiaPesosDolares();") RegistraScript("CambiaPesosDolares();")
Else Else
CveMoneda = dr("CveMoneda").ToString.ToEntero CveMoneda = dr("CveMoneda").ToString.ToEntero
If CveMoneda = 1 Then If CveMoneda = 1 Then
RegistraScript("CambiaDolaresPesos();") RegistraScript("CambiaDolaresPesos();")
End If End If
@@ -1357,6 +1356,7 @@ Partial Class Bancos_ProveedoresAbonar
Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs)
If ChkPagarPesos.Checked Then If ChkPagarPesos.Checked Then
DivTC.Visible = True DivTC.Visible = True
DivTCDolares.Visible = False
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)