@actual-app/sync-server 25.9.0-nightly.20250812 → 25.9.0-nightly.20250813
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.
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credit for this code goes to Nebukadneza at https://github.com/Nebukadneza
|
|
3
|
+
*/
|
|
4
|
+
import { amountToInteger } from '../utils.js';
|
|
5
|
+
import Fallback from './integration-bank.js';
|
|
6
|
+
/** @type {import('./bank.interface.js').IBank} */
|
|
7
|
+
export default {
|
|
8
|
+
...Fallback,
|
|
9
|
+
institutionIds: ['SSK_MUNCHEN_SSKMDEMMXXX'],
|
|
10
|
+
normalizeTransaction(transaction, booked) {
|
|
11
|
+
const editedTrans = { ...transaction };
|
|
12
|
+
let remittanceInformationUnstructured;
|
|
13
|
+
if (transaction.remittanceInformationUnstructured) {
|
|
14
|
+
remittanceInformationUnstructured =
|
|
15
|
+
transaction.remittanceInformationUnstructured;
|
|
16
|
+
}
|
|
17
|
+
else if (transaction.remittanceInformationStructured) {
|
|
18
|
+
remittanceInformationUnstructured =
|
|
19
|
+
transaction.remittanceInformationStructured;
|
|
20
|
+
}
|
|
21
|
+
else if (transaction.remittanceInformationStructuredArray?.length > 0) {
|
|
22
|
+
remittanceInformationUnstructured =
|
|
23
|
+
transaction.remittanceInformationStructuredArray?.join(' ');
|
|
24
|
+
}
|
|
25
|
+
if (transaction.additionalInformation) {
|
|
26
|
+
remittanceInformationUnstructured +=
|
|
27
|
+
' ' + transaction.additionalInformation;
|
|
28
|
+
}
|
|
29
|
+
const usefulCreditorName = transaction.ultimateCreditor ||
|
|
30
|
+
transaction.creditorName ||
|
|
31
|
+
transaction.debtorName;
|
|
32
|
+
editedTrans.creditorName = usefulCreditorName;
|
|
33
|
+
editedTrans.remittanceInformationUnstructured =
|
|
34
|
+
remittanceInformationUnstructured;
|
|
35
|
+
return Fallback.normalizeTransaction(transaction, booked, editedTrans);
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* For SANDBOXFINANCE_SFIN0000 we don't know what balance was
|
|
39
|
+
* after each transaction so we have to calculate it by getting
|
|
40
|
+
* current balance from the account and subtract all the transactions
|
|
41
|
+
*
|
|
42
|
+
* As a current balance we use `interimBooked` balance type because
|
|
43
|
+
* it includes transaction placed during current day
|
|
44
|
+
*/
|
|
45
|
+
calculateStartingBalance(sortedTransactions = [], balances = []) {
|
|
46
|
+
const currentBalance = balances.find(balance => 'interimAvailable' === balance.balanceType);
|
|
47
|
+
return sortedTransactions.reduce((total, trans) => {
|
|
48
|
+
return total - amountToInteger(trans.transactionAmount.amount);
|
|
49
|
+
}, amountToInteger(currentBalance.balanceAmount.amount));
|
|
50
|
+
},
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actual-app/sync-server",
|
|
3
|
-
"version": "25.9.0-nightly.
|
|
3
|
+
"version": "25.9.0-nightly.20250813",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "actual syncing server",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@actual-app/crdt": "2.1.0",
|
|
31
|
-
"@actual-app/web": "25.9.0-nightly.
|
|
31
|
+
"@actual-app/web": "25.9.0-nightly.20250813",
|
|
32
32
|
"bcrypt": "^6.0.0",
|
|
33
33
|
"better-sqlite3": "^12.2.0",
|
|
34
34
|
"convict": "^6.2.4",
|