taxtank-core 0.32.39 → 0.32.41
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/esm2022/lib/collections/bank-transaction.collection.mjs +19 -4
- package/esm2022/lib/collections/sole/sole-invoice-item.collection.mjs +3 -3
- package/esm2022/lib/collections/sole/sole-invoice.collection.mjs +22 -1
- package/esm2022/lib/collections/transaction/transaction-allocation.collection.mjs +8 -1
- package/esm2022/lib/collections/transaction/transaction.collection.mjs +8 -1
- package/esm2022/lib/db/Json/chart-accounts/chart-accounts-value.json +287 -287
- package/esm2022/lib/db/Models/transaction/transaction-base.mjs +3 -2
- package/esm2022/lib/models/bank/bank-transaction.mjs +2 -2
- package/esm2022/lib/models/endpoint/endpoints.const.mjs +5 -4
- package/esm2022/lib/models/sole/sole-invoice.mjs +3 -4
- package/esm2022/lib/models/transaction/transaction.mjs +2 -2
- package/esm2022/lib/services/bank/bank-account-calculation.service.mjs +7 -11
- package/esm2022/lib/services/bank/index.mjs +1 -2
- package/esm2022/lib/services/transaction/transaction-calculation.service.mjs +2 -55
- package/fesm2022/taxtank-core.mjs +438 -419
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/lib/collections/bank-transaction.collection.d.ts +9 -2
- package/lib/collections/sole/sole-invoice-item.collection.d.ts +1 -1
- package/lib/collections/sole/sole-invoice.collection.d.ts +5 -1
- package/lib/collections/transaction/transaction-allocation.collection.d.ts +3 -1
- package/lib/collections/transaction/transaction.collection.d.ts +2 -0
- package/lib/services/bank/bank-account-calculation.service.d.ts +2 -7
- package/lib/services/bank/index.d.ts +0 -1
- package/lib/services/transaction/transaction-calculation.service.d.ts +1 -25
- package/package.json +1 -1
- package/esm2022/lib/services/bank/bank-transaction-calculation.service.mjs +0 -61
- package/lib/services/bank/bank-transaction-calculation.service.d.ts +0 -41
|
@@ -17,6 +17,7 @@ export declare class BankTransactionCollection extends Collection<BankTransactio
|
|
|
17
17
|
* Difference between total bank transactions amount and sum of allocations for passed bank transactions
|
|
18
18
|
*/
|
|
19
19
|
getUnallocatedAmount(allocations: TransactionAllocationCollection): any;
|
|
20
|
+
getAllocatedAmount(allocations: TransactionAllocationCollection): number;
|
|
20
21
|
/**
|
|
21
22
|
* get date of the last transaction
|
|
22
23
|
*/
|
|
@@ -65,8 +66,14 @@ export declare class BankTransactionCollection extends Collection<BankTransactio
|
|
|
65
66
|
* Set allocate operation for bank transactions with amounts equal to salary
|
|
66
67
|
*/
|
|
67
68
|
preselectAllocateOperationForSalary(salaryIncomeSources: IncomeSource[]): void;
|
|
69
|
+
getAllocated(allocations: TransactionAllocationCollection): this;
|
|
70
|
+
getUnallocated(allocations: TransactionAllocationCollection): this;
|
|
68
71
|
/**
|
|
69
|
-
*
|
|
72
|
+
* Allocated sum of credit transactions
|
|
70
73
|
*/
|
|
71
|
-
|
|
74
|
+
getCreditAmount(allocations: TransactionAllocationCollection): number;
|
|
75
|
+
/**
|
|
76
|
+
* Allocated sum of debit transactions
|
|
77
|
+
*/
|
|
78
|
+
getDebitAmount(allocations: TransactionAllocationCollection): number;
|
|
72
79
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Collection } from '../collection';
|
|
2
|
-
import { SoleInvoice } from '../../models';
|
|
2
|
+
import { Dictionary, SoleInvoice } from '../../models';
|
|
3
|
+
import { TransactionAllocationCollection } from '../transaction';
|
|
3
4
|
export declare class SoleInvoiceCollection extends Collection<SoleInvoice> {
|
|
4
5
|
getOverdue(): this;
|
|
5
6
|
getUnpaid(): this;
|
|
@@ -7,4 +8,7 @@ export declare class SoleInvoiceCollection extends Collection<SoleInvoice> {
|
|
|
7
8
|
getPaidCash(): this;
|
|
8
9
|
getPending(): this;
|
|
9
10
|
getTransactionsIds(): number[];
|
|
11
|
+
getUnallocated(allocations: TransactionAllocationCollection): this;
|
|
12
|
+
getUnallocatedAmount(allocations: TransactionAllocationCollection): number;
|
|
13
|
+
getPaidAmountById(allocations: TransactionAllocationCollection): Dictionary<number>;
|
|
10
14
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Collection } from '../collection';
|
|
2
|
-
import {
|
|
2
|
+
import { BankTransaction, Transaction, TransactionAllocation } from '../../models';
|
|
3
3
|
import { BankTransactionCollection } from '../bank-transaction.collection';
|
|
4
4
|
import { CollectionDictionary } from '../collection-dictionary';
|
|
5
|
+
import { SoleInvoiceCollection } from '../sole';
|
|
5
6
|
export declare class TransactionAllocationCollection extends Collection<TransactionAllocation> {
|
|
6
7
|
get amount(): number;
|
|
7
8
|
getByTransactionsIds(ids: number[]): TransactionAllocationCollection;
|
|
@@ -18,4 +19,5 @@ export declare class TransactionAllocationCollection extends Collection<Transact
|
|
|
18
19
|
* Check if bank transaction is related with current allocations
|
|
19
20
|
*/
|
|
20
21
|
hasBankTransaction(bankTransaction: BankTransaction): boolean;
|
|
22
|
+
groupByInvoice(invoices: SoleInvoiceCollection): CollectionDictionary<TransactionAllocationCollection>;
|
|
21
23
|
}
|
|
@@ -8,6 +8,7 @@ import { Collection } from '../collection';
|
|
|
8
8
|
import { ChartData } from '../../models/chart/chart-data';
|
|
9
9
|
import { Depreciation } from '../../models/depreciation/depreciation';
|
|
10
10
|
import { SoleInvoiceCollection } from '../sole';
|
|
11
|
+
import { CollectionDictionary } from '../collection-dictionary';
|
|
11
12
|
/**
|
|
12
13
|
* Collection of transactions
|
|
13
14
|
*/
|
|
@@ -102,4 +103,5 @@ export declare class TransactionCollection extends ExportableCollection<Transact
|
|
|
102
103
|
* @TODO vik business transactions calculated differently, separated collection?
|
|
103
104
|
*/
|
|
104
105
|
getBusinessClaimAmount(allocations: TransactionAllocationCollection, businessId?: number): number;
|
|
106
|
+
groupByInvoice(invoices: SoleInvoiceCollection): CollectionDictionary<TransactionCollection>;
|
|
105
107
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { BankAccountCollection } from '../../collections
|
|
2
|
-
import {
|
|
3
|
-
import { TransactionAllocationCollection } from '../../collections/transaction/transaction-allocation.collection';
|
|
4
|
-
import { BankTransactionCalculationService } from './bank-transaction-calculation.service';
|
|
5
|
-
import { BankAccount } from '../../models/bank/bank-account';
|
|
1
|
+
import { BankAccountCollection, BankTransactionCollection, TransactionAllocationCollection } from '../../collections';
|
|
2
|
+
import { BankAccount } from '../../models';
|
|
6
3
|
import * as i0 from "@angular/core";
|
|
7
4
|
export declare class BankAccountCalculationService {
|
|
8
|
-
private bankTransactionCalculationService;
|
|
9
|
-
constructor(bankTransactionCalculationService: BankTransactionCalculationService);
|
|
10
5
|
/**
|
|
11
6
|
* Sum of bank accounts opening balances and their bank transactions allocated amounts
|
|
12
7
|
*/
|
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
import { SoleInvoiceCollection, TransactionAllocationCollection
|
|
2
|
-
import { Dictionary } from '../../models/dictionary/dictionary';
|
|
3
|
-
import { Transaction } from '../../models';
|
|
1
|
+
import { SoleInvoiceCollection, TransactionAllocationCollection } from '../../collections';
|
|
4
2
|
import { CollectionDictionary } from '../../collections/collection-dictionary';
|
|
5
|
-
import { BankTransactionCollection } from '../../collections/bank-transaction.collection';
|
|
6
3
|
import * as i0 from "@angular/core";
|
|
7
4
|
/**
|
|
8
5
|
* @TODO Alex: refactor, move methods to collections and models, remove this service
|
|
9
6
|
*/
|
|
10
7
|
export declare class TransactionCalculationService {
|
|
11
|
-
/**
|
|
12
|
-
* Sum of allocations for passed transactions
|
|
13
|
-
*/
|
|
14
|
-
getAllocatedAmount(transactions: TransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
15
|
-
/**
|
|
16
|
-
* Check if transaction is allocated
|
|
17
|
-
*/
|
|
18
|
-
isAllocated(transaction: Transaction, allocations: TransactionAllocationCollection): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Get collection of allocated transactions
|
|
21
|
-
* @TODO Alex: consider to move to collection
|
|
22
|
-
*/
|
|
23
|
-
getAllocatedTransactions(transactions: TransactionCollection, allocations: TransactionAllocationCollection): TransactionCollection;
|
|
24
|
-
getUnallocatedInvoices(invoices: SoleInvoiceCollection, allocations: TransactionAllocationCollection): SoleInvoiceCollection;
|
|
25
|
-
/**
|
|
26
|
-
* Get invoices paid amounts grouped by invoice id
|
|
27
|
-
*/
|
|
28
|
-
getInvoicePaidAmountById(allocations: TransactionAllocationCollection, invoices: SoleInvoiceCollection): Dictionary<number>;
|
|
29
|
-
getInvoicesUnallocatedAmount(invoices: SoleInvoiceCollection, allocations: TransactionAllocationCollection): number;
|
|
30
|
-
getTransactionsByInvoices(invoices: SoleInvoiceCollection, transactions: TransactionCollection): CollectionDictionary<TransactionCollection>;
|
|
31
8
|
getAllocationsByInvoices(invoices: SoleInvoiceCollection, allocations: TransactionAllocationCollection): CollectionDictionary<TransactionAllocationCollection>;
|
|
32
|
-
getBankTransactionsUnallocatedAmount(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
33
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<TransactionCalculationService, never>;
|
|
34
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<TransactionCalculationService>;
|
|
35
11
|
}
|
package/package.json
CHANGED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { BankTransactionCollection } from '../../collections/bank-transaction.collection';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* @TODO move to collection
|
|
6
|
-
*/
|
|
7
|
-
export class BankTransactionCalculationService {
|
|
8
|
-
/**
|
|
9
|
-
* Sum of allocations for passed bank transactions
|
|
10
|
-
*/
|
|
11
|
-
getAllocatedAmount(bankTransactions, allocations) {
|
|
12
|
-
return allocations.getByBankTransactionsIds(bankTransactions.getIds()).amount;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Difference between total bank transactions amount and sum of allocations for passed bank transactions
|
|
16
|
-
*/
|
|
17
|
-
getUnallocatedAmount(bankTransactionCollection, allocations) {
|
|
18
|
-
return bankTransactionCollection.getAmount() - allocations.amount;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Check if bank transaction is allocated
|
|
22
|
-
*/
|
|
23
|
-
isAllocated(bankTransaction, allocations) {
|
|
24
|
-
return bankTransaction.amount === this.getAllocatedAmount(new BankTransactionCollection([bankTransaction]), allocations);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get collection of allocated bank transactions
|
|
28
|
-
* @TODO Alex: consider to move to collection
|
|
29
|
-
*/
|
|
30
|
-
getAllocatedBankTransactions(bankTransactions, allocations) {
|
|
31
|
-
return new BankTransactionCollection(bankTransactions.items.filter((bankTransaction) => this.isAllocated(bankTransaction, allocations)));
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get collection of unallocated bank transactions
|
|
35
|
-
* @TODO Alex: consider to move to collection
|
|
36
|
-
*/
|
|
37
|
-
getUnallocated(bankTransactions, allocations) {
|
|
38
|
-
return new BankTransactionCollection(bankTransactions.items.filter((bankTransaction) => !this.isAllocated(bankTransaction, allocations)));
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Allocated sum of credit transactions
|
|
42
|
-
*/
|
|
43
|
-
getCreditAmount(bankTransactions, allocations) {
|
|
44
|
-
return allocations.getByBankTransactionsIds(bankTransactions.creditTransactions.getIds()).amount;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Allocated sum of debit transactions
|
|
48
|
-
*/
|
|
49
|
-
getDebitAmount(bankTransactions, allocations) {
|
|
50
|
-
return allocations.getByBankTransactionsIds(bankTransactions.debitTransactions.getIds()).amount;
|
|
51
|
-
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BankTransactionCalculationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
53
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BankTransactionCalculationService, providedIn: 'root' }); }
|
|
54
|
-
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BankTransactionCalculationService, decorators: [{
|
|
56
|
-
type: Injectable,
|
|
57
|
-
args: [{
|
|
58
|
-
providedIn: 'root'
|
|
59
|
-
}]
|
|
60
|
-
}] });
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFuay10cmFuc2FjdGlvbi1jYWxjdWxhdGlvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL3NlcnZpY2VzL2JhbmsvYmFuay10cmFuc2FjdGlvbi1jYWxjdWxhdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sK0NBQStDLENBQUM7O0FBSTFGOztHQUVHO0FBSUgsTUFBTSxPQUFPLGlDQUFpQztJQUM1Qzs7T0FFRztJQUNILGtCQUFrQixDQUFDLGdCQUEyQyxFQUFFLFdBQTRDO1FBQzFHLE9BQU8sV0FBVyxDQUFDLHdCQUF3QixDQUFDLGdCQUFnQixDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDO0lBQ2hGLENBQUM7SUFFRDs7T0FFRztJQUNILG9CQUFvQixDQUFDLHlCQUFvRCxFQUFFLFdBQTRDO1FBQ3JILE9BQU8seUJBQXlCLENBQUMsU0FBUyxFQUFFLEdBQUcsV0FBVyxDQUFDLE1BQU0sQ0FBQztJQUNwRSxDQUFDO0lBRUQ7O09BRUc7SUFDSCxXQUFXLENBQUMsZUFBZ0MsRUFBRSxXQUE0QztR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YXRpb25zKSlcbiAgICApO1xuICB9XG5cbiAgLyoqXG4gICAqIEFsbG9jYXRlZCBzdW0gb2YgY3JlZGl0IHRyYW5zYWN0aW9uc1xuICAgKi9cbiAgZ2V0Q3JlZGl0QW1vdW50KGJhbmtUcmFuc2FjdGlvbnM6IEJhbmtUcmFuc2FjdGlvbkNvbGxlY3Rpb24sIGFsbG9jYXRpb25zOiBUcmFuc2FjdGlvbkFsbG9jYXRpb25Db2xsZWN0aW9uKTogbnVtYmVyIHtcbiAgICByZXR1cm4gYWxsb2NhdGlvbnMuZ2V0QnlCYW5rVHJhbnNhY3Rpb25zSWRzKGJhbmtUcmFuc2FjdGlvbnMuY3JlZGl0VHJhbnNhY3Rpb25zLmdldElkcygpKS5hbW91bnQ7XG4gIH1cblxuICAvKipcbiAgICogQWxsb2NhdGVkIHN1bSBvZiBkZWJpdCB0cmFuc2FjdGlvbnNcbiAgICovXG4gIGdldERlYml0QW1vdW50KGJhbmtUcmFuc2FjdGlvbnM6IEJhbmtUcmFuc2FjdGlvbkNvbGxlY3Rpb24sIGFsbG9jYXRpb25zOiBUcmFuc2FjdGlvbkFsbG9jYXRpb25Db2xsZWN0aW9uKTogbnVtYmVyIHtcbiAgICByZXR1cm4gYWxsb2NhdGlvbnMuZ2V0QnlCYW5rVHJhbnNhY3Rpb25zSWRzKGJhbmtUcmFuc2FjdGlvbnMuZGViaXRUcmFuc2FjdGlvbnMuZ2V0SWRzKCkpLmFtb3VudDtcbiAgfVxufVxuIl19
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { BankTransactionCollection } from '../../collections/bank-transaction.collection';
|
|
2
|
-
import { BankTransaction } from '../../models/bank/bank-transaction';
|
|
3
|
-
import { TransactionAllocationCollection } from '../../collections/transaction/transaction-allocation.collection';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* @TODO move to collection
|
|
7
|
-
*/
|
|
8
|
-
export declare class BankTransactionCalculationService {
|
|
9
|
-
/**
|
|
10
|
-
* Sum of allocations for passed bank transactions
|
|
11
|
-
*/
|
|
12
|
-
getAllocatedAmount(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
13
|
-
/**
|
|
14
|
-
* Difference between total bank transactions amount and sum of allocations for passed bank transactions
|
|
15
|
-
*/
|
|
16
|
-
getUnallocatedAmount(bankTransactionCollection: BankTransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
17
|
-
/**
|
|
18
|
-
* Check if bank transaction is allocated
|
|
19
|
-
*/
|
|
20
|
-
isAllocated(bankTransaction: BankTransaction, allocations: TransactionAllocationCollection): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Get collection of allocated bank transactions
|
|
23
|
-
* @TODO Alex: consider to move to collection
|
|
24
|
-
*/
|
|
25
|
-
getAllocatedBankTransactions(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): BankTransactionCollection;
|
|
26
|
-
/**
|
|
27
|
-
* Get collection of unallocated bank transactions
|
|
28
|
-
* @TODO Alex: consider to move to collection
|
|
29
|
-
*/
|
|
30
|
-
getUnallocated(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): BankTransactionCollection;
|
|
31
|
-
/**
|
|
32
|
-
* Allocated sum of credit transactions
|
|
33
|
-
*/
|
|
34
|
-
getCreditAmount(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
35
|
-
/**
|
|
36
|
-
* Allocated sum of debit transactions
|
|
37
|
-
*/
|
|
38
|
-
getDebitAmount(bankTransactions: BankTransactionCollection, allocations: TransactionAllocationCollection): number;
|
|
39
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BankTransactionCalculationService, never>;
|
|
40
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<BankTransactionCalculationService>;
|
|
41
|
-
}
|