@flowselections/floriday-verkoop-module 1.0.132 → 1.0.134
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/CreateOrderPage.d.ts.map +1 -1
- package/dist-lib/components/verkoop/CreateOrderPage.js +4 -1
- package/dist-lib/components/verkoop/InvoiceSignoffSettings.d.ts +2 -0
- package/dist-lib/components/verkoop/InvoiceSignoffSettings.d.ts.map +1 -0
- package/dist-lib/components/verkoop/InvoiceSignoffSettings.js +31 -0
- package/dist-lib/components/verkoop/OrderInvoiceCard.d.ts +4 -0
- package/dist-lib/components/verkoop/OrderInvoiceCard.d.ts.map +1 -0
- package/dist-lib/components/verkoop/OrderInvoiceCard.js +62 -0
- package/dist-lib/components/verkoop/SalesOrderDetailView.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrderDetailView.js +3 -2
- package/dist-lib/components/verkoop/SalesOrdersTable.d.ts.map +1 -1
- package/dist-lib/components/verkoop/SalesOrdersTable.js +3 -2
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/index.js +2 -0
- package/dist-lib/integrations/supabase/types.d.ts +18 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/delivery-location.server.d.ts.map +1 -1
- package/dist-lib/lib/delivery-location.server.js +56 -13
- package/dist-lib/lib/erp-invoice-view.check.d.ts +2 -0
- package/dist-lib/lib/erp-invoice-view.check.d.ts.map +1 -0
- package/dist-lib/lib/erp-invoice-view.check.js +32 -0
- package/dist-lib/lib/erp-invoice-view.d.ts +29 -0
- package/dist-lib/lib/erp-invoice-view.d.ts.map +1 -0
- package/dist-lib/lib/erp-invoice-view.js +53 -0
- package/dist-lib/lib/invoice-release.check.d.ts +2 -0
- package/dist-lib/lib/invoice-release.check.d.ts.map +1 -0
- package/dist-lib/lib/invoice-release.check.js +21 -0
- package/dist-lib/lib/invoice-signoff-payload.check.d.ts +2 -0
- package/dist-lib/lib/invoice-signoff-payload.check.d.ts.map +1 -0
- package/dist-lib/lib/invoice-signoff-payload.check.js +27 -0
- package/dist-lib/lib/invoice-signoff-payload.d.ts +4 -0
- package/dist-lib/lib/invoice-signoff-payload.d.ts.map +1 -0
- package/dist-lib/lib/invoice-signoff-payload.js +5 -0
- package/dist-lib/lib/invoice-timing.d.ts +35 -0
- package/dist-lib/lib/invoice-timing.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.functions.d.ts +16 -2
- package/dist-lib/lib/invoice-timing.functions.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.functions.js +33 -2
- package/dist-lib/lib/invoice-timing.js +29 -0
- package/dist-lib/lib/invoice-timing.server.d.ts +19 -3
- package/dist-lib/lib/invoice-timing.server.d.ts.map +1 -1
- package/dist-lib/lib/invoice-timing.server.js +75 -11
- package/dist-lib/lib/module-version.d.ts +1 -1
- package/dist-lib/lib/module-version.js +1 -1
- package/dist-lib/lib/plan-coverage-v204.check.js +2 -0
- package/dist-lib/lib/plan-coverage.d.ts +9 -2
- package/dist-lib/lib/plan-coverage.d.ts.map +1 -1
- package/dist-lib/lib/plan-coverage.js +15 -3
- package/dist-lib/lib/product-oordeel.d.ts +12 -0
- package/dist-lib/lib/product-oordeel.d.ts.map +1 -0
- package/dist-lib/lib/product-oordeel.js +24 -0
- package/dist-lib/lib/product-plannable.functions.d.ts +2 -0
- package/dist-lib/lib/product-plannable.functions.d.ts.map +1 -1
- package/dist-lib/lib/product-plannable.functions.js +15 -9
- package/dist-lib/lib/salesorders-list.functions.d.ts +1 -1
- package/dist-lib/lib/salesorders-list.server.d.ts.map +1 -1
- package/dist-lib/lib/salesorders-list.server.js +6 -1
- package/dist-lib/lib/salesorders-mapping.d.ts +4 -0
- package/dist-lib/lib/salesorders-mapping.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
- package/dist-lib/lib/salesorders.functions.js +4 -1
- package/package.json +1 -1
- package/schema/verkoop.sql +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrderPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/CreateOrderPage.tsx"],"names":[],"mappings":"AAmGA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"CreateOrderPage.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/CreateOrderPage.tsx"],"names":[],"mappings":"AAmGA,wBAAgB,eAAe,gCAymC9B"}
|
|
@@ -186,6 +186,8 @@ export function CreateOrderPage() {
|
|
|
186
186
|
cratesPerLayer: eff?.crates_per_layer ?? null,
|
|
187
187
|
layersPerCart: eff?.layers_per_cart ?? null,
|
|
188
188
|
isDefault: !!eff && !!def && beladingKey(eff) === beladingKey(def),
|
|
189
|
+
// Code op de regel, anders die van de standaardverpakking; ongewijzigd doorsturen.
|
|
190
|
+
carrierCode: l.belading?.cart_code ?? def?.cart_code ?? null,
|
|
189
191
|
}];
|
|
190
192
|
}),
|
|
191
193
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -205,6 +207,7 @@ export function CreateOrderPage() {
|
|
|
205
207
|
});
|
|
206
208
|
const impossibleByLine = plannableQ.data?.impossibleByLine ?? {};
|
|
207
209
|
const missingByProduct = plannableQ.data?.missing ?? {};
|
|
210
|
+
const missingByLine = plannableQ.data?.missingByLine ?? {};
|
|
208
211
|
const beladingByProduct = beladingQ.data?.byProduct ?? {};
|
|
209
212
|
// Zodra de lijst binnen is: zorg dat de gekozen belading een geldige optie is.
|
|
210
213
|
useEffect(() => {
|
|
@@ -678,7 +681,7 @@ export function CreateOrderPage() {
|
|
|
678
681
|
next[idx] = { ...next[idx], unit_price: v };
|
|
679
682
|
setLines(next);
|
|
680
683
|
}, placeholder: "\u20AC prijs", "aria-invalid": !!line.product_id && !(Number(line.unit_price) > 0), title: !!line.product_id && !(Number(line.unit_price) > 0) ? "Prijs € 0" : undefined })] }), _jsx(Button, { variant: "ghost", size: "icon", className: "col-span-2 justify-self-end lg:col-span-1 lg:justify-self-auto", onClick: () => setLines(lines.filter((_, i) => i !== idx)), "aria-label": "Regel verwijderen", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }, idx));
|
|
681
|
-
}), lines.some((l, i) => l.product_id && impossibleByLine[String(i)]) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: [_jsx("div", { className: "font-medium", children: "De Engine noemt deze regels onmogelijk met de gekozen belading:" }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: lines.map((l, i) => l.product_id && impossibleByLine[String(i)] ? (_jsxs("li", { children: [l.product_name || "Product", ": ", impossibleByLine[String(i)]] }, i)) : null) })] })), lines.some((l) => l.product_id && !impossibleByLine[String(lines.indexOf(l))] && missingByProduct[l.product_id]) && (_jsxs("div", { className: "rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-foreground", children: [_jsx("div", { className: "font-medium", children: "Gegevens ontbreken voor de Engine:" }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: lines.filter((l) => l.product_id && !impossibleByLine[String(lines.indexOf(l))] && missingByProduct[l.product_id]).map((l) => (_jsxs("li", { children: [l.product_name || "Product", ": ", missingByProduct[l.product_id]] }, l.product_id))) })] })), lines.some((l) => l.product_id && !(Number(l.unit_price) > 0)) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: ["Prijs \u20AC 0: ", zeroPriceCount, " regel(s) zonder prijs. Er is geen prijs gevonden in prijsgroep of artikel. Vul de prijs in, of bevestig bij het aanmaken dat \u20AC 0 klopt."] })), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => setLines([...lines, { product_id: null, product_name: "", quantity: null, unit: "stuks", unit_price: null, belading: null }]), children: [_jsx(Plus, { className: "h-3 w-3 mr-1" }), " Regel toevoegen"] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Referentie klant" }), _jsx(Input, { value: customerReference, maxLength: 100, onChange: (e) => setCustomerReference(e.target.value), placeholder: "Optioneel, bijvoorbeeld het bestelnummer van je klant" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Opmerkingen" }), _jsx(Textarea, { value: notes, onChange: (e) => setNotes(e.target.value), placeholder: "Optionele notities bij deze bestelling", rows: 3 })] }), stockCheck && stockCheck.shortages.length > 0 && (_jsxs("div", { className: `rounded-md border p-3 text-sm ${stockBlocked
|
|
684
|
+
}), lines.some((l, i) => l.product_id && impossibleByLine[String(i)]) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: [_jsx("div", { className: "font-medium", children: "De Engine noemt deze regels onmogelijk met de gekozen belading:" }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: lines.map((l, i) => l.product_id && impossibleByLine[String(i)] ? (_jsxs("li", { children: [l.product_name || "Product", ": ", impossibleByLine[String(i)]] }, i)) : null) })] })), lines.some((l, i) => l.product_id && !impossibleByLine[String(i)] && missingByLine[String(i)]) && (_jsxs("div", { className: "rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-foreground", children: [_jsx("div", { className: "font-medium", children: "Let op (geen blokkade):" }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: lines.map((l, i) => l.product_id && !impossibleByLine[String(i)] && missingByLine[String(i)] ? (_jsxs("li", { children: [missingByLine[String(i)], " bij artikel ", l.product_name || "Product"] }, i)) : null) })] })), lines.some((l) => l.product_id && !impossibleByLine[String(lines.indexOf(l))] && missingByProduct[l.product_id]) && (_jsxs("div", { className: "rounded-md border border-border bg-muted/40 px-3 py-2 text-sm text-foreground", children: [_jsx("div", { className: "font-medium", children: "Gegevens ontbreken voor de Engine:" }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: lines.filter((l) => l.product_id && !impossibleByLine[String(lines.indexOf(l))] && missingByProduct[l.product_id]).map((l) => (_jsxs("li", { children: [l.product_name || "Product", ": ", missingByProduct[l.product_id]] }, l.product_id))) })] })), lines.some((l) => l.product_id && !(Number(l.unit_price) > 0)) && (_jsxs("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: ["Prijs \u20AC 0: ", zeroPriceCount, " regel(s) zonder prijs. Er is geen prijs gevonden in prijsgroep of artikel. Vul de prijs in, of bevestig bij het aanmaken dat \u20AC 0 klopt."] })), _jsxs(Button, { variant: "outline", size: "sm", onClick: () => setLines([...lines, { product_id: null, product_name: "", quantity: null, unit: "stuks", unit_price: null, belading: null }]), children: [_jsx(Plus, { className: "h-3 w-3 mr-1" }), " Regel toevoegen"] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Referentie klant" }), _jsx(Input, { value: customerReference, maxLength: 100, onChange: (e) => setCustomerReference(e.target.value), placeholder: "Optioneel, bijvoorbeeld het bestelnummer van je klant" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: "Opmerkingen" }), _jsx(Textarea, { value: notes, onChange: (e) => setNotes(e.target.value), placeholder: "Optionele notities bij deze bestelling", rows: 3 })] }), stockCheck && stockCheck.shortages.length > 0 && (_jsxs("div", { className: `rounded-md border p-3 text-sm ${stockBlocked
|
|
682
685
|
? "border-destructive/40 bg-destructive/5 text-destructive"
|
|
683
686
|
: "border-amber-500/40 bg-amber-500/5 text-amber-700"}`, children: [_jsx("div", { className: "font-medium", children: stockBlocked
|
|
684
687
|
? "Bestelling geblokkeerd — onvoldoende voorraad"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvoiceSignoffSettings.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/InvoiceSignoffSettings.tsx"],"names":[],"mappings":"AAoBA,wBAAgB,0BAA0B,gCAkDzC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Instellingenkaart: factuurmoment — schakelaar "Factureren zonder afmelding".
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
6
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Label, Switch, toast, } from "@flowselections/core";
|
|
7
|
+
import { Receipt } from "lucide-react";
|
|
8
|
+
import { getInvoiceTimingSettings, saveInvoiceWithoutSignoff, } from "../../lib/invoice-timing.functions.js";
|
|
9
|
+
export function InvoiceSignoffSettingsCard() {
|
|
10
|
+
const load = useServerFn(getInvoiceTimingSettings);
|
|
11
|
+
const save = useServerFn(saveInvoiceWithoutSignoff);
|
|
12
|
+
const qc = useQueryClient();
|
|
13
|
+
const [saving, setSaving] = useState(false);
|
|
14
|
+
const query = useQuery({ queryKey: ["invoice-timing-settings"], queryFn: () => load() });
|
|
15
|
+
const value = query.data?.invoiceWithoutSignoff === true;
|
|
16
|
+
async function toggle(next) {
|
|
17
|
+
setSaving(true);
|
|
18
|
+
try {
|
|
19
|
+
await save({ data: { value: next } });
|
|
20
|
+
toast.success(next ? "Factureren zonder afmelding staat aan" : "Factureren zonder afmelding staat uit");
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
toast.error(e?.message ?? "Opslaan mislukt");
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await qc.invalidateQueries({ queryKey: ["invoice-timing-settings"] });
|
|
27
|
+
setSaving(false);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx(Receipt, { className: "h-5 w-5" }), " Factuurmoment"] }), _jsx(CardDescription, { children: "Wanneer orders klaar zijn om te factureren." })] }), _jsx(CardContent, { children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "invoice-without-signoff", children: "Factureren zonder afmelding" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Orders zonder karindeling worden op het factuurmoment gefactureerd, ook zonder afmelding." }), query.isError && (_jsx("p", { className: "text-sm text-destructive", children: "Instelling kon niet worden geladen." }))] }), _jsx(Switch, { id: "invoice-without-signoff", checked: value, disabled: saving || query.isLoading || query.isError, onCheckedChange: toggle })] }) })] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderInvoiceCard.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/OrderInvoiceCard.tsx"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,sCA6EhE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { FileText } from "lucide-react";
|
|
5
|
+
import { supabase } from "../../integrations/supabase/client.js";
|
|
6
|
+
import { canOpenPdf, invoiceDisplay, rpcErrorKind } from "../../lib/erp-invoice-view.js";
|
|
7
|
+
// Factuurblok: leest alleen via de RPC's van Facturatie. Geen Facturatie,
|
|
8
|
+
// geen recht of geen facturen → het blok blijft weg, zonder foutmelding.
|
|
9
|
+
const rpc = supabase.rpc;
|
|
10
|
+
const money = new Intl.NumberFormat("nl-NL", { style: "currency", currency: "EUR" });
|
|
11
|
+
export function OrderInvoiceCard({ orderId }) {
|
|
12
|
+
const [pdfError, setPdfError] = useState(null);
|
|
13
|
+
const [busy, setBusy] = useState(null);
|
|
14
|
+
const q = useQuery({
|
|
15
|
+
queryKey: ["erp-invoices-for-order", orderId],
|
|
16
|
+
retry: false,
|
|
17
|
+
staleTime: 60000,
|
|
18
|
+
queryFn: async () => {
|
|
19
|
+
const { data, error } = await rpc("erp_invoices_for_order", { p_order_id: orderId });
|
|
20
|
+
if (error) {
|
|
21
|
+
if (rpcErrorKind(error) === "other")
|
|
22
|
+
console.warn("Facturen lezen mislukt", error.code ?? "");
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
return Array.isArray(data) ? data : [];
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const rows = q.data ?? [];
|
|
29
|
+
if (rows.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
async function openPdf(r) {
|
|
32
|
+
setPdfError(null);
|
|
33
|
+
setBusy(r.id);
|
|
34
|
+
const win = window.open("", "_blank");
|
|
35
|
+
try {
|
|
36
|
+
const { data, error } = await rpc("erp_invoice_pdf_path", { p_invoice_id: r.id });
|
|
37
|
+
const path = typeof data === "string" ? data : null;
|
|
38
|
+
if (error || !canOpenPdf(r.source, path)) {
|
|
39
|
+
win?.close();
|
|
40
|
+
setPdfError(error && rpcErrorKind(error) === "forbidden" ? "Geen recht om deze PDF te openen." : "Geen PDF beschikbaar.");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const { data: signed, error: sErr } = await supabase.storage.from("invoices").createSignedUrl(path, 300);
|
|
44
|
+
if (sErr || !signed?.signedUrl) {
|
|
45
|
+
win?.close();
|
|
46
|
+
setPdfError("PDF kon niet worden geopend.");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (win)
|
|
50
|
+
win.location.href = signed.signedUrl;
|
|
51
|
+
else
|
|
52
|
+
window.open(signed.signedUrl, "_blank", "noopener");
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setBusy(null);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return (_jsxs("div", { className: "rounded-lg border bg-card p-4", children: [_jsxs("div", { className: "mb-3 flex items-center gap-2 text-sm font-semibold", children: [_jsx(FileText, { className: "h-4 w-4 text-muted-foreground" }), " Factuur"] }), _jsx("ul", { className: "space-y-2", children: rows.map((r) => {
|
|
59
|
+
const d = invoiceDisplay(r);
|
|
60
|
+
return (_jsxs("li", { className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-sm", children: [_jsx("span", { className: "font-medium", children: d.title }), _jsx("span", { className: "font-mono", children: d.number }), d.statusLabel && _jsxs("span", { className: "text-muted-foreground", children: ["Status: ", d.statusLabel] }), d.paymentLabel && _jsxs("span", { className: "text-muted-foreground", children: ["Betaling: ", d.paymentLabel] }), d.showPdf && d.total != null && _jsx("span", { children: money.format(d.total) }), d.showPdf && (_jsx("button", { type: "button", className: "ml-auto rounded-md border px-2 py-1 text-xs hover:bg-muted disabled:opacity-50", disabled: busy === r.id, onClick: () => openPdf(r), children: "PDF openen" }))] }, r.id));
|
|
61
|
+
}) }), pdfError && _jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: pdfError })] }));
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SalesOrderDetailView.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrderDetailView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"SalesOrderDetailView.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrderDetailView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA8JnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,+BAkBA"}
|
|
@@ -10,6 +10,7 @@ import { OrderKarindelingCard } from "./OrderKarindelingCard.js";
|
|
|
10
10
|
import { OrderLinePackingCard } from "./OrderLinePackingCard.js";
|
|
11
11
|
import { OrderAfleverbrievenCard } from "./OrderAfleverbrievenCard.js";
|
|
12
12
|
import { OrderShipmentsCard } from "./OrderShipmentsCard.js";
|
|
13
|
+
import { OrderInvoiceCard } from "./OrderInvoiceCard.js";
|
|
13
14
|
import { OrderControlStatusCard } from "./OrderControlStatusCard.js";
|
|
14
15
|
import { OrderCarrierPicker } from "./OrderCarrierPicker.js";
|
|
15
16
|
import { OrderPickupMomentPicker } from "./OrderPickupMomentPicker.js";
|
|
@@ -280,7 +281,7 @@ function SalesOrderDetailViewInner({ floridayLoading, order, sellerFallback, hid
|
|
|
280
281
|
? (order.articleCount ?? 0) > 1
|
|
281
282
|
? `Gemengd (${order.articleCount} artikelen)`
|
|
282
283
|
: "Gemengd"
|
|
283
|
-
: belading }), _jsx(Row, { label: "Klant referentie", children: klantReferentie }), _jsx(Row, { label: "Floriday-referentie", children: floridayRef }), _jsx(Row, { label: "Verkoopkanaal", children: verkoopkanaal }), _jsx(Row, { label: "Financi\u00EBle afhandeling", children: financial }), _jsx(Row, { label: "Verkoper", children: sellerName ? (_jsxs("span", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground", children: initials(sellerName) }), sellerName] })) : ("—") })] }), fs && (_jsxs("div", { children: [_jsx(SectionTitle, { children: "Floriday" }), _jsx(Row, { label: "Stand", children: _jsx(FloridayStageLine, { status: fs, stage: order.stage, floridayFulfilled: order.floridayFulfilled, isFloriday: true, loading: floridayLoading }) }), _jsxs(Row, { label: "Herkomst status", children: [order.statusOrigin === "floriday" ? "Floriday" : "ERP", order.statusChangedAt ? ` · ${fmtDateTime(order.statusChangedAt)}` : ""] }), fs.entries.map((e) => (_jsx(Row, { label: `Bestelling ${e.salesOrderId.slice(0, 8)}`, children: _jsxs("div", { className: "space-y-0.5 text-sm", children: [_jsxs("div", { children: ["Floriday-status: ", e.salesOrderStatus ?? "—"] }), _jsxs("div", { children: ["Afleververzoeken: ", e.fulfillmentRequests.length, " \u00B7 Afhandelingen:", " ", e.fulfillmentOrders.length
|
|
284
|
+
: belading }), _jsx(Row, { label: "Klant referentie", children: klantReferentie }), _jsx(Row, { label: "Floriday-referentie", children: floridayRef }), _jsx(Row, { label: "Verkoopkanaal", children: verkoopkanaal }), _jsx(Row, { label: "Financi\u00EBle afhandeling", children: financial }), _jsx(Row, { label: "Verkoper", children: sellerName ? (_jsxs("span", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground", children: initials(sellerName) }), sellerName] })) : ("—") }), order.invoiceState && (_jsxs(Row, { label: "Facturatie", children: [_jsx("span", { children: order.invoiceState }), order.invoiceNote ? _jsx("span", { className: "block text-xs text-muted-foreground", children: order.invoiceNote }) : null] }))] }), fs && (_jsxs("div", { children: [_jsx(SectionTitle, { children: "Floriday" }), _jsx(Row, { label: "Stand", children: _jsx(FloridayStageLine, { status: fs, stage: order.stage, floridayFulfilled: order.floridayFulfilled, isFloriday: true, loading: floridayLoading }) }), _jsxs(Row, { label: "Herkomst status", children: [order.statusOrigin === "floriday" ? "Floriday" : "ERP", order.statusChangedAt ? ` · ${fmtDateTime(order.statusChangedAt)}` : ""] }), fs.entries.map((e) => (_jsx(Row, { label: `Bestelling ${e.salesOrderId.slice(0, 8)}`, children: _jsxs("div", { className: "space-y-0.5 text-sm", children: [_jsxs("div", { children: ["Floriday-status: ", e.salesOrderStatus ?? "—"] }), _jsxs("div", { children: ["Afleververzoeken: ", e.fulfillmentRequests.length, " \u00B7 Afhandelingen:", " ", e.fulfillmentOrders.length
|
|
284
285
|
? e.fulfillmentOrders.map((f) => f.status ?? "?").join(", ")
|
|
285
286
|
: "geen"] }), _jsxs("div", { children: ["Verkoopkanaal: ", e.salesChannel ?? "—", " \u00B7 Handelsvorm: ", e.tradeInstrument ?? "—", " \u00B7 Incoterm: ", e.incoterm ?? "niet opgegeven"] }), _jsxs("div", { children: ["Klantreferentie: ", e.customerOrderId ?? "—", " \u00B7 Floriday-referentie: ", e.salesChannelOrderId ?? "—"] }), _jsxs("div", { children: ["Koper: ", e.customerOrganizationId ?? "—", " \u00B7 GLN: ", e.customerGln ?? "—"] }), _jsxs("div", { className: "text-xs text-muted-foreground", children: ["Laatst gewijzigd: ", e.lastModifiedDateTime ? fmtDateTime(e.lastModifiedDateTime) : "—", " \u00B7 Ververst: ", e.cachedAt ? fmtDateTime(e.cachedAt) : "—"] })] }) }, e.salesOrderId)))] })), _jsxs("div", { children: [_jsx(SectionTitle, { children: "Levering" }), _jsx(Row, { label: "Afleverdatum", children: fmtDateTime(order.deliveryAt) }), _jsx(Row, { label: "Incoterm", children: incoterm }), _jsx(Row, { label: "Afleveradres", children: _jsx(AddressCard, { icon: _jsx(MapPin, { className: "h-5 w-5" }), lines: resolvedAddresses?.delivery
|
|
286
287
|
? [
|
|
@@ -304,5 +305,5 @@ function SalesOrderDetailViewInner({ floridayLoading, order, sellerFallback, hid
|
|
|
304
305
|
.join(" "),
|
|
305
306
|
resolvedAddresses.pickup.country,
|
|
306
307
|
].filter((v) => !!v && v.trim().length > 0)
|
|
307
|
-
: [], extra: resolvedAddresses?.pickup?.gln ?? null }) }), _jsx(Row, { label: "Vervoerder", children: _jsx(OrderCarrierPicker, { orderId: String(order.id), locked: !!order.isReservation }) }), _jsx(Row, { label: "Ophaalmoment", children: _jsx(OrderPickupMomentPicker, { orderId: String(order.id) }) })] }), _jsxs("div", { children: [_jsx(SectionTitle, { children: "Klant" }), _jsxs(Row, { label: "Naam", children: [_jsx("span", { className: "font-medium", children: customerName }), customerLegalName && (_jsx("div", { className: "text-xs text-muted-foreground", children: customerLegalName }))] }), !fs && (order.floridayIds?.length ?? 0) > 0 && (_jsx(FloridayStageLine, { status: null, stage: order.stage, floridayFulfilled: order.floridayFulfilled, isFloriday: true })), _jsx(Row, { label: "GLN", children: customerGln }), _jsx(Row, { label: "Administratienummer", children: customerAdmin }), _jsx(Row, { label: "Telefoonnummer", children: customerPhone })] })] }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "rounded-md border border-border p-4", children: [_jsx("div", { className: "mb-3 text-sm font-semibold", children: "Prijs per stuk" }), _jsxs("div", { className: "space-y-2 text-sm", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Product" }), _jsxs("span", { children: [oldProductPrice !== null && (_jsx("span", { className: "mr-2 text-destructive line-through", children: eurFlex.format(oldProductPrice) })), eurFlex.format(productUnit)] })] }), _jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Transportkosten" }), _jsx("span", { children: eurFlex.format(transportPerPiece) })] }), _jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Inkoopprijs" }), _jsx("span", { children: eurFlex.format(purchaseUnit) })] }), _jsxs("div", { className: "mt-2 flex justify-between border-t border-border pt-2 font-semibold", children: [_jsx("span", { children: "Totaal" }), _jsxs("span", { children: [_jsx("span", { className: "mr-2 text-xs font-normal text-muted-foreground", children: totalBreakdown ? `(${totalBreakdown})` : null }), eurFlex.format(totalAmount)] })] }), (order.missingPrice || (linesWithoutPrice > 0 && !fs)) && (_jsxs("div", { className: "mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs text-destructive", children: ["Geen prijs: ", linesWithoutPrice || "een of meer", " regel(s) zonder prijs. Vul de prijs in voordat de order wordt bevestigd."] }))] })] }), _jsxs("div", { className: "rounded-md border border-border p-4", children: [_jsx("div", { className: "mb-3 text-sm font-semibold", children: "Status" }), _jsxs("div", { className: "space-y-3 text-sm", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Bestelling" }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${orderStageBadgeClass(order.stage ?? "incoming")}`, children: bestellingLabel })] }), order.customerReference && (_jsxs("div", { className: "text-xs text-muted-foreground", children: ["Referentie klant: ", _jsx("span", { className: "font-medium text-foreground", children: order.customerReference })] })), order.floridayMissingLineKeyNotice && (_jsx("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs text-destructive", children: order.floridayMissingLineKeyNotice })), order.floridayExternalFulfilledAt ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Afhandeling" }), _jsxs("span", { className: "text-xs text-foreground", children: ["Afgehandeld in Floriday (niet via het ERP) \u00B7 ", formatMoment(order.floridayExternalFulfilledAt)] })] })) : (order.floridayExternalFulfilledIds?.length ?? 0) > 0 ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Afhandeling" }), _jsxs("span", { className: "text-xs text-foreground", children: [order.floridayExternalFulfilledIds.length, " bestelling(en) afgehandeld in Floriday; de rest loopt door"] })] })) : null, order.floridayFulfilled && (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Floriday" }), _jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground", title: "Administratief doorgegeven aan Floriday. Dit bepaalt de orderstatus niet.", children: "Doorgegeven aan Floriday" })] })), hasCorrection && (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Correctie" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 text-emerald-600" }), "Correctie is verwerkt"] })] }))] })] })] })] }), _jsx(OrderLinePackingCard, { orderId: String(order.id) }), _jsx(OrderShipmentsCard, { order: order }), !hideKarindeling && _jsx(OrderKarindelingCard, { order: order }), o?.salesOrderId ? (_jsxs(_Fragment, { children: [_jsx(OrderControlStatusCard, { floridayId: String(o.salesOrderId), isControlled: order.status.isControlled, controlledAt: order.status.controlledAt }), _jsx(OrderAfleverbrievenCard, { salesOrderId: String(o.salesOrderId), orderNumber: order.orderNumber ?? undefined })] })) : null] }));
|
|
308
|
+
: [], extra: resolvedAddresses?.pickup?.gln ?? null }) }), _jsx(Row, { label: "Vervoerder", children: _jsx(OrderCarrierPicker, { orderId: String(order.id), locked: !!order.isReservation }) }), _jsx(Row, { label: "Ophaalmoment", children: _jsx(OrderPickupMomentPicker, { orderId: String(order.id) }) })] }), _jsxs("div", { children: [_jsx(SectionTitle, { children: "Klant" }), _jsxs(Row, { label: "Naam", children: [_jsx("span", { className: "font-medium", children: customerName }), customerLegalName && (_jsx("div", { className: "text-xs text-muted-foreground", children: customerLegalName }))] }), !fs && (order.floridayIds?.length ?? 0) > 0 && (_jsx(FloridayStageLine, { status: null, stage: order.stage, floridayFulfilled: order.floridayFulfilled, isFloriday: true })), _jsx(Row, { label: "GLN", children: customerGln }), _jsx(Row, { label: "Administratienummer", children: customerAdmin }), _jsx(Row, { label: "Telefoonnummer", children: customerPhone })] })] }), _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "rounded-md border border-border p-4", children: [_jsx("div", { className: "mb-3 text-sm font-semibold", children: "Prijs per stuk" }), _jsxs("div", { className: "space-y-2 text-sm", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Product" }), _jsxs("span", { children: [oldProductPrice !== null && (_jsx("span", { className: "mr-2 text-destructive line-through", children: eurFlex.format(oldProductPrice) })), eurFlex.format(productUnit)] })] }), _jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Transportkosten" }), _jsx("span", { children: eurFlex.format(transportPerPiece) })] }), _jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: "Inkoopprijs" }), _jsx("span", { children: eurFlex.format(purchaseUnit) })] }), _jsxs("div", { className: "mt-2 flex justify-between border-t border-border pt-2 font-semibold", children: [_jsx("span", { children: "Totaal" }), _jsxs("span", { children: [_jsx("span", { className: "mr-2 text-xs font-normal text-muted-foreground", children: totalBreakdown ? `(${totalBreakdown})` : null }), eurFlex.format(totalAmount)] })] }), (order.missingPrice || (linesWithoutPrice > 0 && !fs)) && (_jsxs("div", { className: "mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs text-destructive", children: ["Geen prijs: ", linesWithoutPrice || "een of meer", " regel(s) zonder prijs. Vul de prijs in voordat de order wordt bevestigd."] }))] })] }), _jsxs("div", { className: "rounded-md border border-border p-4", children: [_jsx("div", { className: "mb-3 text-sm font-semibold", children: "Status" }), _jsxs("div", { className: "space-y-3 text-sm", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Bestelling" }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs font-medium ${orderStageBadgeClass(order.stage ?? "incoming")}`, children: bestellingLabel })] }), order.customerReference && (_jsxs("div", { className: "text-xs text-muted-foreground", children: ["Referentie klant: ", _jsx("span", { className: "font-medium text-foreground", children: order.customerReference })] })), order.floridayMissingLineKeyNotice && (_jsx("div", { className: "rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs text-destructive", children: order.floridayMissingLineKeyNotice })), order.floridayExternalFulfilledAt ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Afhandeling" }), _jsxs("span", { className: "text-xs text-foreground", children: ["Afgehandeld in Floriday (niet via het ERP) \u00B7 ", formatMoment(order.floridayExternalFulfilledAt)] })] })) : (order.floridayExternalFulfilledIds?.length ?? 0) > 0 ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Afhandeling" }), _jsxs("span", { className: "text-xs text-foreground", children: [order.floridayExternalFulfilledIds.length, " bestelling(en) afgehandeld in Floriday; de rest loopt door"] })] })) : null, order.floridayFulfilled && (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Floriday" }), _jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground", title: "Administratief doorgegeven aan Floriday. Dit bepaalt de orderstatus niet.", children: "Doorgegeven aan Floriday" })] })), hasCorrection && (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-muted-foreground", children: "Correctie" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 text-emerald-600" }), "Correctie is verwerkt"] })] }))] })] })] })] }), _jsx(OrderLinePackingCard, { orderId: String(order.id) }), _jsx(OrderShipmentsCard, { order: order }), _jsx(OrderInvoiceCard, { orderId: String(order.id) }), !hideKarindeling && _jsx(OrderKarindelingCard, { order: order }), o?.salesOrderId ? (_jsxs(_Fragment, { children: [_jsx(OrderControlStatusCard, { floridayId: String(o.salesOrderId), isControlled: order.status.isControlled, controlledAt: order.status.controlledAt }), _jsx(OrderAfleverbrievenCard, { salesOrderId: String(o.salesOrderId), orderNumber: order.orderNumber ?? undefined })] })) : null] }));
|
|
308
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SalesOrdersTable.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrdersTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAyBjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"SalesOrdersTable.d.ts","sourceRoot":"","sources":["../../../src/components/verkoop/SalesOrdersTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAyBjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAkHnE,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAG1D;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC7C,qBAuWA"}
|
|
@@ -65,7 +65,7 @@ function StatusTag({ order }) {
|
|
|
65
65
|
? "Leverdatum is voorbij, maar de order is nog niet gepickt."
|
|
66
66
|
: "Leverdatum is voorbij, maar de order is nog niet gepickt.", children: order.backlogDays != null
|
|
67
67
|
? `Achterstand · ${order.backlogDays} ${order.backlogDays === 1 ? "dag" : "dagen"}`
|
|
68
|
-
: "Achterstand" })), !order.backlog && order.backlogUnknown && (_jsx(Badge, { variant: "outline", className: "border-transparent bg-muted text-[11px] font-normal text-muted-foreground", title: "De achterstand kon niet bij de Logistiek Engine worden opgevraagd", children: "achterstand onbekend" }))] }));
|
|
68
|
+
: "Achterstand" })), !order.backlog && order.backlogUnknown && (_jsx(Badge, { variant: "outline", className: "border-transparent bg-muted text-[11px] font-normal text-muted-foreground", title: "De achterstand kon niet bij de Logistiek Engine worden opgevraagd", children: "achterstand onbekend" })), order.invoiceState && (_jsx(Badge, { variant: "outline", className: "border-transparent bg-muted text-[11px] font-normal text-muted-foreground", title: order.invoiceNote ?? "Factuurstand; de orderstatus blijft de logistieke stand", children: order.invoiceState }))] }));
|
|
69
69
|
}
|
|
70
70
|
/** Stabiele rij-id: buffers zijn serverside al samengevouwen tot één rij. */
|
|
71
71
|
export function salesOrderRowId(row) {
|
|
@@ -129,7 +129,8 @@ export function SalesOrdersTable({ orders, loading, onSelectOrder, onDeleteOrder
|
|
|
129
129
|
.map((u) => `${u.name} (trade-item ${u.tradeItemId ?? "onbekend"})`)
|
|
130
130
|
.join("\n"), children: [_jsx(AlertTriangle, { className: "mt-0.5 h-3 w-3 shrink-0" }), _jsxs("span", { children: ["Floriday-artikel niet gekoppeld aan product:", " ", row.unlinkedProducts
|
|
131
131
|
.map((u) => `${u.name} (trade-item ${u.tradeItemId ?? "onbekend"})`)
|
|
132
|
-
.join(", ")] })] }))] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: row.karUnknown ? (_jsx("span", { className: "text-muted-foreground", children: "Karren onbekend" })) : row.engineCounts && row.karCount > 0 ? (_jsxs(_Fragment, { children: [formatLoadUnits(row.karCount, row.cartTypeName), row.karShared && isBuffer && (_jsx("span", { className: "ml-1 text-xs font-normal text-muted-foreground", children: "(gedeeld met gecombineerde order)" }))] })) : (_jsx("span", { className: "text-muted-foreground", children: "\u2014" })) }), _jsx(PlanCoverageBadge, { coverage: row.planCoverage }), _jsx(FloridayStageLine, { status: statusOf(row).status, loading: statusOf(row).loading, stage: row.stage, floridayFulfilled: isBuffer ? !row.notReportedToFloriday : row.floridayFulfilled, isFloriday: !!row.notReportedToFloriday || (row.floridayIds?.length ?? 0) > 0, notReportedCount: row.notReportedCount, bufferSize: bufferSize })] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: formatLoadUnits(row.fustCount, row.mixedPacking ? null : row.crateTypeName) }), row.mixedPacking && (row.articleCount ?? 0) > 1 && (_jsxs("div", { className: "text-xs text-muted-foreground", children: ["Gemengd (", row.articleCount, " artikelen)"] }))] }), _jsx(TableCell, { className: "text-sm text-foreground", children: row.carrierState === "geen" ? (_jsx("a", { href: "/afhandeling/vervoerders", onClick: (e) => e.stopPropagation(), className: "text-xs text-destructive underline", title: row.carrierReason ?? undefined, children: "Geen vervoerder \u2013 stel in bij Afhandeling \u2192 Vervoerders" })) : (_jsxs("div", { title: row.carrierReason ?? undefined, children: [_jsx("div", { children: row.carrierName || _jsx("span", { className: "text-muted-foreground", children: "onbekend" }) }), (row.carrierSource || row.carrierBadge) && (_jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [row.carrierSource &&
|
|
132
|
+
.join(", ")] })] }))] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: row.karUnknown ? (_jsx("span", { className: "text-muted-foreground", children: "Karren onbekend" })) : row.engineCounts && row.karCount > 0 ? (_jsxs(_Fragment, { children: [formatLoadUnits(row.karCount, row.cartTypeName), row.karShared && isBuffer && (_jsx("span", { className: "ml-1 text-xs font-normal text-muted-foreground", children: "(gedeeld met gecombineerde order)" }))] })) : (_jsx("span", { className: "text-muted-foreground", children: "\u2014" })) }), _jsx(PlanCoverageBadge, { coverage: row.planCoverage }), _jsx(FloridayStageLine, { status: statusOf(row).status, loading: statusOf(row).loading, stage: row.stage, floridayFulfilled: isBuffer ? !row.notReportedToFloriday : row.floridayFulfilled, isFloriday: !!row.notReportedToFloriday || (row.floridayIds?.length ?? 0) > 0, notReportedCount: row.notReportedCount, bufferSize: bufferSize })] }), _jsxs(TableCell, { children: [_jsx("div", { className: "font-medium text-foreground", children: formatLoadUnits(row.fustCount, row.mixedPacking ? null : row.crateTypeName) }), row.mixedPacking && (row.articleCount ?? 0) > 1 && (_jsxs("div", { className: "text-xs text-muted-foreground", children: ["Gemengd (", row.articleCount, " artikelen)"] }))] }), _jsx(TableCell, { className: "text-sm text-foreground", children: row.carrierState === "geen" ? (_jsx("a", { href: "/afhandeling/vervoerders", onClick: (e) => e.stopPropagation(), className: "text-xs text-destructive underline", title: row.carrierReason ?? undefined, children: "Geen vervoerder \u2013 stel in bij Afhandeling \u2192 Vervoerders" })) : (_jsxs("div", { title: row.carrierReason ?? undefined, children: [_jsx("div", { children: row.carrierName || _jsx("span", { className: "text-muted-foreground", children: "onbekend" }) }), (row.carrierSource || row.carrierBadge) && (_jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [row.carrierSource &&
|
|
133
|
+
row.carrierSource.trim().toLowerCase() !== (row.carrierBadge ?? "").trim().toLowerCase() && (_jsx("span", { children: row.carrierSource })), row.carrierBadge && (_jsx("span", { className: "rounded border border-border bg-muted px-1 text-[10px] uppercase tracking-wide", children: row.carrierBadge }))] }))] })) }), _jsx(TableCell, { children: _jsx(StatusTag, { order: row }) }), showRevenue && (_jsxs(TableCell, { className: "font-medium text-foreground", children: ["\u20AC ", Math.round(row.revenue ?? 0).toLocaleString("nl-NL")] })), _jsxs(TableCell, { children: [_jsx("div", { className: "text-sm text-foreground", children: ordered.date }), _jsx("div", { className: "text-xs text-muted-foreground", children: isBuffer
|
|
133
134
|
? `${bufferSize} orders`
|
|
134
135
|
: row.orderNumber || ordered.time })] }), _jsx(TableCell, { onClick: (e) => e.stopPropagation(), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(MoreVertical, { className: "h-4 w-4" }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { disabled: isBuffer || !row.isLocal, onClick: () => !isBuffer && row.isLocal && onEditOrder?.(row), title: isBuffer
|
|
135
136
|
? "Een gecombineerde order kun je niet in één keer bewerken."
|
package/dist-lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAIvE,eAAO,MAAM,qBAAqB,EAAE,UAqBnC,CAAC"}
|
package/dist-lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ShoppingCart, ListOrdered } from "lucide-react";
|
|
2
2
|
import { ProductDimensionsSettingsCard } from "./components/verkoop/ProductDimensionsSettings.js";
|
|
3
|
+
import { InvoiceSignoffSettingsCard } from "./components/verkoop/InvoiceSignoffSettings.js";
|
|
3
4
|
export * from "./_core-safelist.js";
|
|
4
5
|
export { VerkoopOrdersPage } from "./components/verkoop/VerkoopOrdersPage.js";
|
|
5
6
|
export { SalesOrderDetailPage } from "./components/verkoop/SalesOrderDetailPage.js";
|
|
@@ -22,5 +23,6 @@ export const floridayVerkoopModule = {
|
|
|
22
23
|
},
|
|
23
24
|
settingsCards: [
|
|
24
25
|
{ component: ProductDimensionsSettingsCard, order: 20 },
|
|
26
|
+
{ component: InvoiceSignoffSettingsCard, order: 25 },
|
|
25
27
|
],
|
|
26
28
|
};
|
|
@@ -10456,6 +10456,7 @@ export type Database = {
|
|
|
10456
10456
|
created_at: string;
|
|
10457
10457
|
enabled: boolean;
|
|
10458
10458
|
id: string;
|
|
10459
|
+
invoice_without_signoff: boolean;
|
|
10459
10460
|
offset_days: number;
|
|
10460
10461
|
pickup_anchor: string;
|
|
10461
10462
|
pickup_business_days_only: boolean;
|
|
@@ -10471,6 +10472,7 @@ export type Database = {
|
|
|
10471
10472
|
created_at?: string;
|
|
10472
10473
|
enabled?: boolean;
|
|
10473
10474
|
id?: string;
|
|
10475
|
+
invoice_without_signoff?: boolean;
|
|
10474
10476
|
offset_days?: number;
|
|
10475
10477
|
pickup_anchor?: string;
|
|
10476
10478
|
pickup_business_days_only?: boolean;
|
|
@@ -10486,6 +10488,7 @@ export type Database = {
|
|
|
10486
10488
|
created_at?: string;
|
|
10487
10489
|
enabled?: boolean;
|
|
10488
10490
|
id?: string;
|
|
10491
|
+
invoice_without_signoff?: boolean;
|
|
10489
10492
|
offset_days?: number;
|
|
10490
10493
|
pickup_anchor?: string;
|
|
10491
10494
|
pickup_business_days_only?: boolean;
|
|
@@ -18552,6 +18555,8 @@ export type Database = {
|
|
|
18552
18555
|
floriday_sales_order_id: string | null;
|
|
18553
18556
|
id: string;
|
|
18554
18557
|
invoice_due_at: string | null;
|
|
18558
|
+
invoice_ready_at: string | null;
|
|
18559
|
+
invoice_ready_note: string | null;
|
|
18555
18560
|
is_reservation: boolean;
|
|
18556
18561
|
notes: string | null;
|
|
18557
18562
|
order_date: string;
|
|
@@ -18586,6 +18591,8 @@ export type Database = {
|
|
|
18586
18591
|
floriday_sales_order_id?: string | null;
|
|
18587
18592
|
id?: string;
|
|
18588
18593
|
invoice_due_at?: string | null;
|
|
18594
|
+
invoice_ready_at?: string | null;
|
|
18595
|
+
invoice_ready_note?: string | null;
|
|
18589
18596
|
is_reservation?: boolean;
|
|
18590
18597
|
notes?: string | null;
|
|
18591
18598
|
order_date?: string;
|
|
@@ -18620,6 +18627,8 @@ export type Database = {
|
|
|
18620
18627
|
floriday_sales_order_id?: string | null;
|
|
18621
18628
|
id?: string;
|
|
18622
18629
|
invoice_due_at?: string | null;
|
|
18630
|
+
invoice_ready_at?: string | null;
|
|
18631
|
+
invoice_ready_note?: string | null;
|
|
18623
18632
|
is_reservation?: boolean;
|
|
18624
18633
|
notes?: string | null;
|
|
18625
18634
|
order_date?: string;
|
|
@@ -19876,25 +19885,31 @@ export type Database = {
|
|
|
19876
19885
|
Row: {
|
|
19877
19886
|
id: boolean;
|
|
19878
19887
|
last_cleanup_at: string | null;
|
|
19888
|
+
last_duration_ms: number | null;
|
|
19879
19889
|
last_error: string | null;
|
|
19880
19890
|
last_error_at: string | null;
|
|
19881
19891
|
last_sync_at: string | null;
|
|
19892
|
+
sync_requested_at: string | null;
|
|
19882
19893
|
updated_at: string;
|
|
19883
19894
|
};
|
|
19884
19895
|
Insert: {
|
|
19885
19896
|
id?: boolean;
|
|
19886
19897
|
last_cleanup_at?: string | null;
|
|
19898
|
+
last_duration_ms?: number | null;
|
|
19887
19899
|
last_error?: string | null;
|
|
19888
19900
|
last_error_at?: string | null;
|
|
19889
19901
|
last_sync_at?: string | null;
|
|
19902
|
+
sync_requested_at?: string | null;
|
|
19890
19903
|
updated_at?: string;
|
|
19891
19904
|
};
|
|
19892
19905
|
Update: {
|
|
19893
19906
|
id?: boolean;
|
|
19894
19907
|
last_cleanup_at?: string | null;
|
|
19908
|
+
last_duration_ms?: number | null;
|
|
19895
19909
|
last_error?: string | null;
|
|
19896
19910
|
last_error_at?: string | null;
|
|
19897
19911
|
last_sync_at?: string | null;
|
|
19912
|
+
sync_requested_at?: string | null;
|
|
19898
19913
|
updated_at?: string;
|
|
19899
19914
|
};
|
|
19900
19915
|
Relationships: [];
|
|
@@ -29768,6 +29783,7 @@ export type Database = {
|
|
|
29768
29783
|
sequence_number: number;
|
|
29769
29784
|
signature_accepted_at: string | null;
|
|
29770
29785
|
signature_by_user_id: string | null;
|
|
29786
|
+
signature_image_path: string | null;
|
|
29771
29787
|
signature_name: string | null;
|
|
29772
29788
|
source_email_meta: Json | null;
|
|
29773
29789
|
source_mailbox_message_id: string | null;
|
|
@@ -29816,6 +29832,7 @@ export type Database = {
|
|
|
29816
29832
|
sequence_number: number;
|
|
29817
29833
|
signature_accepted_at?: string | null;
|
|
29818
29834
|
signature_by_user_id?: string | null;
|
|
29835
|
+
signature_image_path?: string | null;
|
|
29819
29836
|
signature_name?: string | null;
|
|
29820
29837
|
source_email_meta?: Json | null;
|
|
29821
29838
|
source_mailbox_message_id?: string | null;
|
|
@@ -29864,6 +29881,7 @@ export type Database = {
|
|
|
29864
29881
|
sequence_number?: number;
|
|
29865
29882
|
signature_accepted_at?: string | null;
|
|
29866
29883
|
signature_by_user_id?: string | null;
|
|
29884
|
+
signature_image_path?: string | null;
|
|
29867
29885
|
signature_name?: string | null;
|
|
29868
29886
|
source_email_meta?: Json | null;
|
|
29869
29887
|
source_mailbox_message_id?: string | null;
|