From 2cdf7e8688b5ee5a70d56cd3c1463caa5b84ee3a Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Mon, 25 Dec 2023 10:54:02 +0530 Subject: [PATCH] Fix: Calculate prices --- brewman/brewman/routers/calculate_prices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brewman/brewman/routers/calculate_prices.py b/brewman/brewman/routers/calculate_prices.py index c6c51325..292557be 100644 --- a/brewman/brewman/routers/calculate_prices.py +++ b/brewman/brewman/routers/calculate_prices.py @@ -30,7 +30,7 @@ def calculate_prices(period_id: uuid.UUID, db: Session): ingredients = set(db.execute(select(distinct(RecipeItem.product_id))).scalars().all()) issued_products = get_issue_prices(item, ingredients - recipes, db) left = ingredients - recipes - issued_products.keys() - purchased_products = get_issue_prices(item, left, db) + purchased_products = get_purchase_prices(item, left, db) left -= purchased_products.keys() rest = get_rest(left, db) prices = issued_products | purchased_products | rest