israeli-banks-actual-budget-importer 1.7.2 → 1.7.4
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 +14 -0
- package/package.json +1 -1
- package/src/utils.ts +15 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.7.4](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.7.3...v1.7.4) (2025-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove unnecessary reconciliation removal logic when balances are in sync ([0fcc569](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/commit/0fcc56977394265502dd871bc0973a05e614fffe))
|
|
7
|
+
|
|
8
|
+
## [1.7.3](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.7.2...v1.7.3) (2025-12-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* streamline reconciliation transaction handling and improve logging ([46fc2b0](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/commit/46fc2b082e4e7b69666bb338960e0b7e6152f892))
|
|
14
|
+
|
|
1
15
|
## [1.7.2](https://github.com/tomerh2001/israeli-banks-actual-budget-importer/compare/v1.7.1...v1.7.2) (2025-12-04)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -97,16 +97,6 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
|
|
|
97
97
|
diff: balanceDiff,
|
|
98
98
|
});
|
|
99
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
|
-
|
|
110
100
|
const reconciliationTxn = {
|
|
111
101
|
account: bank.actualAccountId,
|
|
112
102
|
date: moment().format('YYYY-MM-DD'),
|
|
@@ -120,22 +110,25 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
|
|
|
120
110
|
stdout.mute();
|
|
121
111
|
if (existingReconciliation) {
|
|
122
112
|
// Update the single reconciliation transaction
|
|
113
|
+
stdout.mute();
|
|
123
114
|
await actual.updateTransaction(existingReconciliation.id, reconciliationTxn);
|
|
124
115
|
stdout.unmute();
|
|
125
116
|
log('RECONCILIATION_UPDATED', {transactionId: existingReconciliation.id});
|
|
126
|
-
} else {
|
|
127
|
-
// Create the reconciliation transaction for the first time
|
|
128
|
-
const reconciliationResult = await actual.importTransactions(
|
|
129
|
-
bank.actualAccountId,
|
|
130
|
-
[reconciliationTxn],
|
|
131
|
-
);
|
|
132
|
-
stdout.unmute();
|
|
133
117
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Create the reconciliation transaction for the first time
|
|
122
|
+
const reconciliationResult = await actual.importTransactions(
|
|
123
|
+
bank.actualAccountId,
|
|
124
|
+
[reconciliationTxn],
|
|
125
|
+
);
|
|
126
|
+
stdout.unmute();
|
|
127
|
+
|
|
128
|
+
if (!reconciliationResult || _.isEmpty(reconciliationResult.added)) {
|
|
129
|
+
console.error('Reconciliation errors', reconciliationResult?.errors);
|
|
130
|
+
} else {
|
|
131
|
+
log('RECONCILIATION_ADDED', {transactions: reconciliationResult.added.length});
|
|
139
132
|
}
|
|
140
133
|
} catch (error) {
|
|
141
134
|
console.error('Error', companyId, error);
|