Skip to content

Commit

Permalink
added cleared column in csv export (#2138)
Browse files Browse the repository at this point in the history
* added cleared column in csv export

* added release note
  • Loading branch information
kstockk authored Jan 6, 2024
1 parent d9aeb8d commit 458d556
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/loot-core/src/server/accounts/export-to-csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,24 @@ export async function exportToCSV(
}, {});

const transactionsForExport = transactions.map(
({ account, date, payee, notes, category, amount }) => ({
({
account,
date,
payee,
notes,
category,
amount,
cleared,
reconciled,
}) => ({
Account: accountNamesById[account],
Date: date,
Payee: payeeNamesById[payee],
Notes: notes,
Category: categoryNamesById[category],
Amount: amount == null ? 0 : integerToAmount(amount),
Cleared: cleared,
Reconciled: reconciled,
}),
);

Expand All @@ -57,6 +68,8 @@ export async function exportQueryToCSV(query) {
{ Notes: 'notes' },
{ Category: 'category.name' },
{ Amount: 'amount' },
{ Cleared: 'cleared' },
{ Reconciled: 'reconciled' },
])
.options({ splits: 'all' }),
);
Expand All @@ -80,6 +93,12 @@ export async function exportQueryToCSV(query) {
Notes: trans.Notes,
Category: trans.Category,
Amount: trans.Amount == null ? 0 : integerToAmount(trans.Amount),
Cleared:
trans.Reconciled === true
? 'Reconciled'
: trans.Cleared === true
? 'Cleared'
: 'Not cleared',
};
});

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2138.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [kstockk]
---

Add cleared column in csv export

0 comments on commit 458d556

Please sign in to comment.