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>
(cherry picked from commit 98c28a1f30)
This commit is contained in:
Petru Conduraru
2026-07-05 21:40:58 +03:00
committed by Dion Moult
parent 10028de0d7
commit 1d1bb2276d
2 changed files with 97 additions and 41 deletions
+8 -4
View File
@@ -19,10 +19,14 @@ dependencies = [
"ifcopenshell",
]
[project.optional-dependencies]
advanced = [
"typst",
]
[project.optional-dependencies]
advanced = [
"typst",
]
spreadsheet = [
"odfpy",
"openpyxl",
]
[project.urls]
Homepage = "http://ifcopenshell.org"