Améliorationde l'import

This commit is contained in:
2026-07-04 18:55:40 +02:00
parent 11790c63fe
commit b138bc53ee
3 changed files with 180 additions and 8 deletions
+3 -3
View File
@@ -60,11 +60,11 @@ function mouvToCSV(rows) {
return BOM + [headers,...data].map(r => r.map(q).join(sep)).join('\r\n');
}
function mouvToXLS(rows) {
function mouvToXLS(rows, multiDetenteur) {
const data = rows.map(r => ({
'Date': r.date_operation,
'Plateforme': r.plateforme_nom || '',
'Détenteur': r.plateforme_detenteur_nom || '',
...(multiDetenteur ? { 'Détenteur': r.plateforme_detenteur_nom || '' } : {}),
'Type': r.type === 'depot' ? 'Dépôt' : 'Retrait',
'Montant (€)': r.montant,
}));
@@ -1155,7 +1155,7 @@ export default function DepotsRetraits() {
<ExportDropdown
disabled={rows.length === 0}
onCSV={() => dlBlob(mouvToCSV(rows), 'mouvements.csv', 'text/csv;charset=utf-8')}
onXLS={() => dlBlob(mouvToXLS(rows), 'mouvements.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')}
onXLS={() => dlBlob(mouvToXLS(rows, multiDetenteur), 'mouvements.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')}
onJSON={() => dlBlob(mouvToJSON(rows), 'mouvements.json', 'application/json')}
/>
</div>