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.
This commit is contained in:
Andrej730
2024-11-12 14:31:17 +05:00
parent 204a1b1dc6
commit be6e9200b6
@@ -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