From 1fe942c109877f442418a552962467028077a15b Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 10 Jun 2026 07:05:21 -0500 Subject: [PATCH] fix(checkout): don't skip ERPNext SO for synthetic@pipeline.com (real customers use it) ensureComplianceSalesOrder skipped the FMCSA-census placeholder email, but a real paying customer (Paul Wilson) genuinely uses synthetic@pipeline.com, so his SO never got created/regenerated. A Sales Order is internal bookkeeping, not an outbound email, so the placeholder skip is unnecessary here (the email/portal guard in ensureCompliancePortalUser still protects actual sends). --- api/src/routes/checkout.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index 5d8f4fe..8793623 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -300,7 +300,11 @@ export async function ensureComplianceSalesOrder( const first = rows[0]; const email = ((first.customer_email as string) || "").toLowerCase().trim(); const name = (first.customer_name as string) || email.split("@")[0] || "Customer"; - if (!email || email === "synthetic@pipeline.com") return; + // NOTE: unlike portal provisioning, we do NOT skip the FMCSA-census placeholder + // email here -- a Sales Order is internal bookkeeping (not an outbound email), + // and some real customers genuinely use that address. We only need a non-empty + // email to attach an ERPNext Customer. + if (!email) return; const { customerName: erpnextCustomer } = await findOrCreateCustomer(email, name); if (!erpnextCustomer) return;