[object Object]

← back to Filemaker Mcp

sync: every order now auto-creates client + full invoice (Otto/FedEx/tax/resale/SKU/WC-PATTERN/paid) + Slack #general alert; invoice 102262 fully built per Steve specs

b60dfd520b06e927c452fa22dc10f648f2e80435 · 2026-06-29 12:19:22 -0700 · Steve

Files touched

Diff

commit b60dfd520b06e927c452fa22dc10f648f2e80435
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jun 29 12:19:22 2026 -0700

    sync: every order now auto-creates client + full invoice (Otto/FedEx/tax/resale/SKU/WC-PATTERN/paid) + Slack #general alert; invoice 102262 fully built per Steve specs
---
 lib/invoice-core.js | 3 ++-
 lib/sync-core.js    | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/invoice-core.js b/lib/invoice-core.js
index 465ec4d..2db49ce 100644
--- a/lib/invoice-core.js
+++ b/lib/invoice-core.js
@@ -79,10 +79,11 @@ export async function createInvoiceForOrder(order, accountNumber, { commit=true
     await set(HDR,`NET 1(${r})`,price);
     await set(HDR,`Sidemark 1(${r})`,s.company||'');
   }
-  // 4) middle SKU + WC PATTERN (primary line)
+  // 4) middle SKU + WC PATTERN (primary line) + resale card lookup
   const primary=lines[0]||{};
   await set(SKU_LAY,'JS Easy SKU #',baseSku(primary.sku));
   await set(WCP_LAY,'wc pattern',sampleStrip(primary.sku));
+  await set(RESALE_LAY,'Resale card lookup',resaleFor(s));
 
   // 5) paid-in-full from the computed grand total, then the import stamp
   let grand=0;
diff --git a/lib/sync-core.js b/lib/sync-core.js
index 9692494..dca414c 100644
--- a/lib/sync-core.js
+++ b/lib/sync-core.js
@@ -83,13 +83,14 @@ export async function syncOrder(order, { commit = true } = {}) {
   }
 
   // 2) invoice
-  const { createInvoiceForOrder, postSlackOrder } = await import('./invoice-core.js');
+  const { createInvoiceForOrder } = await import('./invoice.js');
   const inv = await createInvoiceForOrder(order, accountNumber, { commit });
 
   // 3) Slack alert (only on real commit)
   let slack = null;
   if (commit) {
-    try { slack = await postSlackOrder({ order, invoiceNumber: inv.invoiceNumber, clientName: mapped.fields['Company'] }); }
+    const { postOrderToSlack } = await import('./notify.js');
+    try { slack = await postOrderToSlack({ order, invoiceNumber: inv.invoiceNumber, total: inv.grandTotal, clientName: mapped.fields['Company'] }); }
     catch (e) { slack = { ok: false, error: e.message }; }
   }
 

← 8f367cd auto-save: 2026-06-29T12:19:02 (5 files) — bin/shopify-sync.  ·  back to Filemaker Mcp  ·  sync: every new order now auto-creates client + full invoice e2e050f →