Fix ambiguous charge forecast query
This commit is contained in:
1 parent
3ae9951b13
commit
764b6fa886
1 file changed
+3
-3
@@ -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
|
||||
{
|
||||
$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_forecast_status AS next_sellout_forecast_status,
|
||||
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
|
||||
LIMIT 1
|
||||
) next_lot ON TRUE
|
||||
WHERE product_id = :product_id
|
||||
AND status = 'current'
|
||||
WHERE stock_lot.product_id = :product_id
|
||||
AND stock_lot.status = 'current'
|
||||
LIMIT 1"
|
||||
);
|
||||
$stmt->execute([':product_id' => $productId]);
|
||||
|
||||
Reference in new issue
Block a user