I am looking for advice on the following design for a payroll module.
I have this data model in mind:
1. employees. This is basically a list of accounts that receive payroll payments.
2. cost centers. This is a list of accounts that employees get paid from, they correspond to projects with their own budgets.
3. a labor distribution. For a given payroll period, this spells out what fraction of each employee's time is paid from each cost center. So Joe Cool's time is 50% on project A and 50% on project B, so when he gets paid, I want to automatically generate the two transactions from the correct accounts.
Then, in the beancount file, I imagine having a directive called "payroll" which would generate all the appropriate transactions following the labor distribution.
I'm not sure the best way to integrate this idea into Beancount. The data is hard to represent directly in the data file (or I don't see the right way to do it), so I have in mind a plugin where the labor distribution is defined in the Python module, and the "payroll" directives would be dummy transactions that the plugin would substitute out when mapping over the entries list.
Does that make sense, and does it seem the right way to approach this?
Ian