syncro: require delivery channel for emergency billing

"Emergency" is a billing modifier, not a delivery channel. Added explicit
hard rule that Remote/Onsite/In-Shop must be confirmed separately when billing
emergency — the delivery channel determines price_retail and cannot be guessed.

Updated both the Hard Rules section and the Billing workflow Step 1 gather prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 16:26:30 -07:00
parent 307bb8812b
commit 58d424e332

View File

@@ -41,7 +41,7 @@ Create, update, close, comment on, and bill tickets in Syncro PSA.
**Ticket response shape:** `{"ticket": {...}}` — always use `.ticket.id`, never `.id`. The flat-object jq pattern silently returns nulls and looks like failure when it isn't.
**Billing:** Always ask for minutes and labor type before adding any line item. Never assume a default.
**Billing:** Always ask for minutes and labor type before adding any line item. Never assume a default. **"Emergency" is a billing modifier, not a delivery channel** — if the user says "emergency" without specifying Remote / Onsite / In-Shop, you MUST ask. The delivery channel determines `price_retail` ($262.50 onsite, $225.00 remote/in-shop) and cannot be guessed.
**Emergency/after-hours billing — check prepaid first:** Before adding a `26184` (Emergency) line item, `GET /customers/<id>` and read `prepay_hours`. Emergency = time-and-a-half (×1.5), applied ONCE — never bill a separate regular + emergency line for the same hours. **No prepaid (`prepay_hours == 0`):** `26184` at qty = actual hours; set `price_retail` by delivery channel — **Onsite $262.50** (175×1.5, 26184's default), **Remote / In-Shop $225** (150×1.5, override price_retail). The rate carries the 1.5×; do NOT also ×1.5 the qty. **Prepaid (`prepay_hours > 0`):** still use `26184`, at qty = actual hours **× 1.5** (premium goes in the quantity since prepaid debits by quantity; invoice nets $0, block debits hours×1.5). e.g. 1.5 emergency hrs prepaid → `26184` @ 2.25. (Rule updated 2026-05-27 by Mike: prepaid emergency uses `26184`, NOT the old `26118`×1.5 — keeps the line labeled emergency + mapping right in QuickBooks. Original ×1.5-not-additive lesson: #32203 Desert Auto Tech 2026-04-23, Winter.)
@@ -969,7 +969,7 @@ When showing ticket detail, include:
**Step 1 — Gather (ask user once, run GETs in parallel)**
Ask: minutes to bill + labor type (remote / onsite / emergency / in-shop / warranty). Then fetch:
Ask: minutes to bill + labor type (remote / onsite / emergency / in-shop / warranty). For emergency, also ask for delivery channel (Remote / Onsite / In-Shop) if not stated — it determines `price_retail` and cannot be assumed. Then fetch:
```bash
TICKET=$(curl -s "${BASE}/tickets/${ID}?api_key=${API_KEY}")