A local-first personal finance app
Lock transactions after reconcilliation (#1789)
Zach Whelchelca498b19cc1d
diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsxindex e47d026b13..643ef4a089 100644--- a/packages/desktop-client/src/components/Modals.tsx+++ b/packages/desktop-client/src/components/Modals.tsx@@ -11,6 +11,7 @@ import { type CommonModalProps } from '../types/modals';import CloseAccount from './modals/CloseAccount';import ConfirmCategoryDelete from './modals/ConfirmCategoryDelete';+import ConfirmTransactionEdit from './modals/ConfirmTransactionEdit';import CreateAccount from './modals/CreateAccount';import CreateEncryptionKey from './modals/CreateEncryptionKey';import CreateLocalAccount from './modals/CreateLocalAccount';@@ -124,6 +125,15 @@ export default function Modals() {/>);+ case 'confirm-transaction-edit':+ return (+ <ConfirmTransactionEdit+ modalProps={modalProps}+ onConfirm={options.onConfirm}+ confirmReason={options.confirmReason}+ />+ );+case 'load-backup':return (<LoadBackupdiff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.jsindex 4d4096cfd3..268b8f51b0 100644--- a/packages/desktop-client/src/components/accounts/Account.js+++ b/packages/desktop-client/src/components/accounts/Account.js@@ -693,11 +693,68 @@ class AccountInternal extends PureComponent {return null;};- onReconcile = balance => {+ lockTransactions = async () => {+ this.setState({ workingHard: true });++ let { accountId } = this.props;++ let { data } = await runQuery(+ q('transactions')+ .filter({ cleared: true, reconciled: false, account: accountId })+ .select('*')+ .options({ splits: 'grouped' }),+ );+ let transactions = ungroupTransactions(data);++ let changes = { updated: [] };++ transactions.forEach(trans => {+ let { diff } = updateTransaction(transactions, {+ ...trans,+ reconciled: true,+ });++ transactions = applyChanges(diff, transactions);++ changes.updated = changes.updated+ ? changes.updated.concat(diff.updated)+ : diff.updated;+ });++ await send('transactions-batch-update', changes);+ await this.refetchTransactions();+ };++ onReconcile = async balance => {this.setState({ reconcileAmount: balance });};- onDoneReconciling = () => {+ onDoneReconciling = async () => {+ let { accountId } = this.props;+ let { reconcileAmount } = this.state;++ let { data } = await runQuery(+ q('transactions')+ .filter({ cleared: true, account: accountId })+ .select('*')+ .options({ splits: 'grouped' }),+ );+ let transactions = ungroupTransactions(data);++ let cleared = 0;++ transactions.forEach(trans => {+ if (!trans.is_parent) {+ cleared += trans.amount;+ }+ });++ let targetDiff = reconcileAmount - cleared;++ if (targetDiff === 0) {+ await this.lockTransactions();+ }+this.setState({ reconcileAmount: null });};@@ -708,6 +765,7 @@ class AccountInternal extends PureComponent {id: 'temp',account: this.props.accountId,cleared: true,+ reconciled: false,amount: diff,date: currentDay(),notes: 'Reconciliation balance adjustment',@@ -716,7 +774,7 @@ class AccountInternal extends PureComponent {// Optimistic UI: update the transaction list before sending the data to the databasethis.setState({- transactions: [...this.state.transactions, ...reconciliationTransactions],+ transactions: [...reconciliationTransactions, ...this.state.transactions],});// sync the reconciliation transaction@@ -756,6 +814,12 @@ class AccountInternal extends PureComponent {const idSet = new Set(ids);transactions.forEach(trans => {+ if (name === 'cleared' && trans.reconciled) {+ // Skip transactions that are reconciled. Don't want to set them as+ // uncleared.+ return;+ }+if (!idSet.has(trans.id)) {// Skip transactions which aren't actually selected, since the query// above also retrieves the siblings & parent of any selected splits.@@ -792,6 +856,26 @@ class AccountInternal extends PureComponent {}};+ if (name === 'amount' || name === 'payee' || name === 'account') {+ let { data } = await runQuery(+ q('transactions')+ .filter({ id: { $oneof: ids }, reconciled: true })+ .select('*')+ .options({ splits: 'grouped' }),+ );+ let transactions = ungroupTransactions(data);++ if (transactions.length > 0) {+ this.props.pushModal('confirm-transaction-edit', {+ onConfirm: () => {+ this.props.pushModal('edit-field', { name, onSubmit: onChange });+ },+ confirmReason: 'batchEditWithReconciled',+ });+ return;+ }+ }+if (name === 'cleared') {// Cleared just toggles it on/off and it depends on the data// loaded. Need to clean this up in the future.@@ -802,72 +886,108 @@ class AccountInternal extends PureComponent {};onBatchDuplicate = async ids => {- this.setState({ workingHard: true });+ let onConfirmDuplicate = async ids => {+ this.setState({ workingHard: true });- let { data } = await runQuery(- q('transactions')- .filter({ id: { $oneof: ids } })- .select('*')- .options({ splits: 'grouped' }),- );+ let { data } = await runQuery(+ q('transactions')+ .filter({ id: { $oneof: ids } })+ .select('*')+ .options({ splits: 'grouped' }),+ );- let changes = {- added: data- .reduce((newTransactions, trans) => {- return newTransactions.concat(- realizeTempTransactions(ungroupTransaction(trans)),- );- }, [])- .map(({ sort_order, ...trans }) => ({ ...trans })),- };+ let changes = {+ added: data+ .reduce((newTransactions, trans) => {+ return newTransactions.concat(+ realizeTempTransactions(ungroupTransaction(trans)),+ );+ }, [])+ .map(({ sort_order, ...trans }) => ({ ...trans })),+ };- await send('transactions-batch-update', changes);+ await send('transactions-batch-update', changes);- await this.refetchTransactions();+ await this.refetchTransactions();+ };++ await this.checkForReconciledTransactions(+ ids,+ 'batchDuplicateWithReconciled',+ onConfirmDuplicate,+ );};onBatchDelete = async ids => {- this.setState({ workingHard: true });+ let onConfirmDelete = async ids => {+ this.setState({ workingHard: true });- let { data } = await runQuery(- q('transactions')- .filter({ id: { $oneof: ids } })- .select('*')- .options({ splits: 'grouped' }),- );- let transactions = ungroupTransactions(data);+ let { data } = await runQuery(+ q('transactions')+ .filter({ id: { $oneof: ids } })+ .select('*')+ .options({ splits: 'grouped' }),+ );+ let transactions = ungroupTransactions(data);- let idSet = new Set(ids);- let changes = { deleted: [], updated: [] };+ let idSet = new Set(ids);+ let changes = { deleted: [], updated: [] };- transactions.forEach(trans => {- let parentId = trans.parent_id;+ transactions.forEach(trans => {+ let parentId = trans.parent_id;- // First, check if we're actually deleting this transaction by- // checking `idSet`. Then, we don't need to do anything if it's- // a child transaction and the parent is already being deleted- if (!idSet.has(trans.id) || (parentId && idSet.has(parentId))) {- return;- }+ // First, check if we're actually deleting this transaction by+ // checking `idSet`. Then, we don't need to do anything if it's+ // a child transaction and the parent is already being deleted+ if (!idSet.has(trans.id) || (parentId && idSet.has(parentId))) {+ return;+ }- let { diff } = deleteTransaction(transactions, trans.id);+ let { diff } = deleteTransaction(transactions, trans.id);- // TODO: We need to keep an updated list of transactions so- // the logic in `updateTransaction`, particularly about- // updating split transactions, works. This isn't ideal and we- // should figure something else out- transactions = applyChanges(diff, transactions);+ // TODO: We need to keep an updated list of transactions so+ // the logic in `updateTransaction`, particularly about+ // updating split transactions, works. This isn't ideal and we+ // should figure something else out+ transactions = applyChanges(diff, transactions);- changes.deleted = diff.deleted- ? changes.deleted.concat(diff.deleted)- : diff.deleted;- changes.updated = diff.updated- ? changes.updated.concat(diff.updated)- : diff.updated;- });+ changes.deleted = diff.deleted+ ? changes.deleted.concat(diff.deleted)+ : diff.deleted;+ changes.updated = diff.updated+ ? changes.updated.concat(diff.updated)+ : diff.updated;+ });- await send('transactions-batch-update', changes);- await this.refetchTransactions();+ await send('transactions-batch-update', changes);+ await this.refetchTransactions();+ };++ await this.checkForReconciledTransactions(+ ids,+ 'batchDeleteWithReconciled',+ onConfirmDelete,+ );+ };++ checkForReconciledTransactions = async (ids, confirmReason, onConfirm) => {+ let { data } = await runQuery(+ q('transactions')+ .filter({ id: { $oneof: ids }, reconciled: true })+ .select('*')+ .options({ splits: 'grouped' }),+ );+ let transactions = ungroupTransactions(data);+ if (transactions.length > 0) {+ this.props.pushModal('confirm-transaction-edit', {+ onConfirm: () => {+ onConfirm(ids);+ },+ confirmReason: confirmReason,+ });+ } else {+ onConfirm(ids);+ }};onBatchUnlink = async ids => {diff --git a/packages/desktop-client/src/components/mobile/MobileForms.js b/packages/desktop-client/src/components/mobile/MobileForms.jsindex f0092359a6..a2fb719f94 100644--- a/packages/desktop-client/src/components/mobile/MobileForms.js+++ b/packages/desktop-client/src/components/mobile/MobileForms.js@@ -111,9 +111,10 @@ export function TapField({);}-export function BooleanField({ checked, onUpdate, style }) {+export function BooleanField({ checked, onUpdate, style, disabled = false }) {return (<input+ disabled={disabled ? true : undefined}type="checkbox"checked={checked}onChange={e => onUpdate(e.target.checked)}diff --git a/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx b/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsxnew file mode 100644index 0000000000..837872dd9b--- /dev/null+++ b/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx@@ -0,0 +1,87 @@+import React from 'react';++import { type CommonModalProps } from '../../types/modals';+import Block from '../common/Block';+import Button from '../common/Button';+import Modal from '../common/Modal';+import View from '../common/View';++type ConfirmTransactionEditProps = {+ modalProps: Partial<CommonModalProps>;+ onConfirm: () => void;+ confirmReason: string;+};++function ConfirmTransactionEdit({+ modalProps,+ onConfirm,+ confirmReason,+}: ConfirmTransactionEditProps) {+ return (+ <Modal title="Reconciled Transaction" {...modalProps} style={{ flex: 0 }}>+ {() => (+ <View style={{ lineHeight: 1.5 }}>+ {confirmReason === 'batchDeleteWithReconciled' ? (+ <Block>+ Deleting reconciled transactions may bring your reconciliation out+ of balance.+ </Block>+ ) : confirmReason === 'batchEditWithReconciled' ? (+ <Block>+ Editing reconciled transactions may bring your reconciliation out+ of balance.+ </Block>+ ) : confirmReason === 'batchDuplicateWithReconciled' ? (+ <Block>+ Duplicating reconciled transactions may bring your reconciliation+ out of balance.+ </Block>+ ) : confirmReason === 'editReconciled' ? (+ <Block>+ Saving your changes to this reconciled transaction may bring your+ reconciliation out of balance.+ </Block>+ ) : confirmReason === 'deleteReconciled' ? (+ <Block>+ Deleting this reconciled transaction may bring your reconciliation+ out of balance.+ </Block>+ ) : (+ <Block>Are you sure you want to edit this transaction?</Block>+ )}++ <View+ style={{+ marginTop: 20,+ flexDirection: 'row',+ justifyContent: 'flex-start',+ alignItems: 'center',+ }}+ >+ <View+ style={{+ flexDirection: 'row',+ justifyContent: 'flex-end',+ }}+ >+ <Button style={{ marginRight: 10 }} onClick={modalProps.onClose}>+ Cancel+ </Button>+ <Button+ type="primary"+ onClick={() => {+ onConfirm();+ modalProps.onClose();+ }}+ >+ Confirm+ </Button>+ </View>+ </View>+ </View>+ )}+ </Modal>+ );+}++export default ConfirmTransactionEdit;diff --git a/packages/desktop-client/src/components/schedules/StatusBadge.tsx b/packages/desktop-client/src/components/schedules/StatusBadge.tsxindex e7c91568f6..1b018e4836 100644--- a/packages/desktop-client/src/components/schedules/StatusBadge.tsx+++ b/packages/desktop-client/src/components/schedules/StatusBadge.tsx@@ -9,13 +9,14 @@ import CheckCircle1 from '../../icons/v2/CheckCircle1';import CheckCircleHollow from '../../icons/v2/CheckCircleHollow';import EditSkull1 from '../../icons/v2/EditSkull1';import FavoriteStar from '../../icons/v2/FavoriteStar';+import Lock from '../../icons/v2/LockClosed';import ValidationCheck from '../../icons/v2/ValidationCheck';import { theme } from '../../style';import Text from '../common/Text';import View from '../common/View';// Consists of Schedule Statuses + Transaction statuses-type StatusTypes = ScheduleStatusType | 'cleared' | 'pending';+type StatusTypes = ScheduleStatusType | 'cleared' | 'pending' | 'reconciled';export function getStatusProps(status: StatusTypes) {switch (status) {case 'missed':@@ -66,6 +67,12 @@ export function getStatusProps(status: StatusTypes) {backgroundColor: theme.tableRowHeaderBackground,Icon: CheckCircle1,};+ case 'reconciled':+ return {+ color: theme.noticeTextLight,+ backgroundColor: theme.tableRowHeaderBackground,+ Icon: Lock,+ };default:return {color: theme.buttonNormalDisabledText,diff --git a/packages/desktop-client/src/components/transactions/MobileTransaction.js b/packages/desktop-client/src/components/transactions/MobileTransaction.jsindex 0ff83a3aae..f6105f8a9c 100644--- a/packages/desktop-client/src/components/transactions/MobileTransaction.js+++ b/packages/desktop-client/src/components/transactions/MobileTransaction.js@@ -52,6 +52,7 @@ import CheveronLeft from '../../icons/v1/CheveronLeft';import SvgTrash from '../../icons/v1/Trash';import ArrowsSynchronize from '../../icons/v2/ArrowsSynchronize';import CheckCircle1 from '../../icons/v2/CheckCircle1';+import Lock from '../../icons/v2/LockClosed';import SvgPencilWriteAlternate from '../../icons/v2/PencilWriteAlternate';import { styles, theme } from '../../style';import Button from '../common/Button';@@ -200,32 +201,50 @@ class TransactionEditInner extends PureComponent {};onSave = async () => {- let { transactions } = this.state;- const [transaction, ..._childTransactions] = transactions;- const { account: accountId } = transaction;- let account = getAccountsById(this.props.accounts)[accountId];+ let onConfirmSave = async () => {+ let { transactions } = this.state;+ const [transaction, ..._childTransactions] = transactions;+ const { account: accountId } = transaction;+ let account = getAccountsById(this.props.accounts)[accountId];++ if (transactions.find(t => t.account == null)) {+ // Ignore transactions if any of them don't have an account+ // TODO: Should we display validation error?+ return;+ }- if (transactions.find(t => t.account == null)) {- // Ignore transactions if any of them don't have an account- // TODO: Should we display validation error?- return;- }+ // Since we don't own the state, we have to handle the case where+ // the user saves while editing an input. We won't have the+ // updated value so we "apply" a queued change. Maybe there's a+ // better way to do this (lift the state?)+ if (this._queuedChange) {+ let [transaction, name, value] = this._queuedChange;+ transactions = await this.onEdit(transaction, name, value);+ }- // Since we don't own the state, we have to handle the case where- // the user saves while editing an input. We won't have the- // updated value so we "apply" a queued change. Maybe there's a- // better way to do this (lift the state?)- if (this._queuedChange) {- let [transaction, name, value] = this._queuedChange;- transactions = await this.onEdit(transaction, name, value);- }+ if (this.props.adding) {+ transactions = realizeTempTransactions(transactions);+ }- if (this.props.adding) {- transactions = realizeTempTransactions(transactions);- }+ this.props.onSave(transactions);+ this.props.navigate(`/accounts/${account.id}`, { replace: true });+ };- this.props.onSave(transactions);- this.props.navigate(`/accounts/${account.id}`, { replace: true });+ const { transactions } = this.state;+ const [transaction] = transactions;++ if (transaction.reconciled) {+ // On mobile any save gives the warning.+ // On the web only certain changes trigger a warning.+ // Should we bring that here as well? Or does the nature of the editing form+ // make this more appropriate?+ this.props.pushModal('confirm-transaction-edit', {+ onConfirm: onConfirmSave,+ confirmReason: 'editReconciled',+ });+ } else {+ onConfirmSave();+ }};onSaveChild = childTransaction => {@@ -276,15 +295,29 @@ class TransactionEditInner extends PureComponent {};onDelete = () => {- this.props.onDelete();+ let onConfirmDelete = () => {+ this.props.onDelete();++ const { transactions } = this.state;+ const [transaction, ..._childTransactions] = transactions;+ const { account: accountId } = transaction;+ if (accountId) {+ this.props.navigate(`/accounts/${accountId}`, { replace: true });+ } else {+ this.props.navigate(-1);+ }+ };const { transactions } = this.state;- const [transaction, ..._childTransactions] = transactions;- const { account: accountId } = transaction;- if (accountId) {- this.props.navigate(`/accounts/${accountId}`, { replace: true });+ const [transaction] = transactions;++ if (transaction.reconciled) {+ this.props.pushModal('confirm-transaction-edit', {+ onConfirm: onConfirmDelete,+ confirmReason: 'deleteReconciled',+ });} else {- this.props.navigate(-1);+ onConfirmDelete();}};@@ -579,21 +612,35 @@ class TransactionEditInner extends PureComponent {}/></View>-- <View style={{ marginLeft: 0, marginRight: 8 }}>- <FieldLabel title="Cleared" />- <BooleanField- checked={transaction.cleared}- onUpdate={checked =>- this.onEdit(transaction, 'cleared', checked)- }- style={{- margin: 'auto',- width: 22,- height: 22,- }}- />- </View>+ {transaction.reconciled ? (+ <View style={{ marginLeft: 0, marginRight: 8 }}>+ <FieldLabel title="Reconciled" />+ <BooleanField+ checked+ style={{+ margin: 'auto',+ width: 22,+ height: 22,+ }}+ disabled+ />+ </View>+ ) : (+ <View style={{ marginLeft: 0, marginRight: 8 }}>+ <FieldLabel title="Cleared" />+ <BooleanField+ checked={transaction.cleared}+ onUpdate={checked =>+ this.onEdit(transaction, 'cleared', checked)+ }+ style={{+ margin: 'auto',+ width: 22,+ height: 22,+ }}+ />+ </View>+ )}</View><View>@@ -954,6 +1001,7 @@ class Transaction extends PureComponent {: categoryName;let isPreview = isPreviewId(id);+ let isReconciled = transaction.reconciled;let textStyle = isPreview && {fontStyle: 'italic',color: theme.pageTextLight,@@ -1016,16 +1064,27 @@ class Transaction extends PureComponent {marginTop: 3,}}>- <CheckCircle1- style={{- width: 11,- height: 11,- color: cleared- ? theme.noticeTextLight- : theme.pageTextSubdued,- marginRight: 5,- }}- />+ {isReconciled ? (+ <Lock+ style={{+ width: 11,+ height: 11,+ color: theme.noticeTextLight,+ marginRight: 5,+ }}+ />+ ) : (+ <CheckCircle1+ style={{+ width: 11,+ height: 11,+ color: cleared+ ? theme.noticeTextLight+ : theme.pageTextSubdued,+ marginRight: 5,+ }}+ />+ )}{showCategory && (<TextOneLinestyle={{diff --git a/packages/desktop-client/src/components/transactions/TransactionList.js b/packages/desktop-client/src/components/transactions/TransactionList.jsindex ae871e3d08..417bef7f30 100644--- a/packages/desktop-client/src/components/transactions/TransactionList.js+++ b/packages/desktop-client/src/components/transactions/TransactionList.js@@ -167,6 +167,7 @@ export default function TransactionList({return (<TransactionTableref={tableRef}+ pushModal={pushModal}transactions={allTransactions}loadMoreTransactions={loadMoreTransactions}accounts={accounts}diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.js b/packages/desktop-client/src/components/transactions/TransactionsTable.jsindex 77763babfb..99a7a740a5 100644--- a/packages/desktop-client/src/components/transactions/TransactionsTable.js+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.js@@ -411,11 +411,14 @@ function StatusCell({onEdit,onUpdate,}) {- let isClearedField = status === 'cleared' || status == null;+ let isClearedField =+ status === 'cleared' || status === 'reconciled' || status == null;let statusProps = getStatusProps(status);let statusColor =status === 'cleared'+ ? theme.noticeTextLight+ : status === 'reconciled'? theme.noticeTextLight: status === 'missed'? theme.errorText@@ -732,47 +735,80 @@ const Transaction = memo(function Transaction(props) {setPrevShowZero(showZeroInDeposit);}- function onUpdate(name, value) {- if (transaction[name] !== value) {- let newTransaction = { ...transaction, [name]: value };+ let [showReconciliationWarning, setShowReconciliationWarning] =+ useState(false);- // Don't change the note to an empty string if it's null (since they are both rendered the same)- if (name === 'note' && value === '' && transaction.note == null) {- return;- }+ function onUpdate(name, value) {+ // Had some issues with this is called twice which is a problem now that we are showing a warning+ // modal is the transaction is locked. I added a boolean to guard against showing the modal twice.+ // I'm still not completely happy with how the cells update pre/post modal. Sometimes you have to+ // click off of the cell manually after confirming your change post modal for example. The last+ // row seems to have more issues than others but the combination of tab, return, and clicking out+ // of the cell all have different implications as well.+ if (transaction[name] !== value) {if (- name === 'account' &&- value &&- getAccountsById(accounts)[value].offbudget+ transaction.reconciled === true &&+ (name === 'credit' ||+ name === 'debit' ||+ name === 'payee' ||+ name === 'account')) {- newTransaction.category = null;+ if (showReconciliationWarning === false) {+ setShowReconciliationWarning(true);+ props.pushModal('confirm-transaction-edit', {+ onConfirm: () => {+ setShowReconciliationWarning(false);+ onUpdateAfterConfirm(name, value);+ },+ confirmReason: 'editReconciled',+ });+ }+ } else {+ onUpdateAfterConfirm(name, value);}+ }+ }- // If entering an amount in either of the credit/debit fields, we- // need to clear out the other one so it's always properly- // translated into the desired amount (see- // `deserializeTransaction`)- if (name === 'credit') {- newTransaction['debit'] = '';- } else if (name === 'debit') {- newTransaction['credit'] = '';- }+ function onUpdateAfterConfirm(name, value) {+ let newTransaction = { ...transaction, [name]: value };- // Don't save a temporary value (a new payee) which will be- // filled in with a real id later- if (name === 'payee' && value && value.startsWith('new:')) {- setTransaction(newTransaction);- } else {- let deserialized = deserializeTransaction(- newTransaction,- originalTransaction,- );- // Run the transaction through the formatting so that we know- // it's always showing the formatted result- setTransaction(serializeTransaction(deserialized, showZeroInDeposit));- onSave(deserialized);- }+ // Don't change the note to an empty string if it's null (since they are both rendered the same)+ if (name === 'note' && value === '' && transaction.note == null) {+ return;+ }++ if (+ name === 'account' &&+ value &&+ getAccountsById(accounts)[value].offbudget+ ) {+ newTransaction.category = null;+ }++ // If entering an amount in either of the credit/debit fields, we+ // need to clear out the other one so it's always properly+ // translated into the desired amount (see+ // `deserializeTransaction`)+ if (name === 'credit') {+ newTransaction['debit'] = '';+ } else if (name === 'debit') {+ newTransaction['credit'] = '';+ }++ // Don't save a temporary value (a new payee) which will be+ // filled in with a real id later+ if (name === 'payee' && value && value.startsWith('new:')) {+ setTransaction(newTransaction);+ } else {+ let deserialized = deserializeTransaction(+ newTransaction,+ originalTransaction,+ );+ // Run the transaction through the formatting so that we know+ // it's always showing the formatted result+ setTransaction(serializeTransaction(deserialized, showZeroInDeposit));+ onSave(deserialized);}}@@ -788,6 +824,7 @@ const Transaction = memo(function Transaction(props) {account: accountId,category: categoryId,cleared,+ reconciled,is_parent: isParent,_unmatched = false,_inverse = false,@@ -1284,7 +1321,15 @@ const Transaction = memo(function Transaction(props) {focused={focusedField === 'cleared'}selected={selected}isPreview={isPreview}- status={isPreview ? notes : cleared ? 'cleared' : null}+ status={+ isPreview+ ? notes+ : reconciled+ ? 'reconciled'+ : cleared+ ? 'cleared'+ : null+ }isChild={isChild}onEdit={onEdit}onUpdate={onUpdate}@@ -1595,6 +1640,7 @@ function TransactionTableInner({onToggleSplit={props.onToggleSplit}onNavigateToTransferAccount={onNavigateToTransferAccount}onNavigateToSchedule={onNavigateToSchedule}+ pushModal={props.pushModal}/></>);diff --git a/packages/desktop-client/src/icons/v2/LockClosed.tsx b/packages/desktop-client/src/icons/v2/LockClosed.tsxnew file mode 100644index 0000000000..fea05ad94d--- /dev/null+++ b/packages/desktop-client/src/icons/v2/LockClosed.tsx@@ -0,0 +1,19 @@+import * as React from 'react';+import type { SVGProps } from 'react';+const SvgLockClosed = (props: SVGProps<SVGSVGElement>) => (+ <svg+ {...props}+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 20 20"+ style={{+ color: 'inherit',+ ...props.style,+ }}+ >+ <path+ d="M4 8V6a6 6 0 1 1 12 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h1zm5 6.73V17h2v-2.27a2 2 0 1 0-2 0zM7 6v2h6V6a3 3 0 0 0-6 0z"+ fill="currentColor"+ />+ </svg>+);+export default SvgLockClosed;diff --git a/packages/desktop-client/src/icons/v2/index.ts b/packages/desktop-client/src/icons/v2/index.tsindex bbe7f165b8..c1455d4cdc 100644--- a/packages/desktop-client/src/icons/v2/index.ts+++ b/packages/desktop-client/src/icons/v2/index.ts@@ -22,6 +22,7 @@ export { default as Hyperlink2 } from './Hyperlink2';export { default as Hyperlink3 } from './Hyperlink3';export { default as InformationCircle } from './InformationCircle';export { default as Key } from './Key';+export { default as LockClosed } from './LockClosed';export { default as MoonStars } from './MoonStars';export { default as NavigationMenu } from './NavigationMenu';export { default as NotesPaperText } from './NotesPaperText';diff --git a/packages/desktop-client/src/icons/v2/lock-closed.svg b/packages/desktop-client/src/icons/v2/lock-closed.svgnew file mode 100644index 0000000000..74e6ae37b3--- /dev/null+++ b/packages/desktop-client/src/icons/v2/lock-closed.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M4 8V6a6 6 0 1 1 12 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h1zm5 6.73V17h2v-2.27a2 2 0 1 0-2 0zM7 6v2h6V6a3 3 0 0 0-6 0z"/></svg>\ No newline at end of filediff --git a/packages/loot-core/migrations/1697046240000_add_reconciled.sql b/packages/loot-core/migrations/1697046240000_add_reconciled.sqlnew file mode 100644index 0000000000..65b99f61ea--- /dev/null+++ b/packages/loot-core/migrations/1697046240000_add_reconciled.sql@@ -0,0 +1,5 @@+BEGIN TRANSACTION;++ALTER TABLE transactions ADD COLUMN reconciled INTEGER DEFAULT 0;++COMMIT;diff --git a/packages/loot-core/src/server/__snapshots__/main.test.ts.snap b/packages/loot-core/src/server/__snapshots__/main.test.ts.snapindex bb19731b6e..1825a6e848 100644--- a/packages/loot-core/src/server/__snapshots__/main.test.ts.snap+++ b/packages/loot-core/src/server/__snapshots__/main.test.ts.snap@@ -19,6 +19,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -43,6 +44,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -73,7 +75,7 @@ exports[`Accounts Transfers are properly updated 2`] = `\\"id\\": \\"test-transfer\\",\\"imported_description\\": null,\\"isChild\\": 0,-@@ -22,15 +22,15 @@+@@ -23,15 +23,15 @@\\"tombstone\\": 0,\\"transferred_id\\": \\"id2\\",\\"type\\": null,@@ -98,9 +100,9 @@ exports[`Accounts Transfers are properly updated 3`] = `- First value+ Second value-@@ -17,12 +17,12 @@- \\"parent_id\\": null,+@@ -18,12 +18,12 @@\\"pending\\": 0,+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -113,9 +115,9 @@ exports[`Accounts Transfers are properly updated 3`] = `Object {\\"acct\\": \\"three\\",\\"amount\\": -5000,-@@ -41,10 +41,10 @@- \\"parent_id\\": null,+@@ -43,10 +43,10 @@\\"pending\\": 0,+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,diff --git a/packages/loot-core/src/server/accounts/__snapshots__/parse-file.test.ts.snap b/packages/loot-core/src/server/accounts/__snapshots__/parse-file.test.ts.snapindex 308b06b943..72b569a025 100644--- a/packages/loot-core/src/server/accounts/__snapshots__/parse-file.test.ts.snap+++ b/packages/loot-core/src/server/accounts/__snapshots__/parse-file.test.ts.snap@@ -19,6 +19,7 @@ Array ["notes": "PWW","parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -48,6 +49,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -77,6 +79,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -101,6 +104,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -125,6 +129,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -149,6 +154,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -173,6 +179,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -197,6 +204,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -221,6 +229,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -245,6 +254,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -269,6 +279,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -293,6 +304,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -322,6 +334,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -346,6 +359,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -370,6 +384,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -394,6 +409,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -418,6 +434,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -442,6 +459,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -466,6 +484,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -490,6 +509,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -514,6 +534,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -538,6 +559,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -567,6 +589,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -591,6 +614,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -615,6 +639,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -639,6 +664,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -663,6 +689,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -687,6 +714,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -711,6 +739,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -735,6 +764,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -759,6 +789,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -783,6 +814,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -807,6 +839,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -831,6 +864,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -855,6 +889,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -879,6 +914,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -903,6 +939,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -927,6 +964,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -951,6 +989,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -975,6 +1014,7 @@ Array ["notes": null,"parent_id": null,"pending": 0,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,diff --git a/packages/loot-core/src/server/accounts/__snapshots__/sync.test.ts.snap b/packages/loot-core/src/server/accounts/__snapshots__/sync.test.ts.snapindex 4f3ddb4ca8..53dec38864 100644--- a/packages/loot-core/src/server/accounts/__snapshots__/sync.test.ts.snap+++ b/packages/loot-core/src/server/accounts/__snapshots__/sync.test.ts.snap@@ -18,6 +18,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Transaction 90",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -40,6 +41,7 @@ Array ["parent_id": null,"payee": "id9","payee_name": "Transaction 54",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -62,6 +64,7 @@ Array ["parent_id": null,"payee": "id7","payee_name": "Transaction 79",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -84,6 +87,7 @@ Array ["parent_id": null,"payee": "id6","payee_name": "Transaction 3",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -106,6 +110,7 @@ Array ["parent_id": null,"payee": "id8","payee_name": "Transaction 51",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -128,6 +133,7 @@ Array ["parent_id": null,"payee": "id10","payee_name": "Transaction 68",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -150,6 +156,7 @@ Array ["parent_id": null,"payee": "id3","payee_name": "Starting Balance",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 1,@@ -172,6 +179,7 @@ Array ["parent_id": null,"payee": "id12","payee_name": "Transaction 64",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -194,6 +202,7 @@ Array ["parent_id": null,"payee": "id11","payee_name": "Transaction 11",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -216,6 +225,7 @@ Array ["parent_id": null,"payee": "id15","payee_name": "Transaction 48",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -238,6 +248,7 @@ Array ["parent_id": null,"payee": "id13","payee_name": "Transaction 107",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -260,6 +271,7 @@ Array ["parent_id": null,"payee": "id17","payee_name": "Transaction 56",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -282,6 +294,7 @@ Array ["parent_id": null,"payee": "id14","payee_name": "Transaction 28",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -304,6 +317,7 @@ Array ["parent_id": null,"payee": "id16","payee_name": "Transaction 114",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -318,7 +332,7 @@ exports[`Account sync import never matches existing with financial ids 2`] = `- First value+ Second value-@@ -65,10 +65,54 @@+@@ -68,10 +68,56 @@\\"tombstone\\": 0,\\"transfer_id\\": null,},@@ -338,6 +352,7 @@ exports[`Account sync import never matches existing with financial ids 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id31\\",+ \\"payee_name\\": \\"foo\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -360,6 +375,7 @@ exports[`Account sync import never matches existing with financial ids 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id32\\",+ \\"payee_name\\": \\"bar\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -380,12 +396,35 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- First value+ Second value-@@ -1,110 +1,154 @@+@@ -1,114 +1,160 @@Array [Object {\\"account\\": \\"one\\",- \\"amount\\": 8105,+ \\"amount\\": -1865,++ \\"category\\": null,++ \\"cleared\\": 1,++ \\"date\\": 20171017,++ \\"error\\": null,++ \\"id\\": \\"id36\\",++ \\"imported_id\\": \\"622f7b61-a6be-4ce5-bd2f-50eb14c12f42\\",++ \\"imported_payee\\": \\"Transaction 53\\",++ \\"is_child\\": 0,++ \\"is_parent\\": 0,++ \\"notes\\": null,++ \\"parent_id\\": null,++ \\"payee\\": \\"id34\\",++ \\"payee_name\\": \\"Transaction 53\\",++ \\"reconciled\\": 0,++ \\"schedule\\": null,++ \\"sort_order\\": 123456789,++ \\"starting_balance_flag\\": 0,++ \\"tombstone\\": 0,++ \\"transfer_id\\": null,++ },++ Object {++ \\"account\\": \\"one\\",++ \\"amount\\": -2947,\\"category\\": null,\\"cleared\\": 1,- \\"date\\": 20171015,@@ -394,17 +433,18 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- \\"id\\": \\"id18\\",- \\"imported_id\\": \\"5629ec0c-e559-49f4-9105-91d7b8b8738a\\",- \\"imported_payee\\": \\"Transaction 90\\",-+ \\"id\\": \\"id36\\",-+ \\"imported_id\\": \\"622f7b61-a6be-4ce5-bd2f-50eb14c12f42\\",-+ \\"imported_payee\\": \\"Transaction 53\\",++ \\"id\\": \\"one\\",++ \\"imported_id\\": \\"3591ad03-b705-42e0-945d-402a70371c49\\",++ \\"imported_payee\\": \\"foo\\",\\"is_child\\": 0,\\"is_parent\\": 0,\\"notes\\": null,\\"parent_id\\": null,- \\"payee\\": \\"id5\\",- \\"payee_name\\": \\"Transaction 90\\",-+ \\"payee\\": \\"id34\\",-+ \\"payee_name\\": \\"Transaction 53\\",++ \\"payee\\": \\"id31\\",++ \\"payee_name\\": \\"foo\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -423,17 +463,18 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- \\"id\\": \\"id22\\",- \\"imported_id\\": \\"45a2ad98-acbc-4120-a856-dec0839fa73c\\",- \\"imported_payee\\": \\"Transaction 54\\",-+ \\"id\\": \\"one\\",-+ \\"imported_id\\": \\"3591ad03-b705-42e0-945d-402a70371c49\\",-+ \\"imported_payee\\": \\"foo\\",++ \\"id\\": \\"two\\",++ \\"imported_id\\": \\"01a3a594-a381-49d1-bcf8-331a3c410900\\",++ \\"imported_payee\\": \\"bar\\",\\"is_child\\": 0,\\"is_parent\\": 0,\\"notes\\": null,\\"parent_id\\": null,- \\"payee\\": \\"id9\\",- \\"payee_name\\": \\"Transaction 54\\",-+ \\"payee\\": \\"id31\\",-+ \\"payee_name\\": \\"foo\\",++ \\"payee\\": \\"id32\\",++ \\"payee_name\\": \\"bar\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -443,28 +484,6 @@ exports[`Account sync import never matches existing with financial ids 3`] = `Object {\\"account\\": \\"one\\",- \\"amount\\": -1462,-+ \\"amount\\": -2947,-+ \\"category\\": null,-+ \\"cleared\\": 1,-+ \\"date\\": 20171017,-+ \\"error\\": null,-+ \\"id\\": \\"two\\",-+ \\"imported_id\\": \\"01a3a594-a381-49d1-bcf8-331a3c410900\\",-+ \\"imported_payee\\": \\"bar\\",-+ \\"is_child\\": 0,-+ \\"is_parent\\": 0,-+ \\"notes\\": null,-+ \\"parent_id\\": null,-+ \\"payee\\": \\"id32\\",-+ \\"payee_name\\": \\"bar\\",-+ \\"schedule\\": null,-+ \\"sort_order\\": 123456789,-+ \\"starting_balance_flag\\": 0,-+ \\"tombstone\\": 0,-+ \\"transfer_id\\": null,-+ },-+ Object {-+ \\"account\\": \\"one\\",+ \\"amount\\": -2407,+ \\"category\\": null,+ \\"cleared\\": 1,@@ -479,6 +498,7 @@ exports[`Account sync import never matches existing with financial ids 3`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id33\\",+ \\"payee_name\\": \\"Transaction 32\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -506,6 +526,7 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- \\"payee_name\\": \\"Transaction 79\\",+ \\"payee\\": \\"id5\\",+ \\"payee_name\\": \\"Transaction 90\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -534,6 +555,7 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- \\"payee_name\\": \\"foo\\",+ \\"payee\\": \\"id9\\",+ \\"payee_name\\": \\"Transaction 54\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -562,11 +584,11 @@ exports[`Account sync import never matches existing with financial ids 3`] = `- \\"payee_name\\": \\"bar\\",+ \\"payee\\": \\"id7\\",+ \\"payee_name\\": \\"Transaction 79\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,- \\"tombstone\\": 0,- \\"transfer_id\\": null,"+ \\"tombstone\\": 0,"`;exports[`Account sync import updates transfers when matched 1`] = `@@ -587,6 +609,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Transaction 90",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -609,6 +632,7 @@ Array ["parent_id": null,"payee": "id9","payee_name": "Transaction 54",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -631,6 +655,7 @@ Array ["parent_id": null,"payee": "id7","payee_name": "Transaction 79",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -653,6 +678,7 @@ Array ["parent_id": null,"payee": "id6","payee_name": "Transaction 3",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -675,6 +701,7 @@ Array ["parent_id": null,"payee": "id8","payee_name": "Transaction 51",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -697,6 +724,7 @@ Array ["parent_id": null,"payee": "id10","payee_name": "Transaction 68",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -719,6 +747,7 @@ Array ["parent_id": null,"payee": "id3","payee_name": "Starting Balance",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 1,@@ -741,6 +770,7 @@ Array ["parent_id": null,"payee": "id12","payee_name": "Transaction 64",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -763,6 +793,7 @@ Array ["parent_id": null,"payee": "id11","payee_name": "Transaction 11",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -785,6 +816,7 @@ Array ["parent_id": null,"payee": "id15","payee_name": "Transaction 48",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -807,6 +839,7 @@ Array ["parent_id": null,"payee": "id13","payee_name": "Transaction 107",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -829,6 +862,7 @@ Array ["parent_id": null,"payee": "id17","payee_name": "Transaction 56",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -851,6 +885,7 @@ Array ["parent_id": null,"payee": "id14","payee_name": "Transaction 28",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -873,6 +908,7 @@ Array ["parent_id": null,"payee": "id16","payee_name": "Transaction 114",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -887,7 +923,7 @@ exports[`Account sync import updates transfers when matched 2`] = `- First value+ Second value-@@ -20,10 +20,32 @@+@@ -21,10 +21,33 @@\\"starting_balance_flag\\": 0,\\"tombstone\\": 0,\\"transfer_id\\": null,@@ -908,6 +944,7 @@ exports[`Account sync import updates transfers when matched 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"transfer-one\\",+ \\"payee_name\\": \\"\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -920,7 +957,7 @@ exports[`Account sync import updates transfers when matched 2`] = `\\"category\\": null,\\"cleared\\": 1,\\"date\\": 20171015,-@@ -62,10 +84,32 @@+@@ -65,10 +88,33 @@\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -943,6 +980,7 @@ exports[`Account sync import updates transfers when matched 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"transfer-two\\",+ \\"payee_name\\": \\"\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -973,6 +1011,7 @@ Array ["parent_id": null,"payee": "transfer-one","payee_name": "",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -995,6 +1034,7 @@ Array ["parent_id": null,"payee": "id35","payee_name": "Transaction 53",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1017,6 +1057,7 @@ Array ["parent_id": null,"payee": "transfer-two","payee_name": "",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1039,6 +1080,7 @@ Array ["parent_id": null,"payee": "id34","payee_name": "Transaction 78",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1061,6 +1103,7 @@ Array ["parent_id": null,"payee": "id32","payee_name": "Transaction 32",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1083,6 +1126,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Transaction 90",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1105,6 +1149,7 @@ Array ["parent_id": null,"payee": "id9","payee_name": "Transaction 54",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1127,6 +1172,7 @@ Array ["parent_id": null,"payee": "id7","payee_name": "Transaction 79",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1149,6 +1195,7 @@ Array ["parent_id": null,"payee": "id6","payee_name": "Transaction 3",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1171,6 +1218,7 @@ Array ["parent_id": null,"payee": "id8","payee_name": "Transaction 51",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1193,6 +1241,7 @@ Array ["parent_id": null,"payee": "id10","payee_name": "Transaction 68",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1215,6 +1264,7 @@ Array ["parent_id": null,"payee": "id3","payee_name": "Starting Balance",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 1,@@ -1237,6 +1287,7 @@ Array ["parent_id": null,"payee": "id12","payee_name": "Transaction 64",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1259,6 +1310,7 @@ Array ["parent_id": null,"payee": "id11","payee_name": "Transaction 11",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1281,6 +1333,7 @@ Array ["parent_id": null,"payee": "id15","payee_name": "Transaction 48",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1303,6 +1356,7 @@ Array ["parent_id": null,"payee": "id13","payee_name": "Transaction 107",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1325,6 +1379,7 @@ Array ["parent_id": null,"payee": "id17","payee_name": "Transaction 56",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1347,6 +1402,7 @@ Array ["parent_id": null,"payee": "id14","payee_name": "Transaction 28",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1369,6 +1425,7 @@ Array ["parent_id": null,"payee": "id16","payee_name": "Transaction 114",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1396,6 +1453,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Transaction 90",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1418,6 +1476,7 @@ Array ["parent_id": null,"payee": "id9","payee_name": "Transaction 54",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1440,6 +1499,7 @@ Array ["parent_id": null,"payee": "id7","payee_name": "Transaction 79",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1462,6 +1522,7 @@ Array ["parent_id": null,"payee": "id6","payee_name": "Transaction 3",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1484,6 +1545,7 @@ Array ["parent_id": null,"payee": "id8","payee_name": "Transaction 51",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1506,6 +1568,7 @@ Array ["parent_id": null,"payee": "id10","payee_name": "Transaction 68",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1528,6 +1591,7 @@ Array ["parent_id": null,"payee": "id3","payee_name": "Starting Balance",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 1,@@ -1550,6 +1614,7 @@ Array ["parent_id": null,"payee": "id12","payee_name": "Transaction 64",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1572,6 +1637,7 @@ Array ["parent_id": null,"payee": "id11","payee_name": "Transaction 11",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1594,6 +1660,7 @@ Array ["parent_id": null,"payee": "id15","payee_name": "Transaction 48",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1616,6 +1683,7 @@ Array ["parent_id": null,"payee": "id13","payee_name": "Transaction 107",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1638,6 +1706,7 @@ Array ["parent_id": null,"payee": "id17","payee_name": "Transaction 56",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1660,6 +1729,7 @@ Array ["parent_id": null,"payee": "id14","payee_name": "Transaction 28",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1682,6 +1752,7 @@ Array ["parent_id": null,"payee": "id16","payee_name": "Transaction 114",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1709,6 +1780,7 @@ Array ["parent_id": null,"payee": "id40","payee_name": "Transaction 118",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1731,6 +1803,7 @@ Array ["parent_id": null,"payee": "id33","payee_name": "Transaction 53",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1753,6 +1826,7 @@ Array ["parent_id": null,"payee": "id31","payee_name": "Transaction 13",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1775,6 +1849,7 @@ Array ["parent_id": null,"payee": "id36","payee_name": "Transaction 96",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1797,6 +1872,7 @@ Array ["parent_id": null,"payee": "id37","payee_name": "Transaction Bazillion",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1819,6 +1895,7 @@ Array ["parent_id": null,"payee": "id41","payee_name": "Transaction 89",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1841,6 +1918,7 @@ Array ["parent_id": null,"payee": "id39","payee_name": "Transaction 65",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1863,6 +1941,7 @@ Array ["parent_id": null,"payee": "id32","payee_name": "Transaction 78",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1885,6 +1964,7 @@ Array ["parent_id": null,"payee": "id38","payee_name": "Transaction 49",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1907,6 +1987,7 @@ Array ["parent_id": null,"payee": "id35","payee_name": "Transaction 100",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1929,6 +2010,7 @@ Array ["parent_id": null,"payee": "id34","payee_name": "Transaction 115",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1951,6 +2033,7 @@ Array ["parent_id": null,"payee": "id45","payee_name": "Transaction 67",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1973,6 +2056,7 @@ Array ["parent_id": null,"payee": "id42","payee_name": "Transaction 32",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -1995,6 +2079,7 @@ Array ["parent_id": null,"payee": "id47","payee_name": "Transaction 20",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2017,6 +2102,7 @@ Array ["parent_id": null,"payee": "id46","payee_name": "Transaction 14",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2039,6 +2125,7 @@ Array ["parent_id": null,"payee": "id44","payee_name": "Transaction 6",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2061,6 +2148,7 @@ Array ["parent_id": null,"payee": "id43","payee_name": "Transaction 119",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2083,6 +2171,7 @@ Array ["parent_id": null,"payee": "id48","payee_name": "Transaction 21",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2105,6 +2194,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Transaction 90",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2127,6 +2217,7 @@ Array ["parent_id": null,"payee": "id9","payee_name": "Transaction 54",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2149,6 +2240,7 @@ Array ["parent_id": null,"payee": "id7","payee_name": "Transaction 79",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2171,6 +2263,7 @@ Array ["parent_id": null,"payee": "id6","payee_name": "Transaction 3",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2193,6 +2286,7 @@ Array ["parent_id": null,"payee": "id8","payee_name": "Transaction 51",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2215,6 +2309,7 @@ Array ["parent_id": null,"payee": "id10","payee_name": "Transaction 68",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2237,6 +2332,7 @@ Array ["parent_id": null,"payee": "id3","payee_name": "Starting Balance",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 1,@@ -2259,6 +2355,7 @@ Array ["parent_id": null,"payee": "id12","payee_name": "Transaction 64",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2281,6 +2378,7 @@ Array ["parent_id": null,"payee": "id11","payee_name": "Transaction 11",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2303,6 +2401,7 @@ Array ["parent_id": null,"payee": "id15","payee_name": "Transaction 48",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2325,6 +2424,7 @@ Array ["parent_id": null,"payee": "id13","payee_name": "Transaction 107",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2347,6 +2447,7 @@ Array ["parent_id": null,"payee": "id17","payee_name": "Transaction 56",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2369,6 +2470,7 @@ Array ["parent_id": null,"payee": "id14","payee_name": "Transaction 28",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2391,6 +2493,7 @@ Array ["parent_id": null,"payee": "id16","payee_name": "Transaction 114",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2418,6 +2521,7 @@ Array ["parent_id": null,"payee": null,"payee_name": null,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -2440,6 +2544,7 @@ Array ["parent_id": null,"payee": null,"payee_name": null,+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,diff --git a/packages/loot-core/src/server/accounts/__snapshots__/transfer.test.ts.snap b/packages/loot-core/src/server/accounts/__snapshots__/transfer.test.ts.snapindex d84f703ece..c9b6f89f83 100644--- a/packages/loot-core/src/server/accounts/__snapshots__/transfer.test.ts.snap+++ b/packages/loot-core/src/server/accounts/__snapshots__/transfer.test.ts.snap@@ -18,6 +18,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Non-transfer",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -32,7 +33,7 @@ exports[`Transfer transfers are properly de-categorized 2`] = `- First value+ Second value-@@ -9,16 +9,38 @@+@@ -9,17 +9,40 @@\\"id\\": \\"id6\\",\\"imported_id\\": null,\\"imported_payee\\": null,@@ -40,16 +41,14 @@ exports[`Transfer transfers are properly de-categorized 2`] = `\\"is_parent\\": 0,- \\"notes\\": null,+ \\"notes\\": \\"hi\\",- \\"parent_id\\": null,-- \\"payee\\": \\"id5\\",-- \\"payee_name\\": \\"Non-transfer\\",++ \\"parent_id\\": null,+ \\"payee\\": \\"id4\\",+ \\"payee_name\\": \\"\\",- \\"schedule\\": null,- \\"sort_order\\": 123456789,- \\"starting_balance_flag\\": 0,- \\"tombstone\\": 0,-- \\"transfer_id\\": null,++ \\"reconciled\\": 0,++ \\"schedule\\": null,++ \\"sort_order\\": 123456789,++ \\"starting_balance_flag\\": 0,++ \\"tombstone\\": 0,+ \\"transfer_id\\": \\"id7\\",+ },+ Object {@@ -65,13 +64,17 @@ exports[`Transfer transfers are properly de-categorized 2`] = `+ \\"is_child\\": 0,+ \\"is_parent\\": 0,+ \\"notes\\": \\"hi\\",-+ \\"parent_id\\": null,+ \\"parent_id\\": null,+- \\"payee\\": \\"id5\\",+- \\"payee_name\\": \\"Non-transfer\\",+ \\"payee\\": \\"id2\\",+ \\"payee_name\\": \\"\\",-+ \\"schedule\\": null,-+ \\"sort_order\\": 123456789,-+ \\"starting_balance_flag\\": 0,-+ \\"tombstone\\": 0,+ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,+ \\"tombstone\\": 0,+- \\"transfer_id\\": null,+ \\"transfer_id\\": \\"id6\\",},]"@@ -82,7 +85,7 @@ exports[`Transfer transfers are properly de-categorized 3`] = `- First value+ Second value-@@ -1,30 +1,30 @@+@@ -1,31 +1,31 @@Array [Object {\\"account\\": \\"one\\",@@ -102,6 +105,7 @@ exports[`Transfer transfers are properly de-categorized 3`] = `- \\"payee\\": \\"id4\\",+ \\"payee\\": \\"id3\\",\\"payee_name\\": \\"\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -136,6 +140,7 @@ Array ["parent_id": null,"payee": "id5","payee_name": "Non-transfer",+ "reconciled": 0,"schedule": null,"sort_order": 123456789,"starting_balance_flag": 0,@@ -150,7 +155,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 2`] = `- First value+ Second value-@@ -19,6 +19,50 @@+@@ -20,6 +20,52 @@\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,\\"tombstone\\": 0,@@ -172,6 +177,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id3\\",+ \\"payee_name\\": \\"\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -194,6 +200,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 2`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id2\\",+ \\"payee_name\\": \\"\\",++ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,@@ -208,7 +215,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 3`] = `- First value+ Second value-@@ -2,67 +2,67 @@+@@ -2,70 +2,70 @@Object {\\"account\\": \\"one\\",\\"amount\\": 5000,@@ -230,6 +237,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 3`] = `- \\"payee_name\\": \\"Non-transfer\\",+ \\"payee\\": \\"id3\\",+ \\"payee_name\\": \\"\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -260,6 +268,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 3`] = `- \\"payee\\": \\"id3\\",+ \\"payee\\": \\"id2\\",\\"payee_name\\": \\"\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -289,6 +298,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 3`] = `- \\"payee_name\\": \\"\\",+ \\"payee\\": \\"id5\\",+ \\"payee_name\\": \\"Non-transfer\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -304,7 +314,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 4`] = `- First value+ Second value-@@ -11,20 +11,20 @@+@@ -11,21 +11,21 @@\\"imported_payee\\": null,\\"is_child\\": 0,\\"is_parent\\": 0,@@ -313,6 +323,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 4`] = `- \\"payee\\": \\"id3\\",+ \\"payee\\": \\"id4\\",\\"payee_name\\": \\"\\",+ \\"reconciled\\": 0,\\"schedule\\": null,\\"sort_order\\": 123456789,\\"starting_balance_flag\\": 0,@@ -334,7 +345,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 5`] = `- First value+ Second value-@@ -11,39 +11,17 @@+@@ -11,41 +11,18 @@\\"imported_payee\\": null,\\"is_child\\": 0,\\"is_parent\\": 0,@@ -342,12 +353,11 @@ exports[`Transfer transfers are properly inserted/updated/deleted 5`] = `\\"parent_id\\": null,- \\"payee\\": \\"id4\\",- \\"payee_name\\": \\"\\",-+ \\"payee\\": \\"id9\\",-+ \\"payee_name\\": \\"Not transferred anymore\\",- \\"schedule\\": null,- \\"sort_order\\": 123456789,- \\"starting_balance_flag\\": 0,- \\"tombstone\\": 0,+- \\"reconciled\\": 0,+- \\"schedule\\": null,+- \\"sort_order\\": 123456789,+- \\"starting_balance_flag\\": 0,+- \\"tombstone\\": 0,- \\"transfer_id\\": \\"id8\\",- },- Object {@@ -366,10 +376,13 @@ exports[`Transfer transfers are properly inserted/updated/deleted 5`] = `- \\"parent_id\\": null,- \\"payee\\": \\"id2\\",- \\"payee_name\\": \\"\\",-- \\"schedule\\": null,-- \\"sort_order\\": 123456789,-- \\"starting_balance_flag\\": 0,-- \\"tombstone\\": 0,++ \\"payee\\": \\"id9\\",++ \\"payee_name\\": \\"Not transferred anymore\\",+ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,+ \\"tombstone\\": 0,- \\"transfer_id\\": \\"id7\\",+ \\"transfer_id\\": null,},@@ -384,7 +397,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 6`] = `- First value+ Second value-@@ -11,17 +11,39 @@+@@ -11,18 +11,41 @@\\"imported_payee\\": null,\\"is_child\\": 0,\\"is_parent\\": 0,@@ -394,11 +407,11 @@ exports[`Transfer transfers are properly inserted/updated/deleted 6`] = `- \\"payee_name\\": \\"Not transferred anymore\\",+ \\"payee\\": \\"id3\\",+ \\"payee_name\\": \\"\\",- \\"schedule\\": null,- \\"sort_order\\": 123456789,- \\"starting_balance_flag\\": 0,- \\"tombstone\\": 0,-- \\"transfer_id\\": null,++ \\"reconciled\\": 0,++ \\"schedule\\": null,++ \\"sort_order\\": 123456789,++ \\"starting_balance_flag\\": 0,++ \\"tombstone\\": 0,+ \\"transfer_id\\": \\"id10\\",+ },+ Object {@@ -417,10 +430,12 @@ exports[`Transfer transfers are properly inserted/updated/deleted 6`] = `+ \\"parent_id\\": null,+ \\"payee\\": \\"id2\\",+ \\"payee_name\\": \\"\\",-+ \\"schedule\\": null,-+ \\"sort_order\\": 123456789,-+ \\"starting_balance_flag\\": 0,-+ \\"tombstone\\": 0,+ \\"reconciled\\": 0,+ \\"schedule\\": null,+ \\"sort_order\\": 123456789,+ \\"starting_balance_flag\\": 0,+ \\"tombstone\\": 0,+- \\"transfer_id\\": null,+ \\"transfer_id\\": \\"id7\\",},Object {@@ -434,7 +449,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 7`] = `- First value+ Second value-@@ -2,54 +2,10 @@+@@ -2,56 +2,10 @@Object {\\"account\\": \\"one\\",\\"amount\\": 5000,@@ -451,6 +466,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 7`] = `- \\"parent_id\\": null,- \\"payee\\": \\"id3\\",- \\"payee_name\\": \\"\\",+- \\"reconciled\\": 0,- \\"schedule\\": null,- \\"sort_order\\": 123456789,- \\"starting_balance_flag\\": 0,@@ -473,6 +489,7 @@ exports[`Transfer transfers are properly inserted/updated/deleted 7`] = `- \\"parent_id\\": null,- \\"payee\\": \\"id2\\",- \\"payee_name\\": \\"\\",+- \\"reconciled\\": 0,- \\"schedule\\": null,- \\"sort_order\\": 123456789,- \\"starting_balance_flag\\": 0,diff --git a/packages/loot-core/src/server/aql/schema/index.ts b/packages/loot-core/src/server/aql/schema/index.tsindex 857cbfa16a..873e3594f3 100644--- a/packages/loot-core/src/server/aql/schema/index.ts+++ b/packages/loot-core/src/server/aql/schema/index.ts@@ -47,6 +47,7 @@ export const schema = {transfer_id: f('id'),sort_order: f('float', { default: () => Date.now() }),cleared: f('boolean', { default: true }),+ reconciled: f('boolean', { default: false }),tombstone: f('boolean'),schedule: f('id', { ref: 'schedules' }),// subtransactions is a special field added if the table has thediff --git a/packages/loot-core/src/types/models/transaction.d.ts b/packages/loot-core/src/types/models/transaction.d.tsindex 73103e40cb..3687db0508 100644--- a/packages/loot-core/src/types/models/transaction.d.ts+++ b/packages/loot-core/src/types/models/transaction.d.ts@@ -20,6 +20,7 @@ export interface TransactionEntity {transfer_id?: string;sort_order?: number;cleared?: boolean;+ reconciled?: boolean;tombstone?: boolean;schedule?: ScheduleEntity;subtransactions?: TransactionEntity[];diff --git a/upcoming-release-notes/1789.md b/upcoming-release-notes/1789.mdnew file mode 100644index 0000000000..83a700e677--- /dev/null+++ b/upcoming-release-notes/1789.md@@ -0,0 +1,6 @@+---+category: Features+authors: [zachwhelchel]+---++Lock transactions after reconcilliation.