Skip to content

Commit 9c87752

Browse files
committed
fix: ajustement de l'export Certipaq
Inversion des colonnes P/Q
1 parent dfb46fd commit 9c87752

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

src/components/Features/ExportStrategies/CertipaqExporter.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ const getSheet = ({ featureCollection, operator, permissions }) => {
5050
{ wch: 10 }, { wch: 10 },
5151
// Id. Parcelle
5252
{ wch: 16 },
53+
// Code culture
54+
'',
5355
// [ blank ]
5456
'',
5557
// Totaux - AB - C1 - C2 - C3 - C0 - Total
@@ -59,7 +61,7 @@ const getSheet = ({ featureCollection, operator, permissions }) => {
5961
// First sheet: plots informations (via `featureCollection`)
6062
sheet_add_aoa(sheet, [
6163
[ '', '', '', '', 'Surfaces en ha', '', '', '', '', '', '', '', '', 'Dernier intrant non autorisé en AB', '', '', ''],
62-
['Commune', 'Ilot', 'Culture', 'Variété / infos', 'C0', 'AB', 'C1', 'C2', 'C3', 'Date conv', 'Observation / date de semis', 'Précédent', 'Anté précédent', 'Produit', 'Date', 'Code culture', 'Id. Parcelle'],
64+
['Commune', 'Ilot', 'Culture', 'Variété / infos', 'C0', 'AB', 'C1', 'C2', 'C3', 'Date conv', 'Observation / date de semis', 'Précédent', 'Anté précédent', 'Produit', 'Date', 'Id. Parcelle', 'Code culture'],
6365
], { origin: 'A4'})
6466

6567
sheet_add_aoa(sheet, featureCollection.features.map(({ geometry, properties: props, id }) => {
@@ -93,16 +95,16 @@ const getSheet = ({ featureCollection, operator, permissions }) => {
9395
'',
9496
// Date
9597
'',
96-
// Code culture (CPF) #P
97-
culture?.code_cpf,
98-
// Id. Parcelle #Q
98+
// Id. Parcelle #P
9999
String(id),
100+
// Code culture (CPF) #Q
101+
culture?.code_cpf,
100102
]
101103
}), { origin: 'A6', cellDates: true })
102104

103105
// Formattage des cellules, s'il y a une valeur
104106
featureCollection.features.forEach((feature, index) => {
105-
sheet[`Q${6 + index}`].t = 's';
107+
sheet[`P${6 + index}`].t = 's';
106108

107109
if (sheet[`J${6 + index}`].v) {
108110
sheet[`J${6 + index}`].t = 'd'

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ describe('CertipaqExporter', () => {
3434
"Anté précédent",
3535
"Produit",
3636
"Date",
37-
"Code culture",
38-
"Id. Parcelle"
37+
"Id. Parcelle",
38+
"Code culture"
3939
],
4040
[
4141
'',
@@ -53,8 +53,8 @@ describe('CertipaqExporter', () => {
5353
'',
5454
'',
5555
'',
56-
'01.19.10.8',
57-
'1'
56+
'1',
57+
'01.19.10.8'
5858
],
5959
[
6060
'',
@@ -72,8 +72,8 @@ describe('CertipaqExporter', () => {
7272
'',
7373
'',
7474
'',
75-
'01.19.10.8',
76-
'2'
75+
'2',
76+
'01.19.10.8'
7777
],
7878
[
7979
'',
@@ -91,8 +91,8 @@ describe('CertipaqExporter', () => {
9191
'',
9292
'',
9393
'',
94-
'01.19.10.8',
95-
'3'
94+
'3',
95+
'01.19.10.8'
9696
],
9797
[
9898
'',
@@ -110,8 +110,8 @@ describe('CertipaqExporter', () => {
110110
'',
111111
'',
112112
'',
113-
'01.19.10.7',
114-
'4'
113+
'4',
114+
'01.19.10.7'
115115
],
116116
[
117117
'',
@@ -129,8 +129,8 @@ describe('CertipaqExporter', () => {
129129
'',
130130
'',
131131
'',
132-
'',
133-
'5'
132+
'5',
133+
''
134134
]
135135
]
136136

0 commit comments

Comments
 (0)