taxtank-core 0.33.54 → 0.33.55
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,10 +9,11 @@ export class SoleInvoiceCollection extends Collection {
|
|
9
9
|
getPaid(transactions) {
|
10
10
|
const amountPerInvoice = transactions.getAmountPerInvoice();
|
11
11
|
return this.filter(invoice => invoice.grossPrice > 0
|
12
|
-
&& round(amountPerInvoice.get(invoice.id), 2) >= invoice.grossPrice);
|
12
|
+
&& round(amountPerInvoice.get(invoice.id), 2) >= invoice.grossPrice.toFixed(2));
|
13
13
|
}
|
14
14
|
getUnpaid(transactions) {
|
15
|
-
|
15
|
+
const amountPerInvoice = transactions.getAmountPerInvoice();
|
16
|
+
return this.getOpen().filter(invoice => round(amountPerInvoice.get(invoice.id), 2) < invoice.grossPrice.toFixed(2));
|
16
17
|
}
|
17
18
|
getOpen() {
|
18
19
|
return this.filter((invoice) => invoice.isOpen());
|
@@ -36,4 +37,4 @@ export class SoleInvoiceCollection extends Collection {
|
|
36
37
|
return flatten(this.map(invoice => invoice.allocate(bankTransaction, amount)));
|
37
38
|
}
|
38
39
|
}
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLmNvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvY29sbGVjdGlvbnMvc29sZS9zb2xlLWludm9pY2UuY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sT0FBTyxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0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aWNlc0J5U3RhdGUuZ2V0KFNvbGVJbnZvaWNlU3RhdGVFbnVtLkZVTExZX1BBSUQpLnRvQXJyYXkoKSlcbiAgICApO1xuICAgIGludm9pY2VzQnlTdGF0ZS5hZGQoU29sZUludm9pY2VTdGF0ZUVudW0uT1ZFUkRVRSwgdW5wYWlkSW52b2ljZXMuZ2V0T3ZlcmR1ZSgpKTtcblxuICAgIHJldHVybiBpbnZvaWNlc0J5U3RhdGVcbiAgfVxuXG4gIGdldFVucGFpZEFtb3VudCh0cmFuc2FjdGlvbnM6IFRyYW5zYWN0aW9uQ29sbGVjdGlvbik6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMuc3VtQnkoJ2dyb3NzUHJpY2UnKSAtIHRyYW5zYWN0aW9ucy5nZXRCeUludm9pY2VzKHRoaXMpLnN1bUJ5KCdncm9zc0Ftb3VudCcpO1xuICB9XG5cbiAgYWxsb2NhdGUoYmFua1RyYW5zYWN0aW9uOiBCYW5rVHJhbnNhY3Rpb24sIGFtb3VudD86IG51bWJlcik6IFRyYW5zYWN0aW9uW10ge1xuICAgIHJldHVybiBmbGF0dGVuKHRoaXMubWFwKGludm9pY2UgPT4gaW52b2ljZS5hbGxvY2F0ZShiYW5rVHJhbnNhY3Rpb24sIGFtb3VudCkpKTtcbiAgfVxufVxuIl19
|
@@ -8312,10 +8312,11 @@ class SoleInvoiceCollection extends Collection {
|
|
8312
8312
|
getPaid(transactions) {
|
8313
8313
|
const amountPerInvoice = transactions.getAmountPerInvoice();
|
8314
8314
|
return this.filter(invoice => invoice.grossPrice > 0
|
8315
|
-
&& round(amountPerInvoice.get(invoice.id), 2) >= invoice.grossPrice);
|
8315
|
+
&& round(amountPerInvoice.get(invoice.id), 2) >= invoice.grossPrice.toFixed(2));
|
8316
8316
|
}
|
8317
8317
|
getUnpaid(transactions) {
|
8318
|
-
|
8318
|
+
const amountPerInvoice = transactions.getAmountPerInvoice();
|
8319
|
+
return this.getOpen().filter(invoice => round(amountPerInvoice.get(invoice.id), 2) < invoice.grossPrice.toFixed(2));
|
8319
8320
|
}
|
8320
8321
|
getOpen() {
|
8321
8322
|
return this.filter((invoice) => invoice.isOpen());
|