diff --git a/backend/lcfs/web/api/final_supply_equipment/repo.py b/backend/lcfs/web/api/final_supply_equipment/repo.py index b3680584f..f2353b624 100644 --- a/backend/lcfs/web/api/final_supply_equipment/repo.py +++ b/backend/lcfs/web/api/final_supply_equipment/repo.py @@ -201,7 +201,7 @@ async def get_fse_list(self, report_id: int) -> List[FinalSupplyEquipment]: joinedload(FinalSupplyEquipment.level_of_equipment), ) .where(FinalSupplyEquipment.compliance_report_id == report_id) - .order_by(FinalSupplyEquipment.final_supply_equipment_id) + .order_by(FinalSupplyEquipment.create_date.asc()) ) return result.unique().scalars().all() @@ -232,7 +232,7 @@ async def get_fse_paginated( result = await self.db.execute( query.offset(offset) .limit(limit) - .order_by(FinalSupplyEquipment.create_date.desc()) + .order_by(FinalSupplyEquipment.create_date.asc()) ) final_supply_equipments = result.unique().scalars().all() return final_supply_equipments, total_count @@ -356,7 +356,7 @@ async def increment_seq_by_org_and_postal_code( sequence_number = 1 return sequence_number - + @repo_handler async def check_uniques_of_fse_row(self, row: FinalSupplyEquipmentCreateSchema) -> bool: """ diff --git a/frontend/src/views/FinalSupplyEquipments/FinalSupplyEquipmentSummary.jsx b/frontend/src/views/FinalSupplyEquipments/FinalSupplyEquipmentSummary.jsx index 4753dc1fc..1869f3c63 100644 --- a/frontend/src/views/FinalSupplyEquipments/FinalSupplyEquipmentSummary.jsx +++ b/frontend/src/views/FinalSupplyEquipments/FinalSupplyEquipmentSummary.jsx @@ -8,11 +8,12 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { useLocation, useParams, useNavigate } from 'react-router-dom' import { v4 as uuid } from 'uuid' +import { numberFormatter } from '@/utils/formatters.js' export const FinalSupplyEquipmentSummary = ({ data }) => { const [alertMessage, setAlertMessage] = useState('') const [alertSeverity, setAlertSeverity] = useState('info') - const [gridKey, setGridKey] = useState(`final-supply-equipments-grid`) + const [gridKey, setGridKey] = useState('final-supply-equipments-grid') const { complianceReportId, compliancePeriod } = useParams() const gridRef = useRef() @@ -72,8 +73,7 @@ export const FinalSupplyEquipmentSummary = ({ data }) => { 'finalSupplyEquipment:finalSupplyEquipmentColLabels.kwhUsage' ), field: 'kwhUsage', - valueFormatter: (params) => - params.value ? params.value.toFixed(2) : '0.00' + valueFormatter: numberFormatter }, { headerName: t(