Mejora en depositos

This commit is contained in:
HECTOR RODRIGUEZ
2021-04-29 20:53:58 -07:00
parent c500323f51
commit c3747e4b64
2 changed files with 69 additions and 9 deletions

View File

@@ -256,30 +256,89 @@
function FnSuma(chk, cantidad) {
var saldoInicial = ToDouble($('#C_lblValorTotal').text());
var ValorTotalSeleccionado2 = 0;
$('#C_GvFacturas input[type=checkbox]').each(
function () {
if (this.checked) {
ValorTotalSeleccionado2 = ValorTotalSeleccionado2 + ToDouble(FormatoNumero($(this).val(), 2));
}
}
);
ValorTotalSeleccionado = ValorTotalSeleccionado2;
if (chk.checked == false) {
cantidad = cantidad * -1;
}
saldoInicial = saldoInicial + cantidad;
$('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2));
$('#C_lblValorTotalSeleccionado').text(FormatoNumero(saldoInicial, 2));
ValorTotalSeleccionado = saldoInicial
$('#C_lblValorTotalSeleccionado').text(FormatoNumero(ValorTotalSeleccionado, 2));
debugger;
if ($('#C_ChkFaltante').attr('checked')) {
var txtcomision = ToDouble($('#C_TxtComision').val());
if (txtcomision != 0) {
var comisionNegativa = 0;
if (txtcomision < 0) {
comisionNegativa = txtcomision * -1;
}
if (comisionNegativa > saldo) {
$('#C_TxtComision').val(0);
comision = 0;
descuento = 0;
txtcomision = 0;
alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
debugger;
} else {
//debugger;
}
}
}
if ($('#C_ChkDescuento').attr('checked')) {
var txtdescuento = ToDouble($('#C_TxtDescuento').val());
if (txtdescuento != 0) {
var DescuentoNegativa = 0;
if (txtdescuento < 0) {
DescuentoNegativa = txtdescuento * -1;
}
if (DescuentoNegativa > saldo) {
$('#C_TxtDescuento').val(0);
comision = 0;
descuento = 0;
txtdescuento = 0;
alert("No es posible poner un descuento superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
debugger;
} else {
//saldo = ValorTotalSeleccionado + txtdescuento + comision;
//$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
//descuento = ToDouble($('#C_TxtDescuento').val())
//debugger;
}
}
}
}
function txtSuma(txt) {
var comision2 = ToDouble($('#C_TxtComision').val());
var comisionNegativa = 0;
if (comision2 < 0) {
comisionNegativa = comision2 * -1
comisionNegativa = comision2 * -1;
}
if (comisionNegativa > ValorTotalSeleccionado) {
$('#C_TxtComision').val(comision)
$('#C_TxtComision').val(0)
alert("No es posible poner una comision superior a lo seleccionado")
} else {
saldo = ValorTotalSeleccionado + comision2 + descuento;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
comision = ToDouble($('#C_TxtComision').val())
debugger;
}
}
@@ -288,7 +347,7 @@
var comision2 = ToDouble($('#C_TxtDescuento').val());
var comisionNegativa = 0;
if (comision2 < 0) {
comisionNegativa = comision2 * -1
comisionNegativa = comision2 * -1;
}
if (comisionNegativa > ValorTotalSeleccionado) {
$('#C_TxtDescuento').val(descuento)
@@ -297,7 +356,6 @@
saldo = ValorTotalSeleccionado + comision2 + comision;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
descuento = ToDouble($('#C_TxtDescuento').val())
debugger;
}
}
@@ -311,7 +369,7 @@
$('#divClasificacion').css("display", "block");
} else {
$('#DivComision').css("display", "none");
$('#divSubProyecto').css("display", "none");
$('#LblSubproyecto').css("display", "none");
$('#divSubProyecto').css("display", "none");
$('#LblClasificacion').css("display", "none");
$('#divClasificacion').css("display", "none");

View File

@@ -253,6 +253,8 @@ Partial Class Bancos_DepositosCaja
Protected Sub GvFacturas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFacturas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkFactura").Attributes.Add("onclick", String.Format("FnSuma(this,{0});", e.Row.DBCampo("Importe")))
e.Row.FCCheckBox("ChkFactura").InputAttributes.Add("Value", e.Row.DBCampo("Importe"))
End If
End Sub