From 70e75f5ed21cc179285c663629f183201de0104a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 11 Nov 2024 18:15:40 +0500 Subject: [PATCH] calculate_cost_item_resource_value not to skip 0 costs/quantities That way all assigned resources will be added as cost values to cost items and it will be more apparent what resources were used for the last calculation and what costs/quantities they had at the time. --- .../ifcopenshell/api/cost/calculate_cost_item_resource_value.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py index 91a357a66c..1d95942c0e 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py @@ -107,7 +107,7 @@ def calculate_cost_item_resource_value(file: ifcopenshell.file, cost_item: ifcop assert parent_cost cost, unit = parent_cost quantity = ifcopenshell.util.resource.get_quantity(resource) - if not cost or not quantity: + if cost is None or quantity is None: continue if unit and "day" in unit: quantity = quantity / 8 # Assume 8 hour working day - TODO implement resource calendar