diff --git a/src/equipment_sparepart/service.py b/src/equipment_sparepart/service.py index 4d313dd..f7e4493 100644 --- a/src/equipment_sparepart/service.py +++ b/src/equipment_sparepart/service.py @@ -188,7 +188,7 @@ async def get_all( fwo.asset_location AS location_tag, ft.itemnum, COALESCE(spl.description, 'Unknown') AS sparepart_name, - SUM(ft.itemqty) AS total_parts_used, + AVG(ft.itemqty) AS total_parts_used, COALESCE(AVG(ft.inv_avgcost), 0) AS avg_cost, COALESCE(AVG(ft.inv_curbaltotal), 0) AS avg_inventory_balance FROM filtered_wo AS fwo