mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
fix cost value calculation when using parent cost
This commit is contained in:
@@ -108,7 +108,7 @@ class Usecase:
|
||||
for resource in resources:
|
||||
cost, unit = ifcopenshell.util.resource.get_cost(resource)
|
||||
if not cost:
|
||||
cost = ifcopenshell.util.resource.get_parent_cost(resource) # Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data.
|
||||
cost, unit = ifcopenshell.util.resource.get_parent_cost(resource) # Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data.
|
||||
quantity = ifcopenshell.util.resource.get_quantity(resource)
|
||||
if not cost or not quantity:
|
||||
continue
|
||||
@@ -117,4 +117,4 @@ class Usecase:
|
||||
total_cost += cost * quantity
|
||||
if total_cost:
|
||||
cost_value = ifcopenshell.api.run("cost.add_cost_value", self.file, parent=self.settings["cost_item"])
|
||||
cost_value.AppliedValue = self.file.createIfcMonetaryMeasure(total_cost)
|
||||
cost_value.AppliedValue = self.file.createIfcMonetaryMeasure(total_cost)
|
||||
Reference in New Issue
Block a user