Skip to content

Commit 61b3197

Browse files
authored
Merge pull request #1999 from bcgov/fix/fse-export-fix-1920
fix: Add Decimal6 to XLSX
2 parents f4d2b67 + a34f928 commit 61b3197

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

backend/lcfs/utils/spreadsheet_builder.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class SpreadsheetColumn:
1717
def __init__(
18-
self, label: str, column_type: Literal["float", "int", "text", "date"]
18+
self, label: str, column_type: Literal["float", "int", "text", "date", "decimal6"]
1919
):
2020
self.label = label
2121
self.column_type = column_type
@@ -134,6 +134,9 @@ def _write_sheet_to_excel(self, writer, sheet: SheetData):
134134
cell.alignment = styles.Alignment(horizontal="right")
135135
elif column.column_type == "date":
136136
cell.number_format = "yyyy-mm-dd"
137+
elif column.column_type == "decimal6":
138+
cell.number_format = "#,##0.00####"
139+
cell.alignment = styles.Alignment(horizontal="right")
137140

138141
self._apply_excel_styling(writer, sheet)
139142

backend/lcfs/web/api/final_supply_equipment/export.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
SpreadsheetColumn("Street address", "text"),
3131
SpreadsheetColumn("City", "text"),
3232
SpreadsheetColumn("Postal code", "text"),
33-
SpreadsheetColumn("Latitude", "float"),
34-
SpreadsheetColumn("Longitude", "float"),
33+
SpreadsheetColumn("Latitude", "decimal6"),
34+
SpreadsheetColumn("Longitude", "decimal6"),
3535
SpreadsheetColumn("Notes", "text"),
3636
]
3737

frontend/src/views/FinalSupplyEquipments/_schema.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ export const finalSupplyEquipmentColDefs = (
336336
),
337337
cellEditor: 'agNumberCellEditor',
338338
cellEditorParams: {
339-
precision: 4,
339+
precision: 6,
340+
max: 1000,
340341
showStepperButtons: false
341342
},
342343
cellDataType: 'number',
@@ -352,7 +353,8 @@ export const finalSupplyEquipmentColDefs = (
352353
),
353354
cellEditor: 'agNumberCellEditor',
354355
cellEditorParams: {
355-
precision: 4,
356+
precision: 6,
357+
max: 1000,
356358
showStepperButtons: false
357359
},
358360
cellDataType: 'number',

0 commit comments

Comments
 (0)