
Originally Posted by
user21
Total cost to be automatically calculated and populated by adding the cost filed plus 1.2% tax.
How would I go about doing this on the accounts module?
You need to create a before_save logic hook that calculates the field before saving the record every time.
See the sections on logic hooks in the DEV manual in my signature and if you search on threads started by me I posted a script that can help you create them.
Your hook should do something like this:
PHP Code:
$bean->total_cost_c = $bean->cost_c * 101.2;
M
Bookmarks