The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Editable Invoice –including tax to total Re: Editable Invoice –including tax to total


jfreehill, thank you so much for your post and time in assiting me to resolve my issue. As I was studing you suggestions and reading several articles on google, I decided to re structure the function. Here’s what I have come up with –which thus far is providing the desired outcomes. I’m still trying to work out some other issues. I’ll post final code once completed.

var taxRate = 0.0575;

function update() {
var subtotal = 0;
$('.price').each(function(i) {
price = $(this).html().fromCurrency();
if (!isNaN(price)) subtotal += price;

var tax = ($('#taxbox').click(update)) ? (subtotal * taxRate) : 0;

var total = subtotal + tax;

var due = total - $('#paid').val().fromCurrency();

function update_price() {//This could also be migrated into update
var row = $(this).parents('.item-row');
var price = row.find('.cost').val().fromCurrency() * Number(row.find('.qty').val());
isNaN(price) ? row.find('.price').html("N/A") : row.find('.price').html(price.toCurrency());

function bind() {

Again, I thank you very much for your time and thoughts.