taxtank-core 0.33.54 → 0.33.56

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
- return this.getOpen().filter(invoice => transactions.getAmountPerInvoice().get(invoice.id) < invoice.grossPrice);
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLmNvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvY29sbGVjdGlvbnMvc29sZS9zb2xlLWludm9pY2UuY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sT0FBTyxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRS9FLE9BQU8sS0FBSyxNQUFNLGNBQWMsQ0FBQztBQUVqQ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0J5U3RhdGVcbiAgfVxuXG4gIGdldFVucGFpZEFtb3VudCh0cmFuc2FjdGlvbnM6IFRyYW5zYWN0aW9uQ29sbGVjdGlvbik6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMuc3VtQnkoJ2dyb3NzUHJpY2UnKSAtIHRyYW5zYWN0aW9ucy5nZXRCeUludm9pY2VzKHRoaXMpLnN1bUJ5KCdncm9zc0Ftb3VudCcpO1xuICB9XG5cbiAgYWxsb2NhdGUoYmFua1RyYW5zYWN0aW9uOiBCYW5rVHJhbnNhY3Rpb24sIGFtb3VudD86IG51bWJlcik6IFRyYW5zYWN0aW9uW10ge1xuICAgIHJldHVybiBmbGF0dGVuKHRoaXMubWFwKGludm9pY2UgPT4gaW52b2ljZS5hbGxvY2F0ZShiYW5rVHJhbnNhY3Rpb24sIGFtb3VudCkpKTtcbiAgfVxufVxuIl19
@@ -19,11 +19,14 @@ export class HomeOfficeCalculatorForm extends AbstractForm {
19
19
  });
20
20
  }
21
21
  submit() {
22
- let occupancyPercent = this.value.officeArea * 100 / this.value.homeArea;
23
- if (!this.value.dedicatedOffice) {
24
- occupancyPercent *= this.value.workUsage / 100;
22
+ let occupancyPercent = 0;
23
+ if (this.value.officeArea && this.value.homeArea) {
24
+ occupancyPercent = this.value.officeArea * 100 / this.value.homeArea;
25
+ if (!this.value.dedicatedOffice) {
26
+ occupancyPercent *= this.value.workUsage / 100;
27
+ }
25
28
  }
26
29
  return super.submit({ occupancyPercent: round(occupancyPercent, 2) });
27
30
  }
28
31
  }
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZS1vZmZpY2UtY2FsY3VsYXRvci5mb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL2Zvcm1zL2hvbWUtb2ZmaWNlL2hvbWUtb2ZmaWNlLWNhbGN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AgICAgICAgb2NjdXBhbmN5UGVyY2VudCAqPSB0aGlzLnZhbHVlLndvcmtVc2FnZSAvIDEwMDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gc3VwZXIuc3VibWl0KHsgb2NjdXBhbmN5UGVyY2VudDogcm91bmQob2NjdXBhbmN5UGVyY2VudCwgMikgfSk7XG4gIH1cbn1cbiJdfQ==
@@ -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
- return this.getOpen().filter(invoice => transactions.getAmountPerInvoice().get(invoice.id) < invoice.grossPrice);
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());
@@ -24664,9 +24665,12 @@ class HomeOfficeCalculatorForm extends AbstractForm {
24664
24665
  });
24665
24666
  }
24666
24667
  submit() {
24667
- let occupancyPercent = this.value.officeArea * 100 / this.value.homeArea;
24668
- if (!this.value.dedicatedOffice) {
24669
- occupancyPercent *= this.value.workUsage / 100;
24668
+ let occupancyPercent = 0;
24669
+ if (this.value.officeArea && this.value.homeArea) {
24670
+ occupancyPercent = this.value.officeArea * 100 / this.value.homeArea;
24671
+ if (!this.value.dedicatedOffice) {
24672
+ occupancyPercent *= this.value.workUsage / 100;
24673
+ }
24670
24674
  }
24671
24675
  return super.submit({ occupancyPercent: round(occupancyPercent, 2) });
24672
24676
  }