Closed michielbdejong closed 1 year ago
We can calculate hourly rates at print-time like we do here but if we want to calculate the profit we make on a milestone then this just becomes too ugly. So maybe we need a data model that is closer to our view of the world. So a Milestone
object which collects:
So for PJ2 we can then also demand some more data hierarchy:
So maybe after addEntries
there should be a collectMilestones
step that builds up some data structure in the Journal object.
worked
There should be an account for Finished Goods Inventory. Each hour worked should be attributed to a specific milestone (i.e. invoice or request-for-payment) for a specific organisation and project. So I should add the milestones, but for now we have at least organisation and project available. Let's pick
[organisation]:assets:worked:[project]:[milestone]
as the account format, and then there can be two situations: if the worker charges by the hour, at the rate that is also charged to the customer, then we book this directly against[organisation]:liabilities:accounts payable:[worker]
. If the customer is charged an overhead over the worker's hourly rate, then that can be booked on[organisation]:assets:margin:[project]:[milestone]
. That way we can sum up the margin we made accumulatively on any given milestone.If the worker is on a monthly salary then we can do the same basically, just calculating their cost rate from salary / working hours each month.
We can keep holidays and sick leave as imaginary "projects" rather than amortising them.
invoice
If the project ("customer") will be paying the organisation, then this books against:
[organisation]:assets:worked:[project]:[milestone]
[organisation]:assets:margin:[project]:[milestone]
[organisation]:assets:accounts payable:[project]
So that later when the payment is made, this last one can be booked off against[organisation]:assets:bank:checking
If the payment is made directly to the worker then it can be booked off against
[organisation]:liabilities:accounts payable:[worker]
. There would then also be a booking between[worker]:assets:bank:checking
and[worker]:assets:accounts receivable:[organisation]
to match this.Expense
Book between:
[organisation]:expense:general
[organisation]:accounts payable:[worker]
Loan
Book between:
[organisation]:assets:bank:checking
[organisation]:accounts payable:[worker]
And back when the loan finishes