Mejora en depositos
This commit is contained in:
@@ -256,30 +256,89 @@
|
|||||||
|
|
||||||
function FnSuma(chk, cantidad) {
|
function FnSuma(chk, cantidad) {
|
||||||
var saldoInicial = ToDouble($('#C_lblValorTotal').text());
|
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) {
|
if (chk.checked == false) {
|
||||||
cantidad = cantidad * -1;
|
cantidad = cantidad * -1;
|
||||||
}
|
}
|
||||||
saldoInicial = saldoInicial + cantidad;
|
saldoInicial = saldoInicial + cantidad;
|
||||||
$('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2));
|
$('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2));
|
||||||
$('#C_lblValorTotalSeleccionado').text(FormatoNumero(saldoInicial, 2));
|
$('#C_lblValorTotalSeleccionado').text(FormatoNumero(ValorTotalSeleccionado, 2));
|
||||||
ValorTotalSeleccionado = saldoInicial
|
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) {
|
function txtSuma(txt) {
|
||||||
var comision2 = ToDouble($('#C_TxtComision').val());
|
var comision2 = ToDouble($('#C_TxtComision').val());
|
||||||
var comisionNegativa = 0;
|
var comisionNegativa = 0;
|
||||||
if (comision2 < 0) {
|
if (comision2 < 0) {
|
||||||
comisionNegativa = comision2 * -1
|
comisionNegativa = comision2 * -1;
|
||||||
}
|
}
|
||||||
if (comisionNegativa > ValorTotalSeleccionado) {
|
if (comisionNegativa > ValorTotalSeleccionado) {
|
||||||
$('#C_TxtComision').val(comision)
|
$('#C_TxtComision').val(0)
|
||||||
alert("No es posible poner una comision superior a lo seleccionado")
|
alert("No es posible poner una comision superior a lo seleccionado")
|
||||||
} else {
|
} else {
|
||||||
saldo = ValorTotalSeleccionado + comision2 + descuento;
|
saldo = ValorTotalSeleccionado + comision2 + descuento;
|
||||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||||
comision = ToDouble($('#C_TxtComision').val())
|
comision = ToDouble($('#C_TxtComision').val())
|
||||||
debugger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -288,7 +347,7 @@
|
|||||||
var comision2 = ToDouble($('#C_TxtDescuento').val());
|
var comision2 = ToDouble($('#C_TxtDescuento').val());
|
||||||
var comisionNegativa = 0;
|
var comisionNegativa = 0;
|
||||||
if (comision2 < 0) {
|
if (comision2 < 0) {
|
||||||
comisionNegativa = comision2 * -1
|
comisionNegativa = comision2 * -1;
|
||||||
}
|
}
|
||||||
if (comisionNegativa > ValorTotalSeleccionado) {
|
if (comisionNegativa > ValorTotalSeleccionado) {
|
||||||
$('#C_TxtDescuento').val(descuento)
|
$('#C_TxtDescuento').val(descuento)
|
||||||
@@ -297,7 +356,6 @@
|
|||||||
saldo = ValorTotalSeleccionado + comision2 + comision;
|
saldo = ValorTotalSeleccionado + comision2 + comision;
|
||||||
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
||||||
descuento = ToDouble($('#C_TxtDescuento').val())
|
descuento = ToDouble($('#C_TxtDescuento').val())
|
||||||
debugger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -311,7 +369,7 @@
|
|||||||
$('#divClasificacion').css("display", "block");
|
$('#divClasificacion').css("display", "block");
|
||||||
} else {
|
} else {
|
||||||
$('#DivComision').css("display", "none");
|
$('#DivComision').css("display", "none");
|
||||||
$('#divSubProyecto').css("display", "none");
|
$('#LblSubproyecto').css("display", "none");
|
||||||
$('#divSubProyecto').css("display", "none");
|
$('#divSubProyecto').css("display", "none");
|
||||||
$('#LblClasificacion').css("display", "none");
|
$('#LblClasificacion').css("display", "none");
|
||||||
$('#divClasificacion').css("display", "none");
|
$('#divClasificacion').css("display", "none");
|
||||||
|
|||||||
@@ -253,6 +253,8 @@ Partial Class Bancos_DepositosCaja
|
|||||||
Protected Sub GvFacturas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFacturas.RowDataBound
|
Protected Sub GvFacturas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFacturas.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
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").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 If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user