Hi every one! Needed a help on this custom Script! It calculates the remaining amount against each payment term on a new sales order generation.
However when I make a Payment Entry and Tag it against a Payment Term, now on Viewing the Sales Order, the payment shows correctly against that Payment Term but Remaining Installment Amount won’t update.
Please guide, if I should write a script to recalculate Balance Installment Amount on each new Payment Entry against that sales order!
frappe.ui.form.on(‘Payment Schedule’, ‘payment_amount’,
function(frm, doctype, name) {
var row = locals[doctype][name];
frappe.model.set_value(doctype, name, “remaining_installment_amount”, flt(row.payment_amount) - flt(row.paid_amount));
});
frappe.ui.form.on(‘Payment Schedule’, ‘paid_amount’,
function(frm, doctype, name) {
var row = locals[doctype][name];
frappe.model.set_value(doctype, name, “remaining_installment_amount”, flt(row.payment_amount) - flt(row.paid_amount));
});