> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/product/features/tasks/time-and-cost.md).

# Time and cost

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/product/features/time-and-cost.md).
{% endhint %}

People log the **time** spent on a **task** and its **costs**, each entry with a short note, and correct them later. A time entry is hours and minutes with an optional amount, such as labour; a cost entry is an amount, such as a part. The task shows the totals per currency, and they go into the task report and, on the web, a statement of fees, so a site can see what each job took.

## Rules

### Entries

* A time entry has a note (up to 50 characters), hours (0 to 999), minutes (0 to 59), a currency and an amount ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* A cost entry has a note, a currency and an amount with up to 10 digits and 2 decimals ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs), [`tPri_JobTimeCost`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobtimecost.md) `fCost_decimal`).
* The note is required. On the web and iOS nothing else is: empty hours, minutes and amounts count as 0.
* A new row can't be added while another new row has no note: "Please fill all the details for the current time before adding a new one" ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* Rows with errors stop the save: "There's an issue with one of the fields. Please check the highlighted fields for more details" ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#inputs)).
* The currency starts as the site's default currency. Without one, it starts as the device's local currency, and the apps fall back to US dollars. Only currencies Snapfix supports are offered ([`POST /v1/app/tasks/job-cost`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-cost)).
* An entry records who logged it and when ([time and cost object](https://docs.snapfix.com/engineering-reference/api/tasks.md#time-and-cost-object), [`tPri_JobTimeCost`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobtimecost.md)).

### Who and when

* Entries can be added or changed only while the task is editable ([Tasks](https://docs.snapfix.com/product/features/tasks/tasks.md#who-can-open-and-change-a-task), [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#checklist-time-range-time-and-cost-reminder)).
* Anyone who can edit the task can add, change and delete every entry, including other people's. The API also changes entries of other tasks when given their IDs.
* The apps grey out "Add Time" and "Add Cost" when the site's plan doesn't include them, and say "Not included in this business account". The web and the API don't check the plan \[[ASK-23](https://github.com/snapfix/docs/blob/main/ASK.md#ask-23-should-plan-limits-be-enforced-on-the-web-and-the-server)].

### Totals and outputs

* Totals add up per currency, never converting between them; time totals also add the hours and minutes per currency ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#layout), [Task activity](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-activity.md#layout)).
* Each change adds "Added", "Edited" or "Removed" time or cost to the task's activity log; the chat doesn't show these lines ([`POST /v1/app/tasks/job-time/multi`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-timemulti), [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#task-chat)).
* The web's "Download Statement Of Fees" builds a PDF of the task's time and cost; the page behind it needs only the task's ID ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#checklist-time-range-time-and-cost-reminder)).
* The task report includes "cost & time" ([Sharing tasks](https://docs.snapfix.com/product/features/tasks/task-sharing.md#task-report)); the shared task page leaves them out, although its data carries them.
* Copies and moves bring the entries along ([Copy or move task](https://docs.snapfix.com/how-the-apps-work/screens/tasks/copy-move.md#actions)).
* A group's web task list can show only tasks with time or cost entries ("Only includes tasks with cost") ([Task lists](https://docs.snapfix.com/product/features/tasks/task-lists.md#filters)).
* Snapfix AI's assistant can add time and cost entries too ([`POST /v1/app/tasks/job-time`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-time), [Snapfix AI](https://docs.snapfix.com/product/features/ai/snapfix-ai.md)).

## Flow

```mermaid
flowchart TD
  open["Open a task"] --> add{"Add Time or Add Cost"}
  add -- "plan lacks it (apps)" --> nope["Not included in this business account"]
  add -- "task not editable" --> hidden["Not offered"]
  add --> rows["Rows: note, hours and minutes, currency, amount"]
  rows --> valid{"Rows valid?"}
  valid -- no --> fix["Highlighted fields"]
  valid -- yes --> save["Save"]
  save --> totals["Totals per currency"]
  save --> log["Activity log line"]
  totals --> outputs["Task report, statement of fees"]
```

## Platforms

| Capability                             | Web                                                                                                                                | iOS                                                                                                        | Android           |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------- |
| Add, edit, delete entries              | yes                                                                                                                                | yes                                                                                                        | yes               |
| Where                                  | "+" or the pencil on "Time" and "Cost"                                                                                             | "+" menu, "Add Time" / "Edit Time", "Add Cost" / "Edit Cost"                                               | same as iOS       |
| Plan check                             | none \[[ASK-23](https://github.com/snapfix/docs/blob/main/ASK.md#ask-23-should-plan-limits-be-enforced-on-the-web-and-the-server)] | greyed out, "Not included in this business account"                                                        | same as iOS       |
| Totals on the task                     | "Time" and "Cost" cards                                                                                                            | header card and [Task activity](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-activity.md) | same as iOS       |
| "Download Statement Of Fees"           | yes                                                                                                                                | no                                                                                                         | no                |
| Works offline                          | no                                                                                                                                 | yes, synced later                                                                                          | yes, synced later |
| "Only includes tasks with cost" filter | yes                                                                                                                                | no                                                                                                         | no                |

## Screens

* [Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md), with the "Add Time" / "Edit Time" and "Add Cost" / "Edit Cost" dialogs ([Time and cost](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#time-and-cost))
* [Task activity](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-activity.md), "Details" tab

## API and data

* Web: [`POST /v1/app/tasks/job-time/multi`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-timemulti) and [`POST /v1/app/tasks/job-cost/multi`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-costmulti) add, change and delete entries in one call; the task's entries come with [`GET /v1/app/tasks/{uuid}`](https://docs.snapfix.com/engineering-reference/api/tasks.md#get-v1apptasksuuid) as [time and cost objects](https://docs.snapfix.com/engineering-reference/api/tasks.md#time-and-cost-object).
* Snapfix AI: [`POST /v1/app/tasks/job-time`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-time) and [`POST /v1/app/tasks/job-cost`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-v1apptasksjob-cost).
* Apps: [`?action=save_pri_job_timecost`](https://docs.snapfix.com/engineering-reference/api/tasks.md#post-actionsave_pri_job_timecost) through the sync.
* Statement of fees: `?action=job_tc_report` ([Reports API](https://docs.snapfix.com/engineering-reference/api/reports.md)); currencies: `GET /v1/app/currencies` ([Reference API](https://docs.snapfix.com/engineering-reference/api/reference.md)).
* Tables: [`tPri_JobTimeCost`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobtimecost.md) (`fType` 0 for time and 1 for cost, `fTime_ms`, `fCost_decimal`, `fCost_std_currency_code`), [`std_currencies`](https://docs.snapfix.com/engineering-reference/db/tables/std_currencies.md), the site's `default_currency` in [`tPri_Parent`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_parent.md).

## Depends on

* [Tasks](https://docs.snapfix.com/product/features/tasks/tasks.md): an editable task.
* [Subscriptions](https://docs.snapfix.com/product/features/billing/subscriptions.md): the plan's time and cost switches, which the apps apply.
* [Site details](https://docs.snapfix.com/product/features/console/site-details.md): the site's default currency.
* [Sharing tasks](https://docs.snapfix.com/product/features/tasks/task-sharing.md) and [Task reports](https://docs.snapfix.com/product/features/reports/task-reports.md): reports that include the entries.
* [Snapfix AI](https://docs.snapfix.com/product/features/ai/snapfix-ai.md): the assistant can log entries.

## Edge cases

* **Offline (apps):** entries are saved on the phone and synced later; the web needs a connection.
* **Missing permission:** on a locked, archived or out-of-range task, and for read-only members, the entries are shown but can't be changed ([Task detail](https://docs.snapfix.com/how-the-apps-work/screens/tasks/task-detail.md#states)).
* **Plan limits:** a site whose plan lacks time or cost can still log them on the web \[[ASK-23](https://github.com/snapfix/docs/blob/main/ASK.md#ask-23-should-plan-limits-be-enforced-on-the-web-and-the-server)].
* **Deleted entries:** they disappear from the task and its totals; the database keeps the row, marked deleted ([`tPri_JobTimeCost`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobtimecost.md) `fDeleted`).
* **Several currencies:** each currency gets its own total line.
* **Several sites:** each site has its own default currency, so the same person may start in different currencies on different sites.
* **Time zones:** entries carry the time they were logged, and nothing depends on the time zone.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/product/features/tasks/time-and-cost.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
