diff --git a/inventory-server/src/routes/import.js b/inventory-server/src/routes/import.js index fff8134..5d8b0e8 100644 --- a/inventory-server/src/routes/import.js +++ b/inventory-server/src/routes/import.js @@ -837,7 +837,7 @@ router.get('/search-products', async (req, res) => { p.width, p.height, p.country_of_origin, - p.totalsold AS total_sold, + ci.totalsold AS total_sold, p.datein AS first_received, pls.date_sold AS date_last_sold FROM products p @@ -849,6 +849,7 @@ router.get('/search-products', async (req, res) => { LEFT JOIN product_categories pc3 ON p.subline = pc3.cat_id LEFT JOIN product_categories pc4 ON p.artist = pc4.cat_id LEFT JOIN product_last_sold pls ON p.pid = pls.pid + LEFT JOIN current_inventory ci ON p.pid = ci.pid ${whereClause} GROUP BY p.pid ${isWildcardSearch ? 'ORDER BY p.datein DESC' : `