@flowselections/floriday-verkoop-module 1.0.42 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts +5 -2
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.js +27 -13
- package/dist-lib/components/verkoop/VerkoopOrdersPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/VerkoopOrdersPage.js +114 -35
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +571 -12
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +571 -12
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +571 -12
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +594 -13
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +3 -0
- package/dist-lib/lib/cart-lock.functions.d.ts +571 -12
- package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-planning-settings.functions.d.ts +6281 -132
- package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -1
- package/dist-lib/lib/cart-replan.functions.d.ts +1713 -36
- package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.d.ts +31355 -193
- package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
- package/dist-lib/lib/create-order.functions.js +18 -1
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +1713 -36
- package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +571 -12
- package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-mirror.functions.d.ts +571 -12
- package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-mirror.functions.js +6 -1
- package/dist-lib/lib/floriday-public.functions.d.ts +3997 -84
- package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-writes.functions.d.ts +2855 -60
- package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.functions.d.ts +2284 -48
- package/dist-lib/lib/invoice-timing.functions.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.server.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.server.js +1 -0
- package/dist-lib/lib/load-carriers.functions.d.ts +571 -12
- package/dist-lib/lib/load-carriers.functions.d.ts.map +1 -1
- package/dist-lib/lib/logistics-engine.functions.d.ts +2855 -60
- package/dist-lib/lib/logistics-engine.functions.d.ts.map +1 -1
- package/dist-lib/lib/logistics-stock.functions.d.ts +1142 -24
- package/dist-lib/lib/logistics-stock.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-addresses.functions.d.ts +571 -12
- package/dist-lib/lib/order-addresses.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-buffers.functions.d.ts +1713 -36
- package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-cancel.server.d.ts +24 -0
- package/dist-lib/lib/order-cancel.server.d.ts.map +1 -0
- package/dist-lib/lib/order-cancel.server.js +130 -0
- package/dist-lib/lib/order-carrier.functions.d.ts +1142 -24
- package/dist-lib/lib/order-carrier.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-pickup.functions.d.ts +1142 -24
- package/dist-lib/lib/order-pickup.functions.d.ts.map +1 -1
- package/dist-lib/lib/order-shipments.functions.d.ts +2284 -48
- package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.functions.d.ts +571 -12
- package/dist-lib/lib/salesorders-list.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.server.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.server.js +4 -60
- package/dist-lib/lib/salesorders.functions.d.ts +2855 -60
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
- package/dist-lib/lib/tradeitems.functions.d.ts +571 -12
- package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -238,26 +238,9 @@ export async function buildSalesOrdersList(supabase, params) {
|
|
|
238
238
|
warnings.push(`Verzendmomenten niet geladen: ${e.message}`);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
// 4) Mailbox-voorstellen
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
let pq = supabase
|
|
245
|
-
.from("mailbox_order_proposals")
|
|
246
|
-
.select("id, order_number, status, delivery_date, created_order_id, created_at, matched_customer_id, mailbox_messages(from_name, from_email, subject, received_at), mailbox_proposal_lines(raw_product_text, quantity, unit)")
|
|
247
|
-
.neq("status", "rejected")
|
|
248
|
-
.order("created_at", { ascending: false })
|
|
249
|
-
.limit(PROPOSAL_CAP);
|
|
250
|
-
if (params.since && params.until && params.dateField === "ordered") {
|
|
251
|
-
pq = pq.gte("created_at", params.since).lt("created_at", params.until);
|
|
252
|
-
}
|
|
253
|
-
const pr = await pq;
|
|
254
|
-
if (pr.error)
|
|
255
|
-
throw new Error(pr.error.message);
|
|
256
|
-
proposalRows = (pr.data ?? []);
|
|
257
|
-
}
|
|
258
|
-
catch (e) {
|
|
259
|
-
warnings.push(`Mailbox-voorstellen niet geladen: ${e.message}`);
|
|
260
|
-
}
|
|
241
|
+
// 4) Mailbox-voorstellen worden hier bewust NIET getoond: een voorstel is nog
|
|
242
|
+
// geen bestelling. Pas na bevestiging in de mailbox-module ontstaat er een
|
|
243
|
+
// echte order, en die komt via het lokale-orderpad in deze lijst.
|
|
261
244
|
// 5) Referentiedata — alleen wat nodig is voor deze rijen.
|
|
262
245
|
const neededOrgIds = Array.from(new Set(foRows.map((r) => String(r?.data?.customerOrganizationId ?? "")).filter((s) => s.length > 0)));
|
|
263
246
|
const neededCustomerIds = Array.from(new Set(localOrderRows.map((r) => String(r.customer_id ?? "")).filter((s) => s.length > 0)));
|
|
@@ -578,46 +561,7 @@ export async function buildSalesOrdersList(supabase, params) {
|
|
|
578
561
|
bufferId: bufferByLocalId.get(String(r.id)) ?? null,
|
|
579
562
|
});
|
|
580
563
|
}
|
|
581
|
-
// 11) Mailbox-voorstellen
|
|
582
|
-
for (const p of proposalRows) {
|
|
583
|
-
if (p.created_order_id && includedOrderIds.has(String(p.created_order_id)))
|
|
584
|
-
continue;
|
|
585
|
-
const msgRaw = p.mailbox_messages;
|
|
586
|
-
const msg = Array.isArray(msgRaw) ? msgRaw[0] : msgRaw;
|
|
587
|
-
const lines = Array.isArray(p.mailbox_proposal_lines) ? p.mailbox_proposal_lines : [];
|
|
588
|
-
const firstLine = lines[0] ?? null;
|
|
589
|
-
const matchedCustomerId = p.matched_customer_id ? String(p.matched_customer_id) : "";
|
|
590
|
-
const matchedCustomer = matchedCustomerId ? localCustomerLookup.get(matchedCustomerId) : undefined;
|
|
591
|
-
const quantity = Number(firstLine?.quantity ?? 1) || 1;
|
|
592
|
-
localOrders.push({
|
|
593
|
-
id: `mailbox-proposal:${p.id}`,
|
|
594
|
-
orderNumber: centralOrderNumber(p.order_number),
|
|
595
|
-
productName: pickString(firstLine?.raw_product_text) ?? pickString(msg?.subject) ?? "Mailbox-bestelling",
|
|
596
|
-
sku: "Mailbox-bestelling",
|
|
597
|
-
imageUrl: null,
|
|
598
|
-
orderedAt: msg?.received_at ?? p.created_at ?? "",
|
|
599
|
-
deliveryAt: p.delivery_date ?? "",
|
|
600
|
-
quantity: { multiplier: quantity, count: 1, unitPrice: 0 },
|
|
601
|
-
revenue: 0,
|
|
602
|
-
fustCount: 0,
|
|
603
|
-
karCount: quantity > 0 ? 1 : 0,
|
|
604
|
-
totalPieces: quantity,
|
|
605
|
-
isLocal: true,
|
|
606
|
-
customer: {
|
|
607
|
-
name: matchedCustomer?.name ?? msg?.from_name ?? msg?.from_email ?? "Onbekende klant",
|
|
608
|
-
postalCode: "",
|
|
609
|
-
city: matchedCustomer?.city ?? "",
|
|
610
|
-
logoUrl: null,
|
|
611
|
-
},
|
|
612
|
-
status: statusFlags(p.status),
|
|
613
|
-
stage: "incoming",
|
|
614
|
-
incomplete: [
|
|
615
|
-
...(matchedCustomer ? [] : ["geen klant gekoppeld"]),
|
|
616
|
-
...(p.delivery_date ? [] : ["geen leverdatum"]),
|
|
617
|
-
],
|
|
618
|
-
raw: { order: { status: p.status ?? null }, customer: null, tradeItem: null },
|
|
619
|
-
});
|
|
620
|
-
}
|
|
564
|
+
// 11) (vervallen) Mailbox-voorstellen worden niet meer als rij getoond.
|
|
621
565
|
// 12) Samenvoegen, buffergroottes, sorteren.
|
|
622
566
|
const all = [...localOrders, ...floridayOrders].sort((a, b) => (b.orderedAt ?? "").localeCompare(a.orderedAt ?? ""));
|
|
623
567
|
const sizeByBuffer = new Map();
|