ifc5d: professional grade ODS/XLSX cost schedule export #6251

Three defects reported against the Costing tab export:

1. XLSX export crashed with ModuleNotFoundError: xlsxwriter was never
   bundled with Bonsai. Port the writer to openpyxl, which ifccsv
   already uses and Bonsai already ships, so it works out of the box.
2. Every ODS cell was written as a string (numbers as text), and the
   formula branch was dead code: it compared against 'Total Price' /
   'Rate Subtotal' while the headers are 'TotalPrice' / 'RateSubtotal'.
   Numeric columns are now typed float cells and TotalPrice becomes a
   real formula: Quantity*RateSubtotal on leaf items, SUM over the
   direct children's TotalPrice cells on sum items.
3. Internal bookkeeping columns (Id, ItemIsASum, Hierarchy, Index,
   Quantities) leaked into the presentation formats. ODS/XLSX now hide
   them; CSV keeps them since csv2ifc consumes them for the round trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Petru Conduraru
2026-07-05 21:40:58 +03:00
committed by Massimo Fabbro
parent 21122c0d28
commit 98c28a1f30
2 changed files with 97 additions and 41 deletions
+8 -4
View File
@@ -20,10 +20,14 @@ dependencies = [
"typing_extensions",
]
[project.optional-dependencies]
advanced = [
"typst",
]
[project.optional-dependencies]
advanced = [
"typst",
]
spreadsheet = [
"odfpy",
"openpyxl",
]
[project.urls]
Homepage = "http://ifcopenshell.org"