kg to g convertion fix in report

This commit is contained in:
raman 2025-11-05 09:54:39 +05:30
parent 5316a9a1cb
commit 8f34af9d7c
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,12 @@ class SamashtiDashboard(models.AbstractModel):
pt.name AS product_name, pt.name AS product_name,
pc.name AS category, pc.name AS category,
uom.name AS uom, uom.name AS uom,
-- Current Cost (from Valuation Layer)
COALESCE((
SELECT SUM(svl.value) / NULLIF(SUM(svl.quantity), 0)
FROM stock_valuation_layer svl
WHERE svl.product_id = pp.id
), 0) AS current_cost,
-- Opening Stock: includes inventory adjustments before fromDate -- Opening Stock: includes inventory adjustments before fromDate
COALESCE(SUM(CASE COALESCE(SUM(CASE