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).
This commit is contained in:
parent
7708086130
commit
1fe942c109
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue