File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,24 +91,22 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
9191
9292 const existingReconciliation = allAccountTxns . find ( txn => txn . imported_id === reconciliationImportedId ) ;
9393
94- // If balances are already in sync, remove any existing reconciliation and exit.
95- if ( balanceDiff === 0 ) {
96- if ( existingReconciliation ) {
97- stdout . mute ( ) ;
98- await actual . deleteTransaction ( existingReconciliation . id ) ;
99- stdout . unmute ( ) ;
100- log ( 'RECONCILIATION_REMOVED' ) ;
101- }
102-
103- return ;
104- }
105-
10694 log ( 'RECONCILIATION' , {
10795 from : currentBalance ,
10896 to : accountBalance ,
10997 diff : balanceDiff ,
11098 } ) ;
11199
100+ // If balances are already in sync, remove any existing reconciliation and exit.
101+ if ( existingReconciliation && balanceDiff === 0 ) {
102+ stdout . mute ( ) ;
103+ await actual . deleteTransaction ( existingReconciliation . id ) ;
104+ stdout . unmute ( ) ;
105+ log ( `RECONCILIATION_REMOVED, since ${ currentBalance . toLocaleString ( ) } === ${ accountBalance . toLocaleString ( ) } ` , { transactionId : existingReconciliation . id } ) ;
106+
107+ return ;
108+ }
109+
112110 const reconciliationTxn = {
113111 account : bank . actualAccountId ,
114112 date : moment ( ) . format ( 'YYYY-MM-DD' ) ,
You can’t perform that action at this time.
0 commit comments