diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx index d097419c2..6546eea32 100644 --- a/Bancos/ProveedoresAbonar.aspx +++ b/Bancos/ProveedoresAbonar.aspx @@ -368,108 +368,131 @@ - - - - - - - - - - - Factura - - - - - <%----%> - - Aplica NC - - - - - - - - - - - Descripción - -   - - - - - Fecha Compra - - - - - - Vencimiento - - - - - - Días Vencidos - -   - - - - Monto Compra - -   - - - - Abonado - -   - - - - Saldo - -   - - - - Abonar - - - - <%-- --%> - - - - Comisión - - - - - - - - Auxiliar - - - - - - - - - + + + + <%-- 0 --%> + + + + + + + <%-- 1 --%> + + Factura + + + + + <%-- 2 --%> + + Aplica NC + + + + + <%-- 3 --%> + + + + + + <%-- 4 --%> + + Descripción + +   + + + + + <%-- 5 --%> + + Fecha Compra + + + + + <%-- 6 --%> + + Vencimiento + + + + + <%-- 7 --%> + + Días Vencidos + +   + + + + <%-- 8 --%> + + Monto Compra + +   + + + + <%-- 9 --%> + + Abonado + +   + + + + <%-- 10 --%> + + Saldo + +   + + + + <%-- 11 --%> + + Aplica
Desc.
+ + + + + +
+ <%-- 12 --%> + + Abonar + + + + + + <%-- 13 --%> + + Comisión + + + + + + + <%-- 14 --%> + + Auxiliar + + + + +
+ +
+ +
@@ -700,5 +723,58 @@ } } + function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar) { + + let idTxtDescuento = TxtDescuento.id + let idTxtAbonar = TxtAbonar.id + + let descuentoValue = $("#" + idTxtDescuento).val().trim(); + let descuentoParts = descuentoValue.split('+'); + let abonarConDescuento = 0.0; + + + if (descuentoParts.length === 1) { + + + if (isNaN(parseFloat(descuentoParts[0])) || descuentoParts[0] == "0") { + $("#" + idTxtAbonar).val(saldo.toFixed(2)); + + } else { + let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); + abonarConDescuento = saldo - descuento; + $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2),2)); + } + + } else if (descuentoParts.length === 2) { + + if (isNaN(parseFloat(descuentoParts[0]))) { + $("#" + idTxtAbonar).val(""); + return; + } + + let descuento1 = saldo * (parseFloat(descuentoParts[0]) / 100); + + if (isNaN(parseFloat(descuentoParts[1]))) { + + let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); + abonarConDescuento = saldo - descuento; + $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2), 2)); + + return; + } + + let descuento = saldo * (parseFloat(descuentoParts[0]) / 100); + abonarConDescuento = saldo - descuento; + + let abonarConDescuento2 = abonarConDescuento - (abonarConDescuento * (parseFloat(descuentoParts[1]) / 100)); + + $("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento2.toFixed(2), 2)); + + + } else { + $("#" + idTxtAbonar).val(""); + } + } + diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index e4442af47..b6fb5f55b 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -315,6 +315,10 @@ Partial Class Bancos_ProveedoresAbonar LnkExcelSolicitud.Visible = True End If + If UsuarioActual.CveRol = 1 Then + GvCxP.Columns(11).Visible = True + End If + End If End Sub @@ -533,6 +537,10 @@ Partial Class Bancos_ProveedoresAbonar e.Row.FCCheckBox("Chk").Enabled = False End If + e.Row.FCTextBox("TxtDescuento").Attributes.Add("onkeyup", $"calculaDescuentoEscalonado({e.Row.DBCampo("Saldo")},{e.Row.FCTextBox("TxtDescuento").ClientID},{e.Row.FCTextBox("TxtAbonar").ClientID})") + Else + e.Row.FCTextBox("TxtDescuento").Visible = False + End If End If End Sub @@ -1354,12 +1362,12 @@ Partial Class Bancos_ProveedoresAbonar DdlProsepago.Visible = False TxtOtrosImportes.Visible = True TxtTotal.Visible = True - GvCxP.Columns(12).Visible = True + GvCxP.Columns(13).Visible = True Else DdlProsepago.Visible = False TxtOtrosImportes.Visible = False TxtTotal.Visible = False - GvCxP.Columns(12).Visible = False + GvCxP.Columns(13).Visible = False TxtOtrosImportes.Text = "" TxtTotal.Text = "" RegistraScript("$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);") diff --git a/Empresas/119/Formatos/RepIVAAcreditable.rpt b/Empresas/119/Formatos/RepIVAAcreditable.rpt index b0bcd8f9c..6bd24cbe1 100644 Binary files a/Empresas/119/Formatos/RepIVAAcreditable.rpt and b/Empresas/119/Formatos/RepIVAAcreditable.rpt differ