This guide is for drivers and dispatch / admin users who want costs that happened in the field fuel fills and dump fees to roll up into the right job's profitability.
---
Why bother?
Without a job link, a fuel fill or disposal manifest is recorded for compliance and fleet metrics (MPG, dump volumes, etc.) but it never reaches the Job Profitability card. The "see the real margin on every delivery" view depends on this link being set.
---
Linking a fuel fill (driver flow)
Within a few seconds:
What if I picked the wrong job?
Reopen the fuel log, change or clear the linked job, and save. The mirrored expense moves with it.
---
Linking a disposal manifest
Disposal manifests get the same treatment. When you complete a dump:
The mirrored expense lands under Disposal & Dump Fees, with the manifest number as the reference.
---
What gets mirrored, exactly
| Source row field | Mirrored expense field | Value |
|---|---|---|
| `fuel_logs.total_cost` | `expenses.amount` | Full fill cost (including yard-tank fills) |
| `fuel_logs.log_date` | `expenses.expense_date` | |
| `fuel_logs.mobile_vendor_id` | `expenses.vendor_id` | Only for mobile-vendor purchases. Retail / yard-tank fills leave vendor blank. |
| `fuel_logs.driver_id` | `expenses.created_by` | |
| `disposal_manifests.disposal_fee` | `expenses.amount` | Only when greater than zero. |
| `disposal_manifests.disposal_date` | `expenses.expense_date` | |
| `disposal_manifests.manifest_number` | `expenses.reference_number` |
There is one mirrored expense per source row (enforced by a partial unique index in the database).
---
Editing rules
---
Permissions
Linking a fuel log or manifest to a job is allowed for any user who can already create that fuel log or manifest. The job picker only returns jobs from the user's own organization, so cross-tenant linking is impossible.
By default, drivers see their own active jobs in the picker; admins and dispatch see all org jobs.
---
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Picker shows "No matches" | Job belongs to a different organization, is archived, or doesn't match your search text. |
| Fuel saved but Job Profitability didn't move | The fuel log's job link is blank reopen the log and re-link. |
| Expense pill missing the Fuel / Disposal badge | The expense was hand-entered, not mirrored. Both kinds count toward profitability. |
| The mirrored row's vendor is blank | Expected for retail-station and yard-tank fuel and for disposal facilities. Only mobile vendor fuel maps to a vendor record. |
| Disposal manifest saved but no expense appeared | The disposal fee is zero or blank. PortaPro doesn't auto-create $0 expense rows. |
---
