From 854174296a1edf35232e2a7d530d0924e3eb666a Mon Sep 17 00:00:00 2001 From: qedi-r <1435081+qedi-r@users.noreply.github.com> Date: Sun, 25 Aug 2024 19:34:18 -0400 Subject: [PATCH] add removed tombstone and update linting --- .../src/components/transactions/TransactionsTable.jsx | 4 +++- packages/loot-core/src/server/db/index.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index d8d5bad4dd9..ab2a687bb2b 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -1240,7 +1240,9 @@ const Transaction = memo(function Transaction({ focused={focusedField === 'payee'} /* Filter out the account we're currently in as it is not a valid transfer */ accounts={accounts.filter(account => account.id !== accountId)} - payees={payees.filter(payee => !payee.transfer_acct || payee.transfer_acct !== accountId)} + payees={payees.filter( + payee => !payee.transfer_acct || payee.transfer_acct !== accountId, + )} valueStyle={valueStyle} transaction={transaction} subtransactions={subtransactions} diff --git a/packages/loot-core/src/server/db/index.ts b/packages/loot-core/src/server/db/index.ts index cf7f29fbb7d..04f49ee3697 100644 --- a/packages/loot-core/src/server/db/index.ts +++ b/packages/loot-core/src/server/db/index.ts @@ -11,10 +11,9 @@ import { Database } from '@jlongster/sql.js'; import LRU from 'lru-cache'; import { v4 as uuidv4 } from 'uuid'; -import { toDateRepr } from '../models'; -import * as monthUtils from 'loot-core/src/shared/months'; import * as fs from '../../platform/server/fs'; import * as sqlite from '../../platform/server/sqlite'; +import * as monthUtils from '../../shared/months'; import { groupById } from '../../shared/util'; import { CategoryEntity, @@ -29,6 +28,7 @@ import { convertFromSelect, } from '../aql'; import { + toDateRepr, accountModel, categoryModel, categoryGroupModel, @@ -546,7 +546,9 @@ export function getPayees() { } export function getCommonPayees() { - const twelveWeeksAgo = toDateRepr(monthUtils.subWeeks(monthUtils.currentDate(), 12)); + const twelveWeeksAgo = toDateRepr( + monthUtils.subWeeks(monthUtils.currentDate(), 12), + ); const limit = 10; return all(` SELECT p.id as id, p.name as name, p.favorite as favorite, @@ -556,6 +558,7 @@ export function getCommonPayees() { FROM payees p LEFT JOIN v_transactions_internal_alive t on t.payee == p.id WHERE LENGTH(p.name) > 0 + AND p.tombstone = 0 AND t.date > ${twelveWeeksAgo} GROUP BY p.id ORDER BY c DESC ,p.transfer_acct IS NULL DESC, p.name