Sales Invoice Total Issues

    cur_frm.set_value("grand_total",parseFloat(item.total_amount)+parseFloat(item.total_amount1))
	cur_frm.set_value("total",parseFloat(item.total_amount)+parseFloat(item.total_amount1))
	cur_frm.set_value("rounded_total",parseFloat(item.total_amount)+parseFloat(item.total_amount1))
	cur_frm.set_value("outstanding_amount",parseFloat(item.total_amount)+parseFloat(item.total_amount1))
	//cur_frm.set_value("base_grand_total",parseFloat(item.total_amount)+parseFloat(item.total_amount1))
	//cur_frm.set_value("base_rounded_total",parseFloat(item.total_amount)+parseFloat(item.total_amount1))

We created a custom Doctype called Empties. We then created a custom Sales Invoice Item list in the sales invoice form. After this, we tried to sum up the amounts on both the custom Sales Invoice Item and the built-in sales invoice item to give the grand total, but, it (the grand total) is always reset to the total amount in the original items list on load, save and submit.

How do we make the grand total the sum of the amounts on both lists and ensure that it loads it, saves it and submits it…?