pondersource / prejournal

An experimental bookkeeping tool that sits between source documents and journals
https://prejournal.org
MIT License
2 stars 2 forks source link

PJ2 to PTA algorithm #187

Closed michielbdejong closed 1 year ago

michielbdejong commented 1 year ago

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:

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:

Loan

Book between:

michielbdejong commented 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:

michielbdejong commented 1 year ago

So for PJ2 we can then also demand some more data hierarchy:

michielbdejong commented 1 year ago

So maybe after addEntries there should be a collectMilestones step that builds up some data structure in the Journal object.