[solved] 'in words' for custom created Rounded total

Hi

please tell me somebody how to round off nearest 100 on ‘grand total’ in sales order?

sale_sorder.py

in validate function, i have written

self.rounded_total = round(self.net_total,-2)

But it shows the ‘in words’ incorrectly…
I understand that i have to write the custom round and in words function in client side to update it correctly…

in .js file I put the code below.

frappe.ui.form.on("Sales Order Item", "refresh", function(frm, cdt, cdn) 
{
	total=frm.doc.total;		
	cur_frm.set_value("grand_total", Math.round(total*100)/100); 
	frm.refresh();	
})

But this won’t round to nearest 100 and so no correct ‘in words’…

If anyone know how to show custom round function in rounded total and also ‘in words’ kindly help me…

For rounded total use:
https://frappe.github.io/erpnext/current/api/utils/frappe.utils.data#frappe.utils.data.rounded

For total in words use:
https://frappe.github.io/erpnext/current/api/utils/frappe.utils.data#frappe.utils.data.money_in_words

1 Like

@KanchanChauhan

Thank You so much…