Fix calculate errors

This commit is contained in:
2025-02-01 23:38:13 -05:00
parent 0a51328da2
commit bd5bcdd548
6 changed files with 92 additions and 92 deletions

View File

@@ -119,8 +119,7 @@ async function calculateFinancialMetrics(startTime, totalProducts, processedCoun
WHEN COALESCE(mf.inventory_value, 0) > 0 AND mf.active_days > 0 THEN
(COALESCE(mf.gross_profit, 0) * (365.0 / mf.active_days)) / COALESCE(mf.inventory_value, 0)
ELSE 0
END,
pta.last_calculated_at = CURRENT_TIMESTAMP
END
`);
processedCount = Math.floor(totalProducts * 0.70);