Help with multiple cost centers and warehouses


I am looking for some help with multiple cost-centers and warehouses to mimic multi-branch setup. I have gone through and couple of other posts and created the cost centers and warehouses. However I am not able to select cost-center/warehouse Sales Invoice/Purchase Receipt/Journal Entry. I saw some references to ‘branch’ in some posts, but the ‘branch’ in HR doesn’t seem to do much. Any help with how to use/setup muti cost centre/warehouse properly is really appreciated.



I have added many custom fields in branch doctype, one of which is cost center.

In Sales Invoice/Purchase Receipt/Journal Entry i have added a custom field called branch(link field)

Then i have written script to pick cost center from branch in validate doc event of Sales Invoice/Purchase Receipt/Journal Entry.

Hope this helps.


1 Like

Thanks @Basawaraj_Savalagi, I am not very particular about branch doctype, just need a way of segregating sales/purchase/expenses based on cost center/warehouse. Looks like you are saying it is possible only with custom additions to the Sales Invoice/Purchase Receipt/Journal Entry. That shouldn’t be difficult, but then how does ‘GL Entry’ picks up the cost center from these doctypes? Do we need to customize that as well?
@James_Robertson (sorry for tagging), wondering whether you have some insights on this as I saw couple of responses from you in this area.

In each sales invoice item there is cost center link field…

The cost center entered here is what is choosen when GL entry is posted.

Similarly for every expese there is a cost center.

I did those customizations because i didnt want our end user to enter cost center manually.


Thanks, I was just looking for that. Adding custom field certainly helps the user in assigning it to the right cost center automatically.

Would you mind sharing a sample of this script, mine does not appear to be working



@Basawaraj_Savalagi how to setup cost center inside branch? Please guide me. Thank you

Do share the script used for setting the cost center automatically.

mind sharing code. I’ve done just that, adding cost center in branch. Having trouble linking in invoice item child table.