mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-30 12:09:51 +00:00
See #6570. Small fix for previuos commit
This commit is contained in:
committed by
Massimo Fabbro
parent
482512085c
commit
327899ca62
@@ -155,8 +155,8 @@ class CostSchedulesData:
|
|||||||
else:
|
else:
|
||||||
data["TotalCost"] = data["TotalAppliedValue"] * cost_quantity
|
data["TotalCost"] = data["TotalAppliedValue"] * cost_quantity
|
||||||
if is_sum:
|
if is_sum:
|
||||||
#pass If it is None it doesn't allow me to assign a cost rate composed by sum
|
pass #If it is None it doesn't allow me to assign a cost rate composed by sum
|
||||||
data["TotalAppliedValue"] = None
|
#data["TotalAppliedValue"] = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _load_assigned_cost_rate(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
|
def _load_assigned_cost_rate(cls, cost_item: ifcopenshell.entity_instance, data: CostItem) -> None:
|
||||||
|
|||||||
@@ -39,11 +39,7 @@ from typing import TYPE_CHECKING, Literal
|
|||||||
def get_schedule_of_rates(self, context):
|
def get_schedule_of_rates(self, context):
|
||||||
if not CostItemRatesData.is_loaded:
|
if not CostItemRatesData.is_loaded:
|
||||||
CostItemRatesData.load()
|
CostItemRatesData.load()
|
||||||
return CostItemRatesData.data["schedule_of_rates"]
|
#return CostItemRatesData.data["schedule_of_rates"]
|
||||||
|
|
||||||
def get_cost_schedules(self, context):
|
|
||||||
if not CostItemRatesData.is_loaded:
|
|
||||||
CostItemRatesData.load()
|
|
||||||
return CostItemRatesData.data["cost_schedules"]
|
return CostItemRatesData.data["cost_schedules"]
|
||||||
|
|
||||||
|
|
||||||
@@ -268,9 +264,6 @@ class BIMCostProperties(PropertyGroup):
|
|||||||
schedule_of_rates: EnumProperty(
|
schedule_of_rates: EnumProperty(
|
||||||
items=get_schedule_of_rates, name="Schedule Of Rates", update=update_schedule_of_rates
|
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)
|
cost_item_rates: CollectionProperty(name="Cost Item Rates", type=CostItem)
|
||||||
active_cost_item_rate_index: IntProperty(name="Active Cost Rate Index")
|
active_cost_item_rate_index: IntProperty(name="Active Cost Rate Index")
|
||||||
contracted_cost_item_rates: StringProperty(name="Contracted Cost Item Rates", default="[]")
|
contracted_cost_item_rates: StringProperty(name="Contracted Cost Item Rates", default="[]")
|
||||||
|
|||||||
@@ -617,8 +617,7 @@ class BIM_PT_cost_item_rates(Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.props = tool.Cost.get_cost_props()
|
self.props = tool.Cost.get_cost_props()
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
#row.prop(self.props, "schedule_of_rates", text="")
|
row.prop(self.props, "schedule_of_rates", text="")
|
||||||
row.prop(self.props, "cost_schedules", text="")
|
|
||||||
if self.props.active_cost_item_rate_index < len(self.props.cost_item_rates):
|
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 = 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]
|
cost_item_rate = self.props.cost_item_rates[self.props.active_cost_item_rate_index]
|
||||||
|
|||||||
@@ -441,7 +441,8 @@ class Cost(bonsai.core.tool.Cost):
|
|||||||
|
|
||||||
props = cls.get_cost_props()
|
props = cls.get_cost_props()
|
||||||
props.cost_value_attributes.clear()
|
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(
|
callback = lambda name, prop, data: import_attributes(
|
||||||
name, prop, data, cost_value, is_rates, props.cost_value_attributes
|
name, prop, data, cost_value, is_rates, props.cost_value_attributes
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user