Sumatory between base_total and tax_amount

I’m trying to add a sumatory between base_total and tax_amount, but I do not want the sum to be affected by discount_amount
That sum, I want to put in a custom print format.
Can somebody help me?

Here a little reference.
In this case the Sub total is only the sumatory of Sums and VAT 13%


Can you share your code that you have tried?

I have something like this, but it does not work.

frappe.ui.form.on(“Sales Invoice”, “new_total”, function(frm, cdt, cdn) {
new_total = 0;

$.each(frm.doc.items || [], function(i, d) {
new_total = base_total + tax_amount;
frm.set_value("new_total", new_total);

Do you have any idea?