For instance, if the user types the amount of an item, including the rate and VAT, we need the system to automatically calculate rate and VAT using the quantity and the amount.
How do we do this?
rmeyer
February 25, 2020, 4:33pm
2
// Copyright (c) 2019, Alyf and contributors
// For license information, please see license.txt
frappe.ui.form.on('Dunning', {
refresh: function (frm) {
if (frm.is_new()) {
frm.trigger("calculate_overdue_days");
frm.set_value("posting_date", frappe.datetime.nowdate());
}
},
due_date: function (frm) {
frm.trigger("calculate_overdue_days");
},
posting_date: function (frm) {
frm.trigger("calculate_overdue_days");
},
interest_rate: function (frm) {
frm.trigger("calculate_interest");
},
outstanding_amount: function (frm) {
This file has been truncated. show original
Maybe this can serve as inspiration. Plenty of values get calculated here.
1 Like
@rmeyer
Your comment, and this page helped. Thanks a lot!
1 Like