mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
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:
@@ -107,11 +107,10 @@ def calculate_cost_item_resource_value(file: ifcopenshell.file, cost_item: ifcop
|
|||||||
assert parent_cost
|
assert parent_cost
|
||||||
cost, unit = parent_cost
|
cost, unit = parent_cost
|
||||||
quantity = ifcopenshell.util.resource.get_quantity(resource)
|
quantity = ifcopenshell.util.resource.get_quantity(resource)
|
||||||
if cost is None or quantity is None:
|
if cost is None:
|
||||||
continue
|
continue
|
||||||
if unit and "day" in unit:
|
if unit and "day" in unit:
|
||||||
quantity = quantity / 8 # Assume 8 hour working day - TODO implement resource calendar
|
quantity = quantity / 8 # Assume 8 hour working day - TODO implement resource calendar
|
||||||
quantity = round(quantity, 5)
|
|
||||||
formula = "{}*{}".format(cost, quantity)
|
formula = "{}*{}".format(cost, quantity)
|
||||||
cost_value = ifcopenshell.api.cost.add_cost_value(file, parent=settings["cost_item"])
|
cost_value = ifcopenshell.api.cost.add_cost_value(file, parent=settings["cost_item"])
|
||||||
cost_value.Name = resource.Name
|
cost_value.Name = resource.Name
|
||||||
|
|||||||
Reference in New Issue
Block a user