diff --git a/src/bonsai/bonsai/bim/module/cost/operator.py b/src/bonsai/bonsai/bim/module/cost/operator.py index 5bf5de0382..7748dc1be3 100644 --- a/src/bonsai/bonsai/bim/module/cost/operator.py +++ b/src/bonsai/bonsai/bim/module/cost/operator.py @@ -940,12 +940,12 @@ class ExportCostSchedulesToPDF(bpy.types.Operator, ExportHelper): default=True, ) force_schedule_type: bpy.props.EnumProperty( - name="Force output type", - description="Force the output to this type\nalso if it is not coincident with the cost schedule Predefined Type", + name="Output type", + description='Force the output to this type.\n"Auto" defaults to selected cost schedule Predefined Type', items=[ ( - "OFF", - "Off", + "AUTO", + "By PredefinedType", "Uses Cost Schedule Predefined Type", ), ( @@ -959,7 +959,7 @@ class ExportCostSchedulesToPDF(bpy.types.Operator, ExportHelper): "Forces the output as a schedule of rates", ), ], - default="OFF", + default="AUTO", ) def draw(self, context): diff --git a/src/ifc5d/ifc5d/ifc5Dspreadsheet.py b/src/ifc5d/ifc5d/ifc5Dspreadsheet.py index 0aa9f7ee7c..d5f3bba22c 100644 --- a/src/ifc5d/ifc5d/ifc5Dspreadsheet.py +++ b/src/ifc5d/ifc5d/ifc5Dspreadsheet.py @@ -626,19 +626,19 @@ class Ifc5DPdfWriter(Ifc5Dwriter): cost_schedule_name = self.cost_schedule.Name or "Unnamed" if self.force_schedule_type in ("PRICEDBILLOFQUANTITIES", "SCHEDULEOFRATES"): schedule_type = self.force_schedule_type - elif self.force_schedule_type is None or self.force_schedule_type == "OFF": + elif self.force_schedule_type is None or self.force_schedule_type == "AUTO": schedule_type = self.cost_schedule.PredefinedType if schedule_type not in HANDLED_COST_SCHEDULE_TYPES: schedule_type = "PRICEDBILLOFQUANTITIES" else: raise ValueError( - "force_schedule_type can be set to OFF, PRICEDBILLOFQUANTITIES, SCHEDULEOFRATES values only." + "force_schedule_type can be set to AUTO, PRICEDBILLOFQUANTITIES, SCHEDULEOFRATES values only." ) project_monetary_unit = self.file.by_type("IfcMonetaryUnit") if project_monetary_unit: project_currency = project_monetary_unit[0].Currency else: - project_currency = '""' + project_currency = "" # export csv file csv_file_writer = Ifc5DCsvWriter(file=self.file, output=temp_dir, cost_schedule=self.cost_schedule) @@ -660,7 +660,7 @@ class Ifc5DPdfWriter(Ifc5Dwriter): typst_main_content += ' schedule_name: "{}",\n'.format(cost_schedule_name) typst_main_content += ' schedule_description: "{}",\n'.format(self.cost_schedule.Description or "") typst_main_content += ' schedule_type: "{}",\n'.format(schedule_type) - typst_main_content += " project_currency: {},\n".format(project_currency) + typst_main_content += ' project_currency: "{}",\n'.format(project_currency) for option_name, default_value in DEFAULT_OPTIONS.items(): value = self.options.get(option_name, default_value) if isinstance(value, bool): diff --git a/src/ifc5d/ifc5d/typst_template_ifc_cost_schedule.typ b/src/ifc5d/ifc5d/typst_template_ifc_cost_schedule.typ index bdaf68f901..ffd87a3981 100644 --- a/src/ifc5d/ifc5d/typst_template_ifc_cost_schedule.typ +++ b/src/ifc5d/ifc5d/typst_template_ifc_cost_schedule.typ @@ -342,8 +342,8 @@ ) = { let data = csv(path, delimiter: delimiter, row-type: dictionary) let new_rows = data.map(item => arrange_summary_row(item, options)) - let general_total = data.filter(row => row.at("Index") == "1") - .map(row => float(row.at("TotalPrice"))) + let general_total = data.filter(row => row.at("ItemIsASum") == "False") + .map(row => float(row.at("RateSubtotal", default: 0.0))*float(row.at("Quantity", default: 0.0))) .sum(default: 0.00) set text(size: 10pt)