to payee
This commit is contained in:
@@ -30,11 +30,23 @@ function extractTransactions(
|
||||
}
|
||||
|
||||
// 2. Filter by group key
|
||||
if (selectedGroupKey?.tags && selectedGroupKey.tags.length > 0) {
|
||||
return rawTxns.filter(txn => {
|
||||
if (!txn.tags) return false;
|
||||
const txnTags = txn.tags.map(t => typeof t === "string" ? t : t.name);
|
||||
return selectedGroupKey.tags!.every(selectedTag => txnTags.includes(selectedTag));
|
||||
if (selectedGroupKey) {
|
||||
rawTxns = rawTxns.filter(txn => {
|
||||
let match = true;
|
||||
if (selectedGroupKey.tags && selectedGroupKey.tags.length > 0) {
|
||||
if (!txn.tags) match = false;
|
||||
else {
|
||||
const txnTags = txn.tags.map(t => typeof t === "string" ? t : t.name);
|
||||
if (!selectedGroupKey.tags.every(selectedTag => txnTags.includes(selectedTag))) match = false;
|
||||
}
|
||||
}
|
||||
if (match && selectedGroupKey.payee && selectedGroupKey.payee.length > 0) {
|
||||
if (!txn.payee || !txn.payee.name) match = false;
|
||||
else {
|
||||
if (!selectedGroupKey.payee.includes(txn.payee.name)) match = false;
|
||||
}
|
||||
}
|
||||
return match;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user