Skip to content

Commit

Permalink
add removed tombstone and update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
qedi-r committed Aug 25, 2024
1 parent 98e2381 commit 8541742
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
9 changes: 6 additions & 3 deletions packages/loot-core/src/server/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -29,6 +28,7 @@ import {
convertFromSelect,
} from '../aql';
import {
toDateRepr,
accountModel,
categoryModel,
categoryGroupModel,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 8541742

Please sign in to comment.