Cost centers are used in book keeping in order to, for example, be able to divide costs per department or per store location (read more at http://www.accountingcoach.com/blog/what-is-a-cost-center). Having support for that would be very useful.

I'm not entirely sure how this would work but I think the best way would be to add a new entity type, "Cost centre", that can reference (or is referenced from) Account entries. That way each entry on a transaction could be connected to a specific cost centre. Referencing a Ledger Transaction might work as well though depending on how precise the data has to be.

CommentFileSizeAuthor
#5 ledger-cost-centers-2369413-5.patch2.24 KBAdamGerthel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AdamGerthel’s picture

Issue summary: View changes
m.stenta’s picture

Status: Active » Closed (won't fix)

Cool idea! I think that feature would be very useful for some.

Ultimately, it should probably be a separate contrib module, though (perhaps ledger_cost_center, or even just cost_center). I would like to keep the focus of the Ledger project pretty simple: mainly just double-entry bookkeeping. I'm going to mark this issue as "Closed (won't fix)", but it can still be a good place to discuss the cost center feature, until a new project is created.

AdamGerthel’s picture

Agreed, it's not necessarily a "core" book keeping feature. Another thing to add would be Project accounting (http://en.wikipedia.org/wiki/Project_accounting) which is useful for campaigns etc, but isn't really core either.

Erik.Johansson’s picture

A module has been created to extend the Ledger module with the functionality AdamGerthel is asking for. The module is only in sandbox and needs some more work before it can reach a stable release.

https://www.drupal.org/sandbox/oddhill/ledger_cost_center

AdamGerthel’s picture

I've attached a patch containing a few changes to Ledger Account Entry module that were necessary due to #1514940: Fieldable Account Entries. It adds Ledger Cost Center integration to the ledger module. The changes should not be commited as is, because it's basically just a hack at the moment. We need to do it the proper way. Obviously the table for example needs to be solved more elegantly.

@m.stenta do you have ideas on how you'd like to see this solved?

AdamGerthel’s picture

Status: Closed (won't fix) » Active
m.stenta’s picture

I wonder if there's a better way to do this? Instead of defining the cost center for every individual account entry, perhaps you could assign it on an Account-level basis, via a Field on Account entities. And then any account entry that occurs in that account will be assigned to that Cost Center. It would require setting up multiple accounts (one for each cost center), which may not match the expectations of the Swedish system, though. But from a data-architecture perspective it seems that this would be an easier way to accomplish the goal, right?

AdamGerthel’s picture

Well, I agree that it might feel a bit too much to add yet another entity to Ledger, but it really isn't an account, and even though it would be somewhat possible to use that entity type for the purpose it would create poor structure (maybe not database wise but logically/information-wise). Cost centers are not equal to accounts, so even though they behave similarly, they are used differently. They point of them is to be able to track costs, for example to differentiate between sales/costs from two different stores within the same company.

In our current client scenario they have around 10 cost centers, one for each region in the country. They only need around 10 accounts so that would *only* be 100 accounts if we were to use your method. However, the only reason they have so few accounts is because they are not using Drupal for all of their accounting - only for membership fees. The traditional Swedish BAS account plan consists of ~100 accounts. Some organizations have 50+ cost centers.

m.stenta’s picture

Issue summary: View changes

Sorry, I was unclear. That's not what I meant. I didn't mean to suggest that accounts and cost centers are the same. I meant to suggest adding a field to Account entities that references a cost center... the same thing as your patch in #5... but on "Accounts" instead of "Account Entries"...

So when you are creating your accounts, you could have one be something like "Operating Expenses (Cost Center 1)", and when you are editing it, you can assign a Cost Center to it. Cost Centers are still their own entity, and this is just an entity reference field for referencing it from the Account.

By having the reference on the Account level, instead of on the Account Entry level, you only have to enter the "Cost Center" once (during setup of accounts) instead of EVERY time you are entering a transaction. The fact that an account is assigned to a cost center will therefore imply that any account entries made to that account are from that Cost Center.

This would create more Accounts. In my mind that is a good thing, because it provides more fine-grained reporting possibilities.

But ultimately, I guess it depends on what you are going to do with the Cost Centers relationship data that you are storing. How do you foresee using this data in day-to-day Ledger use, or reporting?

AdamGerthel’s picture

I'm not sure I follow as to how it would be useful to have it on account level. That would bind the account to a cost center wouldn't it? And what I mentioned earlier would still apply (and become an issue). If you have 100+ accounts (not uncommon), and say, 50 stores. You'd then need 5000 accounts. Sure, that's very granular, but it's granular in the wrong way. It would also require that you add another account for each existing account if you add a new cost center. Cost centers belong to another dimension than accounts.

Or did I misunderstand you completely? :)

How do you foresee using this data in day-to-day Ledger use, or reporting?

We're using it to group account balances per cost center. Basically it's in a way like being able to look at all the numbers going in and out of a company - but divided into the company's sections (be it stores, sales channels, sales divisions etc.). One example would be to differentiate sales coming from e-commerce from sales coming from a physical store. Using cost centers you can look at any book-keeping report (balance sheet, income statement), but filter on a specific cost center. You can, for example, single out a single store in a chain of stores and see how that particular store is doing.

By having the reference on the Account level, instead of on the Account Entry level, you only have to enter the "Cost Center" once (during setup of accounts) instead of EVERY time you are entering a transaction. The fact that an account is assigned to a cost center will therefore imply that any account entries made to that account are from that Cost Center.

I was originally thinking that it could be enough to have the reference on the transaction rather than on each account entry but I've taken a look att two different book-keeping systems and they both keep the reference on the account entry level. It's also way more future proof, and useful for the occasions where you actually have multiple cost centers being affected on a single transaction.

m.stenta’s picture

Thanks for explaining and helping me to understand. It sounds like you're on the right track, then, especially if other bookkeeping systems are doing it the same way.

So back to the original issue: how to make this possible in core Ledger without hacking it? As you pointed out, there is already an issue for it: #1514940: Fieldable Account Entries

So perhaps we can continue that part of the discussion there.

I look forward to seeing the Cost Center module come together! I'm curious to see it in action. :-)

AdamGerthel’s picture

Status: Active » Closed (fixed)

Closing since #1514940: Fieldable Account Entries will handle the ability for Ledger Cost Center to integrate properly with the ledger module.