bhima
bhima copied to clipboard
Implement automatic updating of cost centers in accounts
The only way to update the cost centers for all accounts is to call the 'Update Accounts' function in the Cost Centers registry menu. We should create a global SQL zUpdateAccountCostCenters() function that can be called any time we
- change account reference definitions
- change which account references any cost center uses
- create accounts
so that the cost centers associated with each account are always kept up to date. Once this is done, the 'Update Accounts' function the Cost Centers registry to be retired.
Note that the 'Update Accounts' function uses the updateAccounts() javascript function in server/controllers/finance/cost_centers.js. This can be used as a model to create the desired SQL function.
Note that this is also hinted at in closed Issue 5983.