israeli-banks-actual-budget-importer 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.7.2](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.7.1...v1.7.2) (2025-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * improve reconciliation logic to log transaction removal when balances are in sync ([c2f3fba](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/commit/c2f3fba73588fb1591ddfcc92cb0e2b0fe9a54f5))
7
+
1
8
  ## [1.7.1](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.7.0...v1.7.1) (2025-12-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.1",
2
+ "version": "1.7.2",
3
3
  "name": "israeli-banks-actual-budget-importer",
4
4
  "module": "index.ts",
5
5
  "type": "module",
package/src/utils.ts CHANGED
@@ -91,24 +91,22 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
91
91
 
92
92
  const existingReconciliation = allAccountTxns.find(txn => txn.imported_id === reconciliationImportedId);
93
93
 
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
-
106
94
  log('RECONCILIATION', {
107
95
  from: currentBalance,
108
96
  to: accountBalance,
109
97
  diff: balanceDiff,
110
98
  });
111
99
 
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
+
112
110
  const reconciliationTxn = {
113
111
  account: bank.actualAccountId,
114
112
  date: moment().format('YYYY-MM-DD'),