> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comforthub.app/llms.txt
> Use this file to discover all available pages before exploring further.

# How invoicing works

> How completing a job becomes an invoice in QuickBooks, Zoho and the customer's inbox

export const Touches = ({systems}) => <p>
    <strong>Systems involved:</strong>{" "}
    {systems.split(",").map((s, i) => <span key={s}>
        {i > 0 ? " · " : ""}
        <a href={"/systems/" + s.trim()}>{s.trim().replace(/-/g, " ")}</a>
      </span>)}
  </p>;

<Touches systems="supabase-backend, quickbooks, zoho-crm, resend" />

The moment a job is marked complete, the engine builds the invoice from the lines billed to the customer, sends it to QuickBooks, files the PDF, makes the Zoho copy, and emails the customer. Nobody builds an invoice by hand.

## What is billed, and to whom

Every line on a work order is billed to the customer, to warranty, or to the customer's plan. A line is warranty when its **Charge To** says warranty. A line is on the plan when its product is one of the plan's covered items and the plan's status covers visits; see [Statuses](/reference/statuses). Everything else is billed to the customer at its catalog price.

What the engine does with that:

| The job's lines                                                         | What happens                                                                                                                            |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| at least one billed to the customer                                     | the job is Draft, and completing it makes an invoice for those lines. Warranty and plan lines are on it at no charge                    |
| none billed to the customer, every line covered by warranty or a plan   | the job is Non-Billable and no invoice is ever made                                                                                     |
| none billed to the customer, and a line that matches no QuickBooks item | the engine refuses to decide and raises a human-review flag, because marking the job non-billable would write off work that may be owed |
| no lines at all                                                         | nothing is decided; the billing status stays as it is                                                                                   |

A discount that would take the invoice to zero or below stops it too, and leaves a human-review flag.

## What happens, in order

| Step       | What the engine does                                                                                                                                  |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Build      | The invoice is built from the work order's lines. Billable lines are priced; warranty and plan lines are on it at no charge.                          |
| QuickBooks | The invoice is created in QuickBooks, which adds the tax and answers with the due date.                                                               |
| PDF        | The invoice PDF is drawn and filed.                                                                                                                   |
| Zoho       | The Zoho invoice is made, linked to the contact, the account, the work order and both addresses, with the PDF attached.                               |
| Work order | The work order's billing status becomes Invoiced.                                                                                                     |
| Email      | "Invoice INV… from Comfort Hub" goes to the customer with the PDF, any certificate the job earned, and the pay link. The invoice is then marked sent. |

## Three fields and who sets them

| Field in Zoho             | Who sets it                                                                        | What the engine does with it                                                                                                                         |
| ------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Discount**              | The office, on the work order before the job is completed, or on the invoice after | Copies it onto the invoice and sends it to QuickBooks as a discount line, taken off before tax, so the tax is right and all three totals agree       |
| **Enable Processing Fee** | The office, on the work order or the invoice                                       | Mirrors the Yes or No onto the invoice, in both directions                                                                                           |
| **Due Date**              | QuickBooks                                                                         | The engine asks for thirty days out when it makes the invoice, then keeps the date QuickBooks answers with and copies it to Zoho. Zoho only shows it |

The amount itself is never typed. Zoho computes it from the lines, and the engine reads it. See [Fix an invoice](/handbook/invoicing/fix-an-invoice).

## Statuses

An invoice has two statuses, each with one home.

* **Status** is Zoho's and describes the document: Created, Delivered or Void in Zoho read as Draft, Sent or Void here. Setting it in Zoho sticks.
* **Payment Status** is the engine's and describes the money. Zoho shows it; nothing typed there changes it.

Both lists are on [Statuses](/reference/statuses).

## Reminders

A sent invoice that is still unpaid gets a reminder email seven days after its due date, and an overdue notice from twenty-one days. A void, paid or never-sent invoice gets neither. The wording is on [Emails we send](/reference/emails-we-send).

## Delete and void

Deleting an invoice in Zoho changes nothing here or in QuickBooks. The engine writes nothing and raises a human-review flag, because the invoice records money. See [Resolve a human-review flag](/handbook/running/resolve-a-human-review-flag).

Setting the Zoho invoice to Void voids it in QuickBooks and files a VOID copy of the PDF. See [Void an invoice](/handbook/invoicing/void-an-invoice).

## Certificates

A completed visit with a finished maintenance or commissioning checklist also produces a certificate, and the invoice email carries it. See [Certificates](/handbook/invoicing/certificates).

## Related

* [How payments work](/handbook/payments/how-payments-work)
* [Fix an invoice](/handbook/invoicing/fix-an-invoice)
* [QuickBooks](/systems/quickbooks)
