Skip to content

Commit 75012f3

Browse files
authored
Merge pull request #251 from AgenceBio/fix/certisud-digits
2 parents de130a0 + c5fd551 commit 75012f3

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

src/components/Features/ExportStrategies/BureauVeritasExporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const getSheet = ({ featureCollection, operator }) => {
8989
]
9090
], { origin: `B${2 + index}`, cellDates: true });
9191

92-
// Formattage des totaux
92+
// surface is a 2 digits figure
9393
sheet[`G${2 + index}`].t = 'n'
9494
sheet[`G${2 + index}`].z = '0.00'
9595
})

src/components/Features/ExportStrategies/CertisExporter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ const getSheet = ({ featureCollection, operator, record }) => {
135135
featureCollection.features.forEach((feature, index) => {
136136
const rowIndex = index + 8;
137137

138+
// surface is a 2 digits figure
138139
sheet[`D${rowIndex}`].t = 'n'
139140
sheet[`D${rowIndex}`].z = '0.00'
140141

src/components/Features/ExportStrategies/CertisudExporter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
GROUPE_DATE_ENGAGEMENT,
77
GROUPE_NIVEAU_CONVERSION
88
} from '@/components/Features/index.js'
9-
import BaseExporter, { generateAutresInfos, humanNumbers } from "@/components/Features/ExportStrategies/BaseExporter.js";
9+
import BaseExporter, { generateAutresInfos } from "@/components/Features/ExportStrategies/BaseExporter.js";
1010

1111
const { aoa_to_sheet, book_append_sheet, book_new, sheet_add_aoa } = utils
1212

@@ -51,12 +51,16 @@ const getSheet = ({ featureCollection, operator }) => {
5151
sheet_add_aoa(sheet, [
5252
[
5353
culture?.libelle_code_cpf ?? `[ERREUR] correspondance manquante avec ${mainKey}`,
54-
humanNumbers(surface / 10_000),
54+
surface / 10_000,
5555
autresInfos,
5656
features.at(0).properties.conversion_niveau ?? '',
5757
features.at(0).properties.engagement_date ? new Date(features.at(0).properties.engagement_date) : '',
5858
]
5959
], { origin: `A${2 + index}`, cellDates: true });
60+
61+
// surface is a 2 digits figure
62+
sheet[`B${2 + index}`].t = 'n'
63+
sheet[`B${2 + index}`].z = '0.00'
6064
})
6165

6266
return sheet

src/components/Features/ExportStrategies/CertisudExporter.test.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,39 @@ describe('CertisudExporter', () => {
2020
],
2121
[
2222
'Luzerne',
23-
'2,1',
23+
// expect.closeTo(2.1), // in vite@5 + vitest@1
24+
2.092976314534671,
2425
'',
2526
'C1',
2627
new Date('2023-01-01T00:00:00.000Z'),
2728
],
2829
[
2930
'Luzerne',
30-
'1,0',
31+
// expect.closeTo(1.0), // in vite@5 + vitest@1
32+
1.0464881572673355,
3133
'',
3234
'AB',
3335
new Date('2021-01-01T00:00:00.000Z'),
3436
],
3537
[
3638
'Trèfle',
37-
'1,0',
39+
// expect.closeTo(1.0), // in vite@5 + vitest@1
40+
1.0464881572673355,
3841
'4 feuilles, 2023-03-01',
3942
'AB',
4043
new Date('2021-01-01T00:00:00.000Z'),
4144
],
4245
[
4346
'Trèfle',
44-
'1,0',
47+
// expect.closeTo(1.0), // in vite@5 + vitest@1
48+
1.0464881572673355,
4549
'4 feuilles, 2023-03-01',
4650
'AB',
4751
new Date('2015-01-01T00:00:00.000Z'),
4852
],
4953
[
5054
'[ERREUR] correspondance manquante avec 01.19.99',
51-
'1,0',
55+
1.0464881572673355,
5256
'',
5357
'',
5458
'',

src/components/Features/ExportStrategies/QualisudExporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const getSheet = ({ featureCollection }) => {
6363
]
6464
], { origin: `A${rowIndex}`, cellDates: true });
6565

66-
// Formattage des totaux
66+
// surface is a 2 digits figure
6767
sheet[`D${rowIndex}`].t = 'n'
6868
sheet[`D${rowIndex}`].z = '0.00'
6969
sheet[`G${rowIndex}`].t = 's'

src/components/Features/ExportStrategies/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const isProduction = Boolean(import.meta.env.PROD)
1414

1515
const exporters = new Map([
1616
// Use a custom exporter in development to ease testing
17-
[1, isProduction ? DefaultExporter : CertisExporter],
17+
[1, isProduction ? DefaultExporter : CertisudExporter],
1818
// Production exports
1919
[2, BureauVeritasExporter],
2020
[3, CertipaqExporter],

0 commit comments

Comments
 (0)