taxtank-core 0.33.34 → 0.33.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  import { Collection } from '../collection';
2
2
  import flatten from 'lodash/flatten';
3
- import { SoleInvoiceStateEnum } from '../../db/Enums';
4
- import { CollectionDictionary } from '../collection-dictionary';
3
+ import { SoleInvoiceStateEnum, SoleInvoiceStatusesEnum } from '../../db/Enums';
5
4
  export class SoleInvoiceCollection extends Collection {
6
5
  getOverdue() {
7
6
  return this.filter((invoice) => invoice.isOverdue());
@@ -23,12 +22,13 @@ export class SoleInvoiceCollection extends Collection {
23
22
  return flatten(this.map(invoice => invoice.items.map(item => item.id)));
24
23
  }
25
24
  groupByState(transactions) {
25
+ const invoicesByState = this.groupBy('status');
26
26
  const unpaidInvoices = this.getUnpaid(transactions);
27
- const dictionary = new CollectionDictionary(new SoleInvoiceCollection());
28
- dictionary.add(SoleInvoiceStateEnum.PAID, this.getPaid(transactions));
29
- dictionary.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
30
- dictionary.add(SoleInvoiceStateEnum.PENDING, unpaidInvoices.getPending());
31
- return dictionary;
27
+ invoicesByState.add(SoleInvoiceStateEnum.PAID, this.getPaid(transactions));
28
+ invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.PAID).toArray()));
29
+ invoicesByState.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
30
+ invoicesByState.add(SoleInvoiceStateEnum.PENDING, unpaidInvoices.getPending());
31
+ return invoicesByState;
32
32
  }
33
33
  getUnpaidAmount(transactions) {
34
34
  return this.sumBy('grossPrice') - transactions.getByInvoices(this).sumBy('grossAmount');
@@ -37,4 +37,4 @@ export class SoleInvoiceCollection extends Collection {
37
37
  return flatten(this.map(invoice => invoice.allocate(bankTransaction, amount)));
38
38
  }
39
39
  }
40
- //# sourceMappingURL=data:application/json;base64,eyJ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XRlLmdldChTb2xlSW52b2ljZVN0YXRlRW51bS5QQUlEKS50b0FycmF5KCkpXG4gICAgKTtcbiAgICBpbnZvaWNlc0J5U3RhdGUuYWRkKFNvbGVJbnZvaWNlU3RhdGVFbnVtLk9WRVJEVUUsIHVucGFpZEludm9pY2VzLmdldE92ZXJkdWUoKSk7XG4gICAgaW52b2ljZXNCeVN0YXRlLmFkZChTb2xlSW52b2ljZVN0YXRlRW51bS5QRU5ESU5HLCB1bnBhaWRJbnZvaWNlcy5nZXRQZW5kaW5nKCkpO1xuXG4gICAgcmV0dXJuIGludm9pY2VzQnlTdGF0ZVxuICB9XG5cbiAgZ2V0VW5wYWlkQW1vdW50KHRyYW5zYWN0aW9uczogVHJhbnNhY3Rpb25Db2xsZWN0aW9uKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zdW1CeSgnZ3Jvc3NQcmljZScpIC0gdHJhbnNhY3Rpb25zLmdldEJ5SW52b2ljZXModGhpcykuc3VtQnkoJ2dyb3NzQW1vdW50Jyk7XG4gIH1cblxuICBhbGxvY2F0ZShiYW5rVHJhbnNhY3Rpb246IEJhbmtUcmFuc2FjdGlvbiwgYW1vdW50PzogbnVtYmVyKTogVHJhbnNhY3Rpb25bXSB7XG4gICAgcmV0dXJuIGZsYXR0ZW4odGhpcy5tYXAoaW52b2ljZSA9PiBpbnZvaWNlLmFsbG9jYXRlKGJhbmtUcmFuc2FjdGlvbiwgYW1vdW50KSkpO1xuICB9XG59XG4iXX0=
@@ -1,7 +1,10 @@
1
1
  export var SoleInvoiceStateEnum;
2
2
  (function (SoleInvoiceStateEnum) {
3
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["PAID"] = 0] = "PAID";
4
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["OVERDUE"] = 1] = "OVERDUE";
5
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["PENDING"] = 2] = "PENDING";
3
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["CANCELED"] = 0] = "CANCELED";
4
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["DRAFT"] = 1] = "DRAFT";
5
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["OPEN"] = 2] = "OPEN";
6
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["PAID"] = 3] = "PAID";
7
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["OVERDUE"] = 4] = "OVERDUE";
8
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["PENDING"] = 5] = "PENDING";
6
9
  })(SoleInvoiceStateEnum || (SoleInvoiceStateEnum = {}));
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLXN0YXRlLmVudW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvZGIvRW51bXMvc29sZS9zb2xlLWludm9pY2Utc3RhdGUuZW51bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxvQkFJWDtBQUpELFdBQVksb0JBQW9CO0lBQzlCLCtEQUFRLENBQUE7SUFDUixxRUFBVyxDQUFBO0lBQ1gscUVBQVcsQ0FBQTtBQUNiLENBQUMsRUFKVyxvQkFBb0IsS0FBcEIsb0JBQW9CLFFBSS9CIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGVudW0gU29sZUludm9pY2VTdGF0ZUVudW0ge1xuICBQQUlEID0gMCxcbiAgT1ZFUkRVRSA9IDEsXG4gIFBFTkRJTkcgPSAyLFxufVxuIl19
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLXN0YXRlLmVudW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvZGIvRW51bXMvc29sZS9zb2xlLWludm9pY2Utc3RhdGUuZW51bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxvQkFPWDtBQVBELFdBQVksb0JBQW9CO0lBQzlCLHVFQUFZLENBQUE7SUFDWixpRUFBUyxDQUFBO0lBQ1QsK0RBQVEsQ0FBQTtJQUNSLCtEQUFRLENBQUE7SUFDUixxRUFBVyxDQUFBO0lBQ1gscUVBQVcsQ0FBQTtBQUNiLENBQUMsRUFQVyxvQkFBb0IsS0FBcEIsb0JBQW9CLFFBTy9CIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGVudW0gU29sZUludm9pY2VTdGF0ZUVudW0ge1xuICBDQU5DRUxFRCA9IDAsXG4gIERSQUZUID0gMSxcbiAgT1BFTiA9IDIsXG4gIFBBSUQgPSAzLFxuICBPVkVSRFVFID0gNCxcbiAgUEVORElORyA9IDUsXG59XG4iXX0=
@@ -139,4 +139,4 @@ __decorate([
139
139
  __decorate([
140
140
  Type(() => BankAccount)
141
141
  ], SoleInvoice.prototype, "bankAccount", void 0);
142
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL21vZGVscy9zb2xlL3NvbGUtaW52b2ljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFdBQVcsSUFBSSxlQUFlLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUNuRixPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQy9CLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0F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WNlKHRoaXMudGF4VHlwZSkgKiBhbGxvY2F0aW9uQ29lZmZpY2llbnQ7XG5cbiAgICAgIHJldHVybiB0cmFuc2FjdGlvbjtcbiAgICB9KTtcbiAgfVxufVxuIl19
@@ -1576,9 +1576,12 @@ var SoleDepreciationMethodEnum;
1576
1576
 
1577
1577
  var SoleInvoiceStateEnum;
1578
1578
  (function (SoleInvoiceStateEnum) {
1579
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["PAID"] = 0] = "PAID";
1580
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["OVERDUE"] = 1] = "OVERDUE";
1581
- SoleInvoiceStateEnum[SoleInvoiceStateEnum["PENDING"] = 2] = "PENDING";
1579
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["CANCELED"] = 0] = "CANCELED";
1580
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["DRAFT"] = 1] = "DRAFT";
1581
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["OPEN"] = 2] = "OPEN";
1582
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["PAID"] = 3] = "PAID";
1583
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["OVERDUE"] = 4] = "OVERDUE";
1584
+ SoleInvoiceStateEnum[SoleInvoiceStateEnum["PENDING"] = 5] = "PENDING";
1582
1585
  })(SoleInvoiceStateEnum || (SoleInvoiceStateEnum = {}));
1583
1586
 
1584
1587
  var SoleInvoiceStatusesEnum;
@@ -8451,12 +8454,13 @@ class SoleInvoiceCollection extends Collection {
8451
8454
  return flatten(this.map(invoice => invoice.items.map(item => item.id)));
8452
8455
  }
8453
8456
  groupByState(transactions) {
8457
+ const invoicesByState = this.groupBy('status');
8454
8458
  const unpaidInvoices = this.getUnpaid(transactions);
8455
- const dictionary = new CollectionDictionary(new SoleInvoiceCollection());
8456
- dictionary.add(SoleInvoiceStateEnum.PAID, this.getPaid(transactions));
8457
- dictionary.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
8458
- dictionary.add(SoleInvoiceStateEnum.PENDING, unpaidInvoices.getPending());
8459
- return dictionary;
8459
+ invoicesByState.add(SoleInvoiceStateEnum.PAID, this.getPaid(transactions));
8460
+ invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.PAID).toArray()));
8461
+ invoicesByState.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
8462
+ invoicesByState.add(SoleInvoiceStateEnum.PENDING, unpaidInvoices.getPending());
8463
+ return invoicesByState;
8460
8464
  }
8461
8465
  getUnpaidAmount(transactions) {
8462
8466
  return this.sumBy('grossPrice') - transactions.getByInvoices(this).sumBy('grossAmount');