From be6e9200b6b5baabb2ca3fb9c31335c7d51bc44a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 12 Nov 2024 14:31:17 +0500 Subject: [PATCH] calculate_cost_item_resource_value - remove rounding to preserve the original quantities #5706 Removed 'quantity is None' check since it's never none after c409258ff. --- .../api/cost/calculate_cost_item_resource_value.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 edac53057a..3371d3e200 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,11 +107,10 @@ 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 cost is None or quantity is None: + if cost is None: continue if unit and "day" in unit: quantity = quantity / 8 # Assume 8 hour working day - TODO implement resource calendar - quantity = round(quantity, 5) formula = "{}*{}".format(cost, quantity) cost_value = ifcopenshell.api.cost.add_cost_value(file, parent=settings["cost_item"]) cost_value.Name = resource.Name