- Add button to generate cost schedule

- Feature to view, edit and add cost item values. ( Right Click - Edit ).
This commit is contained in:
Yassine Oualid
2024-09-01 01:40:53 +01:00
parent 53a78f38e5
commit f2554bc968
15 changed files with 616 additions and 127 deletions
@@ -245,6 +245,20 @@ def get_cost_item_assignments(
for product in get_cost_assignments_by_type(nested_cost_item, filter_by_type)
]
def get_cost_values(cost_item: ifcopenshell.entity_instance) -> list[dict[str, str]]:
results = []
for cost_value in cost_item.CostValues or []:
label = "{0:.2f}".format(calculate_applied_value(cost_item, cost_value))
label += " = {}".format(serialise_cost_value(cost_value))
results.append({
"id": cost_value.id(),
"label": label,
"name": cost_value.Name,
"category": cost_value.Category,
"applied_value": get_primitive_applied_value(cost_value.AppliedValue) if cost_value.AppliedValue else None,
})
print(results)
return results
class CostValueUnserialiser:
def parse(self, formula: str):