Skip to content

Part 1 of 7 · CIS deduction checker series ~6 min read

A CIS deduction checker on AWS for a few dollars a month

A refurbishment contractor in Leicester paid fourteen subcontractors GBP 1,146,380 in a tax year and took every deduction at the rate HMRC gave it. The rates were right. What went wrong was the number the rates were applied to, and nobody noticed until an HMRC compliance check asked for the receipts behind three subcontractors’ materials lines.

a group of men standing next to each other in front of a building
Photo by Glenov Brankovic on Unsplash

Key takeaways

  • The deduction is only as right as the base it is taken from, and the base is a materials question.
  • Materials the subcontractor paid for come out of the base. Materials nobody can evidence are the contractor’s risk.
  • Verification gives a rate, a verification number and a date, and all three belong on the record.
  • The return, the statements and the payment come from one frozen month.
  • Designed on AWS for about $3 a month.

The whole system on one page

Before any code, here is the shape of what we are designing.

System: subcontractor invoices and HMRC verification joined into a monthly CIS returnThree boxes across the top sit outside the AWS account. On the left, Subcontractor invoices: PDFs and photos, by email. In the middle, HMRC verification: the rate, the number and the date checked. On the right, HMRC and the subcontractors: the return, and a statement each. The first two connect down to the AWS account container, labelled as each arrives and per subcontractor; the third connects back up from it, labelled by the 19th. Inside the AWS account are three components in a row. Read the invoice: labour, materials, plant and VAT. Base and deduction: the rate, applied to the right number. And Close the tax month: the return, the statements and the evidence. A note says the first box inside decides the money, because the rate from HMRC is rarely wrong while the number it multiplies often is.AWS ACCOUNTSubcontractor invoicesPDFs and photos,by emailHMRC verificationrate, number andthe date checkedHMRC and the substhe return, and astatement eachRead the invoicelabour, materials,plant and VATBase and deductionthe rate, applied tothe right numberClose the tax monthreturn, statementsand the evidenceas each arrivesper subcontractorby the 19thThe first box inside decides the money. The rate from HMRC is rarely wrong; the number it multiplies often is.
Fig 1. Three things outside the account, three pieces inside it. Everything difficult about CIS happens in the first box inside, before any rate is applied.
  • Machine learning
  • Security & identity
  • Analytics

Why a contractor that pays on time still gets this wrong

Because the scheme looks like a rate problem and is actually a document problem. HMRC tells you whether a subcontractor is registered, unmatched or holds gross payment status, and the percentage follows from that answer mechanically. Nobody in a well-run accounts office applies 20 per cent where they were told 30.

What the percentage is applied to is a different matter. The deduction comes off the payment after taking out VAT and whatever the subcontractor actually paid for materials, plant hire, consumables and fuel used on the job. That figure is on the subcontractor’s invoice, written by the subcontractor, and usually keyed into the ledger by somebody processing forty other invoices that week.

So the materials line gets keyed as it arrives. A groundworker who writes materials and labour with two numbers beside it gets both numbers believed, and a plasterer who forgets to split the plaster out of one lump sum gets deducted on the lot.

What runs (the inside)

  • Verification. Who you are paying, the rate HMRC gave, and whether that answer is still in date. Part 2.
  • The deduction. Labour, materials, plant and consumables separated, and every materials figure marked evidenced, estimated or unsupported. Part 3.
  • The reverse charge. Whether the invoice should carry VAT at all, and what happens when it does and should not. Part 4.
  • The close. The return, the statements and the payment, from one frozen set of numbers. Part 5.

One contractor, one tax year

One contractor's CIS tax year from subcontractors paid to deductions missedA horizontal row of five boxes joined by arrows. Fourteen subcontractors paid: eleven at the standard 20 per cent, one at the higher 30 per cent, and two paid gross. One million, one hundred and forty-six thousand, three hundred and eighty pounds paid, gross and excluding VAT, in the year. Three hundred and eighteen thousand, nine hundred and forty pounds of materials taken out of the base before deduction. Ninety-one thousand, two hundred and seventeen pounds of those materials with no receipts, across three subcontractors. And nineteen thousand, one hundred and eighty-nine pounds forty under-deducted, and sought from the contractor. A note says every rate was right, and the shortfall sits entirely in the third box, in materials figures that were keyed as written and never asked about.ONE CONTRACTOR, ONE TAX YEAR14 subs paid11 standard,1 higher, 2 grossGBP 1,146,380paid in the year,excluding VATGBP 318,940of materials, takenout of the baseGBP 91,217of materials withno receipts behindGBP 19,189.40under-deducted,sought from youEvery rate was right. The shortfall sits entirely in the third box, in materials figures that were keyed as written and never asked about.
Fig 2. The same year as one line. The first two boxes are what everybody tracks; the third is where the deductions were actually decided.
  • Management
  • Analytics
  • People

In plain words

Invoices arrive by email, and each one is read once. The read separates labour from materials, plant hire, consumables, fuel and travel, picks out the VAT line and any reverse-charge wording, finds the subcontractor’s UTR as printed, and notes whether anything attached to the same email supports the materials figure.

Before any money moves, the subcontractor is checked against the verification record. If they were on one of this contractor’s returns in the current tax year or the previous two, the rate on file stands; otherwise they are verified again. The rate, the verification number and the date are stored, and every deduction points at the exact record it used.

Then the arithmetic, which is the easy part: payment excluding VAT, less the allowable materials and costs, multiplied by the rate. It is stored with every input, so the question an inspector actually asks — why was this deduction taken on GBP 2,620 and not GBP 3,860 — is answered by a record rather than by somebody’s memory of the invoice.

Once a month the tax month closes. It ends on the 5th, the system freezes it on the 6th, and the return, the payment and deduction statements and the amount to pay HMRC are all built from the same frozen rows, ready well before the 19th.

Design rules that shaped every decision

  • The rate comes from a verification record, and every deduction names the record it used.
  • A materials figure is evidenced, estimated with a reason, or unsupported. Never just keyed.
  • The deduction base is stored with its parts, not only the deduction.
  • An invoice that charges VAT on a reverse-charge supply is held, not paid and fixed later.
  • A closed tax month is frozen. A correction is a new version with a reason.
  • Evidence is captured when the invoice is read, not assembled when HMRC asks.

What it does not do

It does not decide employment status. Every CIS return carries a declaration that the employment status of each subcontractor has been considered, and that is a judgement about control, substitution and the working relationship. The system records who made that decision and when; it does not make it.

It does not file the return or pay HMRC either. It produces the return figures, the statements and the amount due, and a person submits and pays, because the return carries declarations and a declaration is somebody’s decision. That division has held up well in the other compliance systems in this series and it holds up here.

And it is not a purchase ledger. It does not match invoices to orders, approve them or argue about price. It takes an approved invoice as its input and argues about exactly one thing: how much of it is labour.

The next four posts walk through each piece: verifying a subcontractor, splitting labour from materials, checking the reverse charge, and closing the tax month with the evidence behind it. One diagram per post, a cost breakdown, and an engineering reference at the end.

All posts