Forecast nach jeder Chargenspeicherung aktualisieren

This commit is contained in:
gitea_admin committed 2026-09-08 10:25:30 +02:00
1 parent 6bd2bf1b3f
commit e98c5e6aa4
3 files changed
+29 -3

No files matched your search

+7 -2
View File
@@ -62,7 +62,10 @@ try {
$adjustmentQty,
$outQty
);
json_response(200, ['ok' => true, 'lot' => $updatedLot, 'balance' => get_stock_lot_balance($pdo, (int) ($data['lotId'] ?? 0))]);
$productId = (int) $updatedLot['product_id'];
refresh_lager_stock_lot_forecast_for_product($pdo, $productId);
$forecast = get_lager_product_forecast($pdo, $productId);
json_response(200, ['ok' => true, 'productId' => $productId, 'lot' => $updatedLot, 'balance' => get_stock_lot_balance($pdo, (int) ($data['lotId'] ?? 0)), 'forecast' => $forecast]);
}
if ($action === 'delete_open_lot') {
@@ -116,7 +119,9 @@ try {
$targetQty,
$lotId > 0 && $lotNumber === ''
);
json_response(200, ['ok' => true, 'lot' => $preparedLot, 'balance' => get_stock_lot_balance($pdo, $lotId), 'availableQty' => get_lager_product_available_qty($pdo, $productId)]);
refresh_lager_stock_lot_forecast_for_product($pdo, $productId);
$forecast = get_lager_product_forecast($pdo, $productId);
json_response(200, ['ok' => true, 'productId' => $productId, 'lot' => $preparedLot, 'balance' => get_stock_lot_balance($pdo, $lotId), 'availableQty' => get_lager_product_available_qty($pdo, $productId), 'forecast' => $forecast]);
}
json_response(422, ['ok' => false, 'error' => 'Unsupported action']);