I need to allocate multiple cost centers dynamically across all accounting transactions (e.g., Sales Invoice, Purchase Invoice, Journal Entry, Payment Entry, Expense Claim).
Requirements:
Users should be able to select multiple cost centers for each entry.
Each cost center should have an editable percentage field.
The system should ensure the total percentage = 100%.
The amount should be auto-calculated based on the percentage.
This should work for all accounting transactions, not just Journal Entries.
Has anyone implemented this before? What’s the best way to achieve this in ERPNext?
I am using the built-in Cost Center Allocation feature in ERPNext, where I can assign cost centers and their percentages. However, I need the flexibility to change the percentage at the time of entry in documents like Sales Invoice, Purchase Invoice, Journal Entry, etc.
Right now, once I set the percentage in Cost Center Allocation, it remains fixed. But I want users to edit the percentage dynamically while creating transactions.
How can I achieve this? Do I need to customize the feature using a child table and scripts, or is there a built-in way to enable this functionality?