The call arrives with the job already on screen
A plumbing group with forty vans was losing ten minutes a job to re-typing. Now an inbound call matches the number against job management, pops the site history on the operator screen, and writes the call back against the job the moment it ends. No double entry, and the notes are actually there.
// Inbound call -> find the customer, find the open job, pop the screen.
export async function onInboundCall(event) {
const caller = normaliseAu(event.from); // +61... every time
const customer = await simpro.customers.search({ phone: caller });
if (!customer) return agentScreen.show({ template: "new-lead", caller });
const job = await simpro.jobs.findOpen({ customerId: customer.id });
await agentScreen.show({
template: "known-customer",
name: customer.name,
site: job?.siteAddress ?? customer.billingAddress,
lastVisit: customer.lastVisitedOn,
openJob: job?.number ?? null,
balance: customer.balanceCents / 100
});
}