Forecast nach jeder Chargenspeicherung aktualisieren
This commit is contained in:
1 parent
6bd2bf1b3f
commit
e98c5e6aa4
3 files changed
+29
-3
No files matched your search
@@ -251,6 +251,26 @@ function get_lager_product_available_qty(PDO $pdo, int $productId): float
|
||||
return (float) $stmt->fetchColumn();
|
||||
}
|
||||
|
||||
function get_lager_product_forecast(PDO $pdo, int $productId): array
|
||||
{
|
||||
$stmt = $pdo->prepare(
|
||||
"SELECT sellout_date, sellout_forecast_status
|
||||
FROM stock_lot
|
||||
WHERE product_id = :product_id
|
||||
AND status = 'current'
|
||||
LIMIT 1"
|
||||
);
|
||||
$stmt->execute([':product_id' => $productId]);
|
||||
$forecast = $stmt->fetch();
|
||||
if (!is_array($forecast)) {
|
||||
throw new RuntimeException('Keine aktuelle Charge fuer Forecast vorhanden');
|
||||
}
|
||||
return [
|
||||
'date' => $forecast['sellout_date'],
|
||||
'status' => (string) $forecast['sellout_forecast_status'],
|
||||
];
|
||||
}
|
||||
|
||||
function update_stock_lot_traceability(
|
||||
PDO $pdo,
|
||||
int $lotId,
|
||||
|
||||
Reference in new issue
Block a user