@flowselections/floriday-verkoop-module 1.0.28 → 1.0.30

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.
Files changed (39) hide show
  1. package/dist-lib/components/verkoop/CreateOrderPage.d.ts.map +1 -1
  2. package/dist-lib/components/verkoop/CreateOrderPage.js +64 -20
  3. package/dist-lib/integrations/supabase/auth-middleware.d.ts +9 -0
  4. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  5. package/dist-lib/integrations/supabase/client.d.ts +9 -0
  6. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  7. package/dist-lib/integrations/supabase/client.server.d.ts +9 -0
  8. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/types.d.ts +9 -0
  10. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  11. package/dist-lib/lib/cart-lock.functions.d.ts +9 -0
  12. package/dist-lib/lib/cart-lock.functions.d.ts.map +1 -1
  13. package/dist-lib/lib/cart-planning-settings.functions.d.ts +99 -0
  14. package/dist-lib/lib/cart-planning-settings.functions.d.ts.map +1 -1
  15. package/dist-lib/lib/cart-replan.functions.d.ts +27 -0
  16. package/dist-lib/lib/cart-replan.functions.d.ts.map +1 -1
  17. package/dist-lib/lib/cart-replan.functions.js +4 -4
  18. package/dist-lib/lib/create-order.functions.d.ts +13977 -42
  19. package/dist-lib/lib/create-order.functions.d.ts.map +1 -1
  20. package/dist-lib/lib/create-order.functions.js +63 -0
  21. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts +27 -0
  22. package/dist-lib/lib/floriday-auto-fulfillment.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts +9 -0
  24. package/dist-lib/lib/floriday-logistic-labels.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/floriday-mirror.functions.d.ts +9 -0
  26. package/dist-lib/lib/floriday-mirror.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-public.functions.d.ts +63 -0
  28. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/floriday-writes.functions.d.ts +45 -0
  30. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/order-buffers.functions.d.ts +27 -0
  32. package/dist-lib/lib/order-buffers.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/order-shipments.functions.d.ts +36 -0
  34. package/dist-lib/lib/order-shipments.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/salesorders.functions.d.ts +45 -0
  36. package/dist-lib/lib/salesorders.functions.d.ts.map +1 -1
  37. package/dist-lib/lib/tradeitems.functions.d.ts +9 -0
  38. package/dist-lib/lib/tradeitems.functions.d.ts.map +1 -1
  39. package/package.json +1 -1
@@ -32,7 +32,7 @@ export async function replanBufferInternal(bufferId) {
32
32
  // Items van alle orders in de buffer.
33
33
  const { data: items, error: itErr } = await supabaseAdmin
34
34
  .from("order_items")
35
- .select("id, order_id, product_id, product_name, quantity, products(plants_per_crate, crates_per_layer, layers_per_cart)")
35
+ .select("id, order_id, product_id, product_name, quantity, plants_per_crate, crates_per_layer, layers_per_cart, products(plants_per_crate, crates_per_layer, layers_per_cart)")
36
36
  .in("order_id", orderIds.length > 0 ? orderIds : ["00000000-0000-0000-0000-000000000000"]);
37
37
  if (itErr)
38
38
  throw new Error(itErr.message);
@@ -43,9 +43,9 @@ export async function replanBufferInternal(bufferId) {
43
43
  product_id: it.product_id,
44
44
  product_name: it.product_name,
45
45
  plants: Math.max(0, Number(it.quantity ?? 0)),
46
- plants_per_crate: Math.max(1, Number(prod.plants_per_crate ?? 1)),
47
- crates_per_layer: Math.max(1, Number(prod.crates_per_layer ?? 1)),
48
- layers_per_cart: Math.max(1, Number(prod.layers_per_cart ?? 1)),
46
+ plants_per_crate: Math.max(1, Number(it.plants_per_crate ?? prod.plants_per_crate ?? 1)),
47
+ crates_per_layer: Math.max(1, Number(it.crates_per_layer ?? prod.crates_per_layer ?? 1)),
48
+ layers_per_cart: Math.max(1, Number(it.layers_per_cart ?? prod.layers_per_cart ?? 1)),
49
49
  };
50
50
  });
51
51
  // Item → order-map voor het toewijzen van cart.order_id bij homogene karren.