Fabricaite
Index

The six tools

Case study · 02

Work booked for six weeks' time now shows up in the forecast today.

Duravault takes a deposit up front and bills the balance on completion. The stock add-on showed Xero those two moments and nothing in between, so a job booked six weeks out did not exist to the forecast. We built an integration that raises the deposit and puts the balance into Xero as a draft the day the job is booked, so the money shows up in the week it is actually expected.

At a glance

Client
Duravault
Systems
ServiceM8 to Xero
Built
A ServiceM8 add-on with a Cloudflare Worker behind it
Replaces
ServiceM8's stock Xero add-on
Volume
15 to 20 jobs a month, around £850 each
Status
Built and proven against real job data, going live shortly
Relationship
Group company. Richard is a director.

Two snapshots, and a blind spot between them.

Duravault runs its jobs in ServiceM8 and its accounts in Xero. The stock add-on connects them and it works. It just cannot do the one thing the business needed.

Fifteen to twenty jobs a month, around £850 each. A job booked into the diary for six weeks' time did not exist as far as cash flow was concerned, and neither did any of the others behind it. The finance view was two snapshots with a gap in the middle, and the gap was where all the booked work lived.

The workaround made it worse. Raising a partial invoice by hand made ServiceM8 spawn a second job for the balance, numbered off the original. Two jobs, two records, one piece of work, and a growing pile of invoices that had to be reconciled by eye.

One job, two invoices, no manual step.

  1. When the job is booked

    The integration raises the deposit invoice, approves it, emails it, and creates the balance invoice in Xero as a draft, dated to the expected completion plus payment terms.

  2. When the job is marked complete

    The balance is rebuilt from the job as it then stands, so every line added, removed or repriced in the meantime comes through. Then approved, dated from ServiceM8's own completion timestamp, and emailed.

  3. While it runs

    Payments landing in Xero are written back onto the ServiceM8 job every hour, and a receipt goes out on its own once an invoice is settled.

  4. Numbered from the job

    1027 - Deposit and 1027 - Balance, both against job 1027. Anyone in either system finds the other side in seconds.

The draft is the whole point. Xero's cash flow manager can be set to include draft invoices, so the balance appears in the week it is expected rather than the week it is issued. And because it stays a draft, no VAT invoice has been issued and no tax point created. Duravault gets the forward visibility without pulling the VAT forward with it.

There is no AI in this one either.

  • Not AI

    It reads the state and makes Xero match it

    ServiceM8's webhooks tell you that a field changed, not what it changed to, and they can arrive twice. So the integration ignores the event, reads how the job actually stands, and makes the accounts agree with it. That is a rule doing what a rule is good at, and it is the reason running it twice changes nothing.

The forecast now includes the work that is already booked.

Booked work is visible in Xero the day it goes in the diary, instead of weeks later. Every job that has been booked and not yet completed is now in the forecast, where before none of them were.

Adam raised every invoice by hand. Now he raises none of them.

The duplicate-job problem is gone by design. One job carries both invoices, so there is nothing to spawn and nothing to reconcile.

ServiceM8 add-on with a Cloudflare Worker backend. Idempotent by design, because the webhooks report that something changed rather than what it changed to and can arrive more than once. Xero OAuth 2.0 with rotating refresh tokens persisted before use. Around seventy automated tests, written against real ServiceM8 payloads rather than assumed field shapes. Deposit invoices are never revised once sent, so changes land on the balance and the customer's arithmetic always reconciles.

Next step

Twenty minutes, no obligation.

If your accounts only see a job when it starts and again when it finishes, the gap in between is fixable. Tell us what you run.

Would rather write than talk? Send us a message instead and it reaches the same two people.