stock aggregate table
This commit is contained in:
@@ -274,7 +274,7 @@ class ProductManager {
|
||||
* Return all products with their current aggregate warehouse balance.
|
||||
*
|
||||
* The balance is the sum of (total_in - total_out) across all warehouses
|
||||
* from the warehouse_balance table. Products with no balance rows show 0.
|
||||
* from the etl_stock_summary table. Products with no balance rows show 0.
|
||||
*
|
||||
* Used to populate the product listing page.
|
||||
*
|
||||
@@ -285,7 +285,7 @@ class ProductManager {
|
||||
$sth = $this->pdo->prepare(
|
||||
"SELECT a.*, IFNULL(SUM(b.total_in - b.total_out), 0) AS product_balance
|
||||
FROM md_product a
|
||||
LEFT JOIN warehouse_balance b
|
||||
LEFT JOIN etl_stock_summary b
|
||||
ON a.company_id = b.company_id
|
||||
AND a.sku = b.product_sku
|
||||
WHERE a.company_id = :company_id
|
||||
|
||||
Reference in New Issue
Block a user