How to add multiple cost centers with editable percentage in all accounting entries?

Hello,

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?

Thanks in advance!

ERPNext support this feature. Search “Cost Center Allocation”. Name it and assign percentages. Add custom link field to all the documents.

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?

Any guidance would be appreciated. Thank you!

Unfortunately there is no built-in way to achieve this functionality.