Bereite Shopify Bestellprojektion vor

This commit is contained in:
2026-08-12 17:42:10 +02:00
parent 0e4c9219bf
commit 6e4925cdb6
3 changed files with 164 additions and 4 deletions
+6 -4
View File
@@ -264,7 +264,8 @@ function allocate_components_for_line(
int $lineNo,
array $components,
float $lineQty,
array $locations
array $locations,
string $movementSource = 'otc-order'
): array {
if ($components === []) {
throw new RuntimeException("Keine Komponenten fuer Verkaufsposition {$lineNo} gefunden");
@@ -313,7 +314,7 @@ function allocate_components_for_line(
$take,
(int) $locations['storage'],
(int) $locations['dispatch'],
"otc-order:order={$orderId}:line={$lineNo}:product={$productId}"
"{$movementSource}:order={$orderId}:line={$lineNo}:product={$productId}"
);
$allocationInsert->execute([
@@ -342,10 +343,11 @@ function allocate_line_inventory(
int $lineNo,
float $lineQty,
int $sellableItemId,
array $locations
array $locations,
string $movementSource = 'otc-order'
): array {
$components = get_item_components($pdo, $sellableItemId);
return allocate_components_for_line($pdo, $orderId, $lineId, $lineNo, $components, $lineQty, $locations);
return allocate_components_for_line($pdo, $orderId, $lineId, $lineNo, $components, $lineQty, $locations, $movementSource);
}
function allocate_line_inventory_fallback_product(