From f460676e54e861afd678ca94a79042fbfdeaa56b Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 22 May 2024 17:37:32 +0500 Subject: [PATCH] fix calculating cost summary #4704 (was confusing 0 qty and no qty) similar to 295d0a677 --- src/ifcopenshell-python/ifcopenshell/util/cost.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/cost.py b/src/ifcopenshell-python/ifcopenshell/util/cost.py index d383dd66a3..d9ce6f874f 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/cost.py +++ b/src/ifcopenshell-python/ifcopenshell/util/cost.py @@ -102,7 +102,8 @@ def sum_child_root_elements(root_element: ifcopenshell.entity_instance, category if category_filter and child_cost_value.Category != category_filter: continue child_applied_value = calculate_applied_value(child_root_element, child_cost_value) - child_quantity = get_total_quantity(child_root_element) or 1.0 + child_quantity = get_total_quantity(child_root_element) + child_quantity = 1.0 if child_quantity is None else child_quantity if child_cost_value.UnitBasis: value_component = child_cost_value.UnitBasis.ValueComponent.wrappedValue result += child_quantity / value_component * child_applied_value