I want to override calculation of amount field (purchase order item, etc)
Default calculation as I know is amount = rate * qty
Is it possible to add a custom field and use that as additional variable for calculating amount. For example, I add handling field and the amount is calculated using rate * qty + handling.
Other answer tells to use Doc Events, but the posting date is a bit old (2016). If I must use Doc Events hook, do I still need to recalculate other fields (taxes, grand total, etc) ?
On public/js/controller/taxes_and_totals.js, there is a calculate_item_values function that calculates rate*qty. You can override it (via custom script).
Hello, brother this link is not working now… I am beginner in erpnext
will you please help to solve the similar issue I am facing …
my scenario is that I want to calculate
amount = rate * stock_qty
in sales order as well as purchase order …