@flowselections/logistiek-engine 1.0.90 → 1.0.98
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/FlowOrders.js +1 -1
- package/dist-lib/components/MisluktVerzendbrievenCard.d.ts +2 -0
- package/dist-lib/components/MisluktVerzendbrievenCard.d.ts.map +1 -0
- package/dist-lib/components/MisluktVerzendbrievenCard.js +50 -0
- package/dist-lib/components/RegiePage.d.ts.map +1 -1
- package/dist-lib/components/RegiePage.js +2 -1
- package/dist-lib/components/RuleEnginePage.d.ts.map +1 -1
- package/dist-lib/components/RuleEnginePage.js +3 -1
- package/dist-lib/hooks/useShippingNoteStatus.d.ts +2 -0
- package/dist-lib/hooks/useShippingNoteStatus.d.ts.map +1 -1
- package/dist-lib/hooks/useShippingNoteStatus.js +13 -1
- package/dist-lib/hooks/useShippingNoteStatus.test.d.ts +2 -0
- package/dist-lib/hooks/useShippingNoteStatus.test.d.ts.map +1 -0
- package/dist-lib/hooks/useShippingNoteStatus.test.js +20 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +415 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +415 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/moduleClient.d.ts +415 -0
- package/dist-lib/integrations/supabase/moduleClient.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +423 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cartCoverage.functions.d.ts +415 -0
- package/dist-lib/lib/cartCoverage.functions.d.ts.map +1 -1
- package/dist-lib/lib/controlScan.server.d.ts +2 -0
- package/dist-lib/lib/controlScan.server.d.ts.map +1 -1
- package/dist-lib/lib/controlScan.server.js +59 -53
- package/dist-lib/lib/floridayDocuments.functions.d.ts +1245 -0
- package/dist-lib/lib/floridayDocuments.functions.d.ts.map +1 -1
- package/dist-lib/lib/floridayPush.functions.d.ts +415 -0
- package/dist-lib/lib/floridayPush.functions.d.ts.map +1 -1
- package/dist-lib/lib/layoutPrint.server.d.ts +27 -0
- package/dist-lib/lib/layoutPrint.server.d.ts.map +1 -0
- package/dist-lib/lib/layoutPrint.server.js +48 -0
- package/dist-lib/lib/layoutPrint.test.d.ts +2 -0
- package/dist-lib/lib/layoutPrint.test.d.ts.map +1 -0
- package/dist-lib/lib/layoutPrint.test.js +47 -0
- package/dist-lib/lib/loadCarrierPlanning.functions.d.ts +2075 -0
- package/dist-lib/lib/loadCarrierPlanning.functions.d.ts.map +1 -1
- package/dist-lib/lib/loadCarrierPlanning.server.d.ts.map +1 -1
- package/dist-lib/lib/loadCarrierPlanning.server.js +52 -8
- package/dist-lib/lib/logisticsRecalcJob.functions.d.ts +830 -0
- package/dist-lib/lib/logisticsRecalcJob.functions.d.ts.map +1 -1
- package/dist-lib/lib/logisticsRecalculate.functions.d.ts +415 -0
- package/dist-lib/lib/logisticsRecalculate.functions.d.ts.map +1 -1
- package/dist-lib/lib/modulePrompts.d.ts.map +1 -1
- package/dist-lib/lib/modulePrompts.js +54 -0
- package/dist-lib/lib/plannerDiff.functions.d.ts +415 -0
- package/dist-lib/lib/plannerDiff.functions.d.ts.map +1 -1
- package/dist-lib/lib/ruleEngineSchema.js +2 -2
- package/dist-lib/lib/shippingNoteQueue.server.d.ts.map +1 -1
- package/dist-lib/lib/shippingNoteQueue.server.js +40 -49
- package/package.json +1 -1
|
@@ -1017,12 +1017,12 @@ export const RULE_STEPS = [
|
|
|
1017
1017
|
},
|
|
1018
1018
|
{
|
|
1019
1019
|
key: "pick_history_retention_days",
|
|
1020
|
-
default:
|
|
1020
|
+
default: 30,
|
|
1021
1021
|
label: "Pickhistorie bewaren (dagen)",
|
|
1022
1022
|
type: "number",
|
|
1023
1023
|
min: 1,
|
|
1024
1024
|
max: 3650,
|
|
1025
|
-
description: "Na deze termijn wordt de historie van de pickstations opgeruimd. Laat leeg om niets op te ruimen.",
|
|
1025
|
+
description: "Na deze termijn wordt de historie van de pickstations opgeruimd. Alleen historie van al uitgevoerde pickacties; heeft geen invloed op de verwerking van openstaande orders. Laat leeg om niets op te ruimen.",
|
|
1026
1026
|
},
|
|
1027
1027
|
{
|
|
1028
1028
|
key: "barcode_retention_days",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shippingNoteQueue.server.d.ts","sourceRoot":"","sources":["../../src/lib/shippingNoteQueue.server.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"shippingNoteQueue.server.d.ts","sourceRoot":"","sources":["../../src/lib/shippingNoteQueue.server.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAqCD,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,cAAc,EAClB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,eAAe,CAAC,CA+S1B"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// ============================================================================
|
|
14
14
|
import { trace, newTraceId, classifyError } from "./trace.server.js";
|
|
15
15
|
import { FLOW_NODE } from "./flowNodes.js";
|
|
16
|
+
import { printViaLayout } from "./layoutPrint.server.js";
|
|
16
17
|
/** Na dit aantal pogingen is een aanvraag definitief mislukt. */
|
|
17
18
|
const MAX_ATTEMPTS = 60;
|
|
18
19
|
function pickPdf(result) {
|
|
@@ -215,10 +216,10 @@ export async function runShippingNoteQueue(sb, options = {}) {
|
|
|
215
216
|
await wacht("Wachten op officiële Floriday-afleverbrief: Floriday gaf nog geen bruikbaar bestand terug.", "nog_niet_beschikbaar");
|
|
216
217
|
continue;
|
|
217
218
|
}
|
|
218
|
-
// De pakbon is de bron voor
|
|
219
|
+
// De pakbon is de bron voor printplek en kar; de printer kiest de Layout maker.
|
|
219
220
|
const { data: slip } = await sb
|
|
220
221
|
.from("print_jobs")
|
|
221
|
-
.select("payload,
|
|
222
|
+
.select("payload, is_herprint")
|
|
222
223
|
.eq("id", row.slip_job_id)
|
|
223
224
|
.maybeSingle();
|
|
224
225
|
const slipRow = (slip ?? null);
|
|
@@ -227,56 +228,46 @@ export async function runShippingNoteQueue(sb, options = {}) {
|
|
|
227
228
|
continue;
|
|
228
229
|
}
|
|
229
230
|
const slipPayload = slipRow["payload"] ?? {};
|
|
230
|
-
const
|
|
231
|
+
const printPlekId = String(slipPayload["print_plek_id"] ?? "").trim() || null;
|
|
231
232
|
const cartId = slipPayload["cart_id"] ?? row.cart_id;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
trigger: "with_packing_slip",
|
|
263
|
-
is_floriday: true,
|
|
264
|
-
packing_slip_job_id: row.slip_job_id,
|
|
265
|
-
print_batch_key: row.batch_key ?? `kar-print:${row.slip_job_id}`,
|
|
266
|
-
order_id: row.order_id,
|
|
267
|
-
order_number: row.order_number,
|
|
268
|
-
cart_id: cartId,
|
|
269
|
-
fulfillment_order_id: fulfillmentOrderId,
|
|
270
|
-
},
|
|
271
|
-
})
|
|
272
|
-
.select("id")
|
|
273
|
-
.maybeSingle();
|
|
274
|
-
if (jobError) {
|
|
275
|
-
await wacht(`De verzendbrief kon nog niet worden klaargezet om te printen: ${jobError.message}`, "tijdelijk");
|
|
276
|
-
continue;
|
|
233
|
+
const printed = await printViaLayout(sb, {
|
|
234
|
+
documenttype: "afleverbrief",
|
|
235
|
+
documentnaam: `Verzendbrief ${row.order_number}`,
|
|
236
|
+
pdfBase64: base64,
|
|
237
|
+
pdfUrl: url,
|
|
238
|
+
printPlekId,
|
|
239
|
+
herkomst: "floriday",
|
|
240
|
+
isHerprint: Boolean(slipRow["is_herprint"] ?? false),
|
|
241
|
+
idempotentieSleutel: `verzendbrief-bij-pakbon:${row.slip_job_id}`,
|
|
242
|
+
payload: {
|
|
243
|
+
source: "pickstation",
|
|
244
|
+
document_type_code: "verzendbrief",
|
|
245
|
+
trigger: "with_packing_slip",
|
|
246
|
+
is_floriday: true,
|
|
247
|
+
queue_item_id: slipPayload["queue_item_id"] ?? null,
|
|
248
|
+
packing_slip_job_id: row.slip_job_id,
|
|
249
|
+
print_batch_key: row.batch_key ?? `kar-print:${row.slip_job_id}`,
|
|
250
|
+
print_plek_id: printPlekId,
|
|
251
|
+
order_id: row.order_id,
|
|
252
|
+
ordernummer: row.order_number,
|
|
253
|
+
order_number: row.order_number,
|
|
254
|
+
cart_id: cartId,
|
|
255
|
+
cart: slipPayload["cart"] ?? null,
|
|
256
|
+
barcode: slipPayload["barcode"] ?? null,
|
|
257
|
+
fulfillment_order_id: fulfillmentOrderId,
|
|
258
|
+
},
|
|
259
|
+
});
|
|
260
|
+
if (!printed.ok) {
|
|
261
|
+
if (["GEEN_PRINTER", "GEEN_LAYOUT", "GEEN_EXTERN_DOCUMENT"].includes(printed.errorCode)) {
|
|
262
|
+
await faal(printed.errorCode.toLowerCase(), printed.error, fulfillmentOrderId);
|
|
277
263
|
}
|
|
278
|
-
|
|
264
|
+
else {
|
|
265
|
+
await wacht(`De verzendbrief kon nog niet worden klaargezet: ${printed.error}`, "tijdelijk");
|
|
266
|
+
}
|
|
267
|
+
continue;
|
|
279
268
|
}
|
|
269
|
+
const jobId = printed.jobId;
|
|
270
|
+
const printerId = printed.printerId;
|
|
280
271
|
await sb.rpc("logistics_slip_note_finish", {
|
|
281
272
|
_id: row.id,
|
|
282
273
|
_ok: true,
|