$(document).on("keypress", "#DenominacionDetalle tbody tr td input#name", function () { var Cantidad = $(this).val(); var ValorDenominacion = $(this).parents("tr").find("td")[2].innerHTML; var Subtotal = parseFloat(Cantidad * ValorDenominacion); var total = parseFloat(document.getElementById("Total").innerHTML); var filas = document.querySelectorAll("#DenominacionDetalle tbody tr"); console.log('Cantidad') console.log(Cantidad) console.log('Valor') console.log(ValorDenominacion) console.log('SubTotal') console.log(Subtotal) console.log('----------') $(this).parents("tr").find("td")[3].innerHTML = Subtotal; $(this).val($(this).val().replace(/[^0-9.]/g, '')); if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) { event.preventDefault(); } //Grantotal if (!isNaN(document.getElementById("Total").innerHTML)) { document.getElementById("Total").innerHTML = parseFloat(0); } else { var MontoInicial = 0; $("#DenominacionDetalle tbody tr:nth-child(-n+3) ").each(function () { MontoInicial += parseInt($(this).children("td:eq(3)").html()); var totalfinal = document.getElementById("Total").innerHTML = parseFloat(MontoInicial) document.getElementById("MontoInicial").innerHTML = parseFloat(MontoInicial) /////////// console.log('Total') console.log(MontoInicial) }); } });
$(document).on("keypress", "#DenominacionDetalle tbody tr td input#name", function () {
var Cantidad = $(this).val();
var ValorDenominacion = $(this).parents("tr").find("td")[2].innerHTML;
var Subtotal = parseFloat(Cantidad * ValorDenominacion);
var total = parseFloat(document.getElementById("Total").innerHTML);
var filas = document.querySelectorAll("#DenominacionDetalle tbody tr");
console.log('Cantidad')
console.log(Cantidad)
console.log('Valor')
console.log(ValorDenominacion)
console.log('SubTotal')
console.log(Subtotal)
console.log('----------')
$(this).parents("tr").find("td")[3].innerHTML = Subtotal;
$(this).val($(this).val().replace(/[^0-9\.]/g, ''));
if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
event.preventDefault();
}
//Grantotal
if (!isNaN(document.getElementById("Total").innerHTML)) {
document.getElementById("Total").innerHTML = parseFloat(0);
}
else {
var MontoInicial = 0;
$("#DenominacionDetalle tbody tr:nth-child(-n+3) ").each(function () {
MontoInicial += parseInt($(this).children("td:eq(3)").html());
var totalfinal = document.getElementById("Total").innerHTML = parseFloat(MontoInicial)
document.getElementById("MontoInicial").innerHTML = parseFloat(MontoInicial)
///////////
console.log('Total')
console.log(MontoInicial)
});
}
});