See #6570. Small fix for previuos commit

This commit is contained in:
Massimo Fabbro
2025-05-25 07:59:50 +02:00
committed by Massimo Fabbro
parent 482512085c
commit 327899ca62
4 changed files with 6 additions and 13 deletions
+2 -2
View File
@@ -155,8 +155,8 @@ class CostSchedulesData:
else:
data["TotalCost"] = data["TotalAppliedValue"] * cost_quantity
if is_sum:
#pass If it is None it doesn't allow me to assign a cost rate composed by sum
data["TotalAppliedValue"] = None
pass #If it is None it doesn't allow me to assign a cost rate composed by sum
#data["TotalAppliedValue"] = None
@classmethod
def _load_assigned_cost_rate(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
+1 -8
View File
@@ -39,11 +39,7 @@ from typing import TYPE_CHECKING, Literal
def get_schedule_of_rates(self, context):
if not CostItemRatesData.is_loaded:
CostItemRatesData.load()
return CostItemRatesData.data["schedule_of_rates"]
def get_cost_schedules(self, context):
if not CostItemRatesData.is_loaded:
CostItemRatesData.load()
#return CostItemRatesData.data["schedule_of_rates"]
return CostItemRatesData.data["cost_schedules"]
@@ -268,9 +264,6 @@ class BIMCostProperties(PropertyGroup):
schedule_of_rates: EnumProperty(
items=get_schedule_of_rates, name="Schedule Of Rates", update=update_schedule_of_rates
)
cost_schedules: EnumProperty(
items=get_cost_schedules, name="Cost Schedules", update=update_schedule_of_rates
)
cost_item_rates: CollectionProperty(name="Cost Item Rates", type=CostItem)
active_cost_item_rate_index: IntProperty(name="Active Cost Rate Index")
contracted_cost_item_rates: StringProperty(name="Contracted Cost Item Rates", default="[]")
+1 -2
View File
@@ -617,8 +617,7 @@ class BIM_PT_cost_item_rates(Panel):
def draw(self, context):
self.props = tool.Cost.get_cost_props()
row = self.layout.row(align=True)
#row.prop(self.props, "schedule_of_rates", text="")
row.prop(self.props, "cost_schedules", text="")
row.prop(self.props, "schedule_of_rates", text="")
if self.props.active_cost_item_rate_index < len(self.props.cost_item_rates):
cost_item = self.props.cost_items[self.props.active_cost_item_index]
cost_item_rate = self.props.cost_item_rates[self.props.active_cost_item_rate_index]
+2 -1
View File
@@ -441,7 +441,8 @@ class Cost(bonsai.core.tool.Cost):
props = cls.get_cost_props()
props.cost_value_attributes.clear()
is_rates = cls.is_active_schedule_of_rates()
#is_rates = cls.is_active_schedule_of_rates()
is_rates = True #so it is possible to assign a cost item rate that it not only from a Schedule of Rate
callback = lambda name, prop, data: import_attributes(
name, prop, data, cost_value, is_rates, props.cost_value_attributes
)