Job Profitability is cash-basis. It compares the cash you've actually collected for a job against the costs you've linked to that job including driver-logged fuel and disposal fees. It's not a forecast of what you *will* make; it's a ledger of what you *did* make so far.
Where to find it
Open any job's detail page. The Job Profitability card sits in the right column with three tiles:
| Tile | What it counts |
|---|---|
| Revenue | Sum of paid invoices on this job. Drafts and unpaid invoices do not count. |
| Expenses | Sum of every cost linked to this job (status `recorded`). Includes hand-entered expenses plus mirrored driver fuel logs and disposal manifests. |
| Net | `Revenue − Expenses`. Margin shown when revenue > 0. |
If a tile shows `$0.00`, it usually means either no invoice has been paid yet or no costs have been linked.
---
How costs get on the list
There are three ways an expense ends up against a job:
1. Hand-entered expenses
Financials → Expenses → New Expense → toggle "Link to a job" and pick the job from the search box. The picker is org-scoped you only see your organization's jobs.
2. Driver fuel fills
On the Add Retail Fuel Log drawer, toggle Link to a job and pick the delivery the fill belongs to. Two things happen:
If a fuel log is later edited or deleted, the mirrored expense follows it. If you toggle the job link off, the expense disappears.
3. Disposal manifests
Same idea as fuel. When a manifest is logged with a job link and a disposal fee greater than zero, an expense row is mirrored under the Disposal & Dump Fees category. It carries the manifest number as its reference. Manifests with no fee are tracked for compliance but produce no expense.
---
What is not counted (and why)
---
Multi-tenant isolation
Job Profitability uses Postgres views with `security_invoker = true`, so the same Row-Level Security that protects every other table is what protects these numbers. A user from organization A cannot see, link, or affect any job, fuel log, manifest, or expense from organization B even via the database-level mirror triggers.
---
Common questions
Q: A driver linked the wrong job to a fuel fill. How do I fix it?
Open the fuel log entry, change the linked job (or toggle the link off), and save. The mirrored expense moves with it within seconds.
Q: Why is the expense on the panel labeled "Auto-logged from fuel"?
That note tells you the row was created by the mirror trigger. Edit the fuel log, not the expense, to change anything about it.
Q: My disposal facility charged a fee but it's not showing up.
Check that the manifest has both a linked job and a disposal fee greater than zero. If the fee is blank, no expense is created.
Q: I deleted a fuel log what happens to the mirrored expense?
It's deleted in the same transaction by the mirror trigger.
Q: Where do I see all expenses, not just one job's?
Financials → Expenses. The mirrored rows show up there too with the same Fuel / Disposal pills.
---
