Treadstone Associates
Article · 9 min read

How to code every expense to the right job

The only coding that stays accurate is coding that happens at capture. A document-extraction model reads the vendor, date, total and line items off a receipt or supplier invoice; software proposes the job and cost code from your own history; a person confirms it. What AI does not do is decide what an expense is for — and the records you have to keep do not change because a machine filed them.

Treadstone Associates · Updated 2026

Key takeaways

  • • Coding at capture beats coding at month end, because the only person who knows which job a $340 lumber run belongs to is the person who bought it.
  • • Extraction models are reliable on structured fields — vendor, date, invoice number, totals, line items — and unreliable on intent. Intent is the part you approve.
  • • One receipt often belongs to three jobs. Line-item extraction is what makes splitting it a two-tap job instead of a rekeying job.
  • • The Income Tax Act requires records kept at your place of business in Canada, generally for six years, and electronic records must stay electronically readable.
  • • If your income comes mainly from construction, payments to subtrades carry their own annual information return — and that return is only as good as your coding.

Every contractor has the same shoebox problem in a more expensive form. The job made money or it did not, and the answer is buried in a mix of supplier invoices, credit-card charges, cash receipts, fuel, equipment rental and subtrade billings that arrive over eight weeks in four different formats. Coding is the act of attaching each of those to a job, a cost code and a cost type. Do it well and you know your margin while you can still act on it. Do it in a panic at year end and you have a tax filing, not a management tool.

The useful thing about AI here is narrow and worth being precise about. It reads documents and proposes a classification. It does not know that the drywall on the Tuesday invoice went to the Bathurst job rather than the Danforth one, unless something in your data tells it so. So the workflow that works is: capture, extract, propose, confirm — with the confirm step done by someone who was there.

What “coding to a job” actually means

Three fields, not one. The job (which project), the cost code (what kind of work — excavation, framing, electrical), and the cost type (labour, material, subcontract, equipment, other). Reporting that only carries the job tells you whether you are up or down. Reporting that carries all three tells you why, which is the thing that changes how you price the next one.

It also has to land somewhere that compares it to a budget. Procore, for example, documents a Direct Costs tool for the non-contract costs that impact your budget — invoices, expenses and payroll that are not attached to a commitment — alongside a budget tool they land against, and company-level timesheets for the labour side. The particular product matters less than the principle: a coded cost that never meets a budget line is bookkeeping, not job costing.

Where coding actually breaks

It is worth naming the five failure points, because each has a different fix and only some of them are AI-shaped.

The five places job coding falls apart

The mixed run. One trip to the building supply covers three jobs and the shop. One receipt, three cost centres, and nobody splits it.

The card charge with no paper. The bank feed shows $612.44 at a supplier. The receipt is in a truck door.

The supplier invoice with a purchase order you did not raise. It arrives against a job number nobody on site recognises.

The subtrade invoice that describes the work but not the phase. “Progress billing #3” against a $180,000 contract with no breakdown.

The memory gap. Anything coded more than about a week after it was incurred is coded by inference, and inference is where the errors live.

What an extraction model can actually read

This is the part where vendor documentation is worth more than a sales claim. Microsoft publishes the field set for its prebuilt invoice model, which returns the invoice-specific values and line items it found — invoice ID, ship-to, bill-to, customer, total and line items — in a structured JSON output, and there is a separate receipt model for till receipts. Confidence values come back with the fields, which is the hook a sensible workflow hangs on: high-confidence fields post, low-confidence fields queue for a human.

Note what is on that list and what is not. Vendor, date, number, tax, totals, line descriptions and amounts — all present on the document, all extractable. Job number, cost code and cost type — almost never present on the document, and therefore not extracted. They are inferred, from your history, from the purchase order, from who took the photo, or from where the phone was standing. Inference is a suggestion. Treat it as one.

Splitting one receipt across three jobs

Line-item extraction is what turns the mixed run from a chore into a tap. Once the model has returned eight lines with descriptions and amounts, the crew member allocating them is choosing a job per line rather than re-typing a receipt. The practical rule we give clients: if a receipt covers more than one job, it gets split at capture or it gets coded to overhead. Never let it default to the biggest job, because that is the job whose margin you will misread.

The records rule underneath all of it

Automation does not soften the obligation. Section 230 of the Income Tax Act requires every person carrying on business to keep records and books of account at their place of business or residence in Canada, in a form that lets the tax payable be determined; subsection 230(4)(b) requires those records, and every account and voucher needed to verify them, to be kept for six years from the end of the last taxation year they relate to. Subsection 230(4.1) adds the modern part: if you keep records electronically, you must retain them in an electronically readable format for that same period.

The GST/HST side runs in parallel. Section 286 of the Excise Tax Act requires records sufficient to determine your liabilities and obligations, says they must be kept in Canada in English or French unless the Minister authorises otherwise, and sets the same six-year retention with the same electronically-readable requirement. Our sister firm covers what that means when an auditor actually arrives, in record-keeping requirements that survive a CRA audit and what happens when business expenses are audited.

The practical consequence for a coding workflow: a photograph you cannot retrieve, in an app you no longer subscribe to, is not a record. Whatever tool captures the document has to export it, and the export has to be readable without that tool.

The construction-specific filing your coding feeds

There is one obligation that is specifically a construction obligation and it depends entirely on coding subtrade payments properly. Section 238 of the Income Tax Regulations requires an information return for amounts paid or credited for goods or services rendered in the course of construction activities, where the payer’s business income for the reporting period is derived primarily from those activities. The regulation defines construction activities broadly — erection, excavation, installation, alteration, modification, repair, improvement, demolition, destruction, dismantling or removal of all or part of a building, structure, or surface or sub-surface construction. The reporting period can be calendar or fiscal, but once chosen it cannot be changed without the Minister’s authorisation, and the return is due within six months of the end of that period.

Which is to say: the difference between a tidy filing and a scramble is whether every subtrade payment carried a supplier identity and a job all year. That is a coding discipline, not a year-end project.

A worked example

The following is illustrative — a composite of how the workflow is usually assembled, not a measured result.

A twelve-person renovation contractor runs four to six jobs at a time. Every crew member forwards receipts to one address from their phone; supplier invoices arrive at that same address by email from six suppliers. An extraction step reads each document and returns vendor, date, invoice number, subtotal, tax, total and line items. A matching step proposes a job by looking at three things: the purchase order number if there is one, the supplier’s history on open jobs, and which job the sender was assigned to that day.

Anything above the confidence threshold with a matching purchase order posts to the job with a proposed cost code. Everything else lands in a queue that the office manager clears each morning — a job to pick, occasionally a split across two jobs, occasionally a cost code corrected. The lumber invoice that says “Bathurst” in the delivery address posts itself. The Home Hardware receipt for $84 of fasteners does not, and should not.

The gain is not that a machine did the bookkeeping. It is that the job cost report on the fifteenth reflects the fourteenth, so the estimator can see that the framing package on one job is tracking over the estimate while the job is still framing.

Common questions

Should the AI pick the cost code, or the person?

The AI proposes; the person picks. A model trained on your history will get the routine cases right most of the time, and it will confidently miscode the unusual ones — which are exactly the ones that distort a job. Set it up so that accepting a suggestion is one tap and overriding it is one tap, and the accuracy question mostly resolves itself.

Can I throw the paper out once it is scanned?

The statutory requirement is that the record is kept and, if kept electronically, kept in an electronically readable format for the retention period — section 230 of the Income Tax Act and section 286 of the Excise Tax Act both say so. Whether your particular retention setup satisfies that is a question for your accountant, not for a software vendor, and the Minister’s exemption power in 230(4.2) exists precisely because not every setup does.

What about the cards nobody attaches receipts to?

A bank feed alone gives you an amount and a merchant, not a voucher. The fix is procedural rather than technical: a weekly list of unmatched charges sent to the cardholder, and a standing rule that unmatched charges code to overhead. Overhead is a worse answer than the truth but a better answer than a guess attached to a job.

Does this connect to what I file?

Directly. The same coded data produces your job costing, your subtrade totals for the construction information return and the substantiation for expenses if you are ever asked. A companion piece covers the records CRA expects from a contractor in more detail.

See where AI pays off first in your business.

A 30-minute call is enough to tell you whether AI pays for itself here.