Skip to content

Instantly share code, notes, and snippets.

@danielvlopes
Forked from jeffrydegrande/test.js
Created September 30, 2010 22:28
Show Gist options
  • Save danielvlopes/605442 to your computer and use it in GitHub Desktop.
Save danielvlopes/605442 to your computer and use it in GitHub Desktop.
$(".grid input:checked").each(function(e){
var isPending = $(this).parents("tr:first").hasClass("pending");
var value = currencyToFloat( tr.children(".value").html() );
if (isDebit(value)) {
adjustDebit(value);
} else if (isCredit(value)) {
adjustCredit(value);
}
});
function adjustDebit(value) {
if (isPending) {
pendingDebits += value;
} else {
debits += value;
}
}
function adjustCredit(value) {
if (isPending) {
pendingCredits += value;
} else {
credits += value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment