65 lines
3.7 KiB
Markdown
65 lines
3.7 KiB
Markdown
# 06: Projects (v0.7.0)
|
||
|
||
Projects plan and track a piece of work: a renovation or a trip (**simple**), or a side business or client work
|
||
(**business**). A project is a **second label on payments**: a payment in a project still counts in its budget and
|
||
its month, so nothing is counted twice. Projects live in the personal log, and the sharing boundary (`share.rs`)
|
||
still builds only `payment.shared`.
|
||
|
||
## Events (`fiscus-ledger::project`)
|
||
| Event | What |
|
||
|:--|:--|
|
||
| `project.created { project, name, kind, template?, starts?, ends?, colour, rate? }` | simple or business; a template id the app knows; an hourly rate for a business |
|
||
| `project.changed { … }` | the latest counts. Once a project has phases or time it stays business |
|
||
| `project.status_set { project, status, on }` | planning, active, on hold, done (`on` is the day) |
|
||
| `project.line_set { project, line, name, planned }` | a budget line; a planned amount of 0 removes it |
|
||
| `project.phase_set` / `project.phase_removed` | a business project's phase with dates; one still holding tasks is not removed |
|
||
| `payment.projected { payment, project, line? }` / `payment.unprojected` | one project per payment, into an open project |
|
||
| `project.rule_set { merchant_key, project? }` | "always this merchant → this project": payments within the project's dates, while it is open |
|
||
| `task.created { task, project, fields }` / `task.changed` / `task.status_set` | title, phase, due, estimate, line, assignee, milestone; to do, doing, done (with the day) |
|
||
| `time.logged { entry, project, task?, minutes, on, rate, note }` / `time.removed` | business only; invoiced time is not removed |
|
||
| `invoice.projected { invoice, project, entries }` | an invoice for a business project, and the time entries it bills (each once) |
|
||
|
||
**What each event accepts:**
|
||
- names: 1–60 characters, task titles 1–120, assignees 1–40;
|
||
- amounts: 0–100 000 000 Kč;
|
||
- hourly rates: 0–100 000 Kč;
|
||
- dates: a project or phase cannot end before it starts;
|
||
- at most 50 projects open, 100 budget lines, 50 phases and 200 open tasks per project;
|
||
- time: at most 24 hours a day across all projects.
|
||
|
||
Every refusal changes nothing.
|
||
|
||
**Time** is minutes × the rate per hour, rounded half up to the haléř once per entry. Weeks start on Monday
|
||
(`project::week_of`).
|
||
|
||
## A project's numbers (`fiscus-insight::projects`)
|
||
`projects(state, today)` returns a summary per project: the open projects in the order they were made, then the
|
||
done ones, the latest first. `project(state, id, today)` adds the details.
|
||
|
||
**What a summary holds:**
|
||
- **planned**: all budget lines together.
|
||
- **spent**: money out of the payments in the project, positive; transfers do not count.
|
||
- **unplanned**: spent outside any line.
|
||
- **lines**: planned, spent, left and over for each.
|
||
- **income** (business):
|
||
- paid invoices of the project, without VAT;
|
||
- money in put into the project, except a statement line that paid one of the project's invoices: that line
|
||
*is* the invoice, so it counts once.
|
||
|
||
If an invoice is marked paid by hand, its money in stays out of the project.
|
||
- **profit**: income − spent. **margin**: profit of income, in thousandths.
|
||
- **progress**: tasks done, by their estimates when every task has one, else by count.
|
||
- **forecast**: spent + the open tasks' estimates.
|
||
- **over budget**: spent or the forecast above the plan. One line over is not the project over.
|
||
- **late**: an open task past its due date, or the project past its end with tasks open. A done project is never
|
||
late.
|
||
- **time**:
|
||
- minutes, billable and unbilled;
|
||
- time by task, and by week.
|
||
|
||
**Medals** (`rewards`), for a project that is done:
|
||
- *Project on budget*: it had a plan, and it spent no more;
|
||
- *Finished on time*: it had an end date, and it was done by it.
|
||
|
||
Both are earned on the day it was done.
|