By Cloud GST on October 19, 2023
Beginner
frappe.ui.form.on('Sales Invoice', {
refresh(frm) {
cur_frm.cscript.customer = function(doc) {
return frappe.call({
 method: "erpnext.accounts.utils.get_balance_on",
 args: {date: frappe.datetime.nowdate(), party_type: 'Customer', party: doc.customer},
 callback: function(r) {
  doc.cust_os = format_currency(r.message, erpnext.get_currency(doc.company));
  refresh_field('cust_os', 'accounts');  //cust_os is a custom field
 }
});
}}})


More articles on Help



More articles on Help
Comments

No comments yet.

Add a comment
Ctrl+Enter to add comment