Hi @msiam,
Please apply custom/client script.
frappe.ui.form.on('Sales Invoice', {
validate: function(frm) {
ttl_itms_dicnt = 0;
$.each(frm.doc.items, function(i, d) {
ttl_itms_dicnt += flt(d.discount_amount);
});
frm.doc.total_items_discount = ttl_itms_dicnt;
}
});
Please check your field name and set it according.
Then reload and check it.
Thank You!