Fix ambiguous charge forecast query

This commit is contained in:
gitea_admin committed 2026-09-08 19:26:11 +02:00
1 parent 3ae9951b13
commit 764b6fa886
1 file changed
+3 -3
+3 -3
View File
@@ -275,7 +275,7 @@ function get_lager_product_available_qty(PDO $pdo, int $productId): float
function get_lager_product_forecast(PDO $pdo, int $productId): array function get_lager_product_forecast(PDO $pdo, int $productId): array
{ {
$stmt = $pdo->prepare( $stmt = $pdo->prepare(
"SELECT sellout_date, sellout_forecast_status, expiry_date, "SELECT stock_lot.sellout_date, stock_lot.sellout_forecast_status, stock_lot.expiry_date,
next_lot.sellout_date AS next_sellout_date, next_lot.sellout_date AS next_sellout_date,
next_lot.sellout_forecast_status AS next_sellout_forecast_status, next_lot.sellout_forecast_status AS next_sellout_forecast_status,
next_lot.expiry_date AS next_expiry_date next_lot.expiry_date AS next_expiry_date
@@ -296,8 +296,8 @@ function get_lager_product_forecast(PDO $pdo, int $productId): array
AND v.qty_net > 0 AND v.qty_net > 0
LIMIT 1 LIMIT 1
) next_lot ON TRUE ) next_lot ON TRUE
WHERE product_id = :product_id WHERE stock_lot.product_id = :product_id
AND status = 'current' AND stock_lot.status = 'current'
LIMIT 1" LIMIT 1"
); );
$stmt->execute([':product_id' => $productId]); $stmt->execute([':product_id' => $productId]);