Sales Invoice Total Issues


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…?