taxtank-core 0.28.8 → 0.28.9
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/bundles/taxtank-core.umd.js +8 -4
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/bank-transaction.collection.js +2 -2
- package/esm2015/lib/services/bank/bank-account-calculation.service.js +9 -3
- package/esm2015/lib/services/bank/bank-transaction-calculation.service.js +2 -2
- package/fesm2015/taxtank-core.js +8 -4
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/bank-transaction.collection.d.ts +1 -1
- package/lib/services/bank/bank-account-calculation.service.d.ts +2 -1
- package/lib/services/bank/bank-transaction-calculation.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6838,7 +6838,7 @@
|
|
|
6838
6838
|
/**
|
|
6839
6839
|
* Get collection of unallocated bankTransactions
|
|
6840
6840
|
*/
|
|
6841
|
-
BankTransactionCollection.prototype.
|
|
6841
|
+
BankTransactionCollection.prototype.getUnallocated = function (allocations) {
|
|
6842
6842
|
return new BankTransactionCollection(this.items.filter(function (bankTransaction) { return !bankTransaction.isAllocated(allocations); }));
|
|
6843
6843
|
};
|
|
6844
6844
|
return BankTransactionCollection;
|
|
@@ -13472,7 +13472,7 @@
|
|
|
13472
13472
|
* Get collection of unallocated bank transactions
|
|
13473
13473
|
* @TODO Alex: consider to move to collection
|
|
13474
13474
|
*/
|
|
13475
|
-
BankTransactionCalculationService.prototype.
|
|
13475
|
+
BankTransactionCalculationService.prototype.getUnallocated = function (bankTransactions, allocations) {
|
|
13476
13476
|
var _this = this;
|
|
13477
13477
|
return new BankTransactionCollection(bankTransactions.items.filter(function (bankTransaction) {
|
|
13478
13478
|
return !_this.isAllocated(bankTransaction, allocations);
|
|
@@ -13509,8 +13509,12 @@
|
|
|
13509
13509
|
* Sum of bank accounts opening balances and their bank transactions allocated amounts
|
|
13510
13510
|
*/
|
|
13511
13511
|
BankAccountCalculationService.prototype.getTaxTankBalance = function (bankAccounts, bankTransactions, allocations) {
|
|
13512
|
-
|
|
13513
|
-
|
|
13512
|
+
// wrap in a collection if a single bank account was provided
|
|
13513
|
+
var bankAccountCollection = bankAccounts instanceof BankAccount ?
|
|
13514
|
+
new BankAccountCollection([bankAccounts]) :
|
|
13515
|
+
bankAccounts;
|
|
13516
|
+
return bankAccountCollection.getOpeningBalance() +
|
|
13517
|
+
this.bankTransactionCalculationService.getAllocatedAmount(bankTransactions.getByBankAccountsIds(bankAccountCollection.getIds()), allocations);
|
|
13514
13518
|
};
|
|
13515
13519
|
/**
|
|
13516
13520
|
* get difference between total loans amount and total cash amount
|