Améliorationde l'import
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user