Misc frontend fixes

This commit is contained in:
2025-01-28 20:30:26 -05:00
parent 1410dc5571
commit a661b6a11e
7 changed files with 15 additions and 24 deletions

View File

@@ -353,22 +353,10 @@ router.get('/stock', async (req, res) => {
COALESCE(
(SELECT reorder_days
FROM stock_thresholds st
JOIN product_categories pc ON st.cat_id = pc.cat_id
WHERE pc.pid = p.pid
AND st.vendor = p.vendor LIMIT 1),
WHERE st.vendor = p.vendor LIMIT 1),
(SELECT reorder_days
FROM stock_thresholds st
JOIN product_categories pc ON st.cat_id = pc.cat_id
WHERE pc.pid = p.pid
AND st.vendor IS NULL LIMIT 1),
(SELECT reorder_days
FROM stock_thresholds st
WHERE st.cat_id IS NULL
AND st.vendor = p.vendor LIMIT 1),
(SELECT reorder_days
FROM stock_thresholds st
WHERE st.cat_id IS NULL
AND st.vendor IS NULL LIMIT 1),
WHERE st.vendor IS NULL LIMIT 1),
14
) as reorder_days
FROM products p