taxtank-core 0.33.53 → 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
- 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
@@ -1,17 +1,22 @@
1
- import { Injectable } from '@angular/core';
1
+ import { Inject, Injectable } from '@angular/core';
2
2
  import { RestService } from '../rest';
3
3
  import { Collection } from '../../../collections';
4
- import { HomeOfficeLog } from '../../../models';
4
+ import { HomeOfficeClaim, HomeOfficeLog } from '../../../models';
5
5
  import * as i0 from "@angular/core";
6
6
  export class HomeOfficeLogService extends RestService {
7
- constructor() {
8
- super(...arguments);
7
+ constructor(environment) {
8
+ super(environment);
9
+ this.environment = environment;
9
10
  this.endpointUri = 'home-office-logs';
10
11
  this.modelClass = HomeOfficeLog;
11
12
  this.collectionClass = (Collection);
12
13
  this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
14
+ this.listenEvents();
13
15
  }
14
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16
+ listenEvents() {
17
+ this.listenCSE(HomeOfficeClaim, this.refreshCache, ['post']);
18
+ }
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
15
20
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, providedIn: 'root' }); }
16
21
  }
17
22
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, decorators: [{
@@ -19,5 +24,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19
24
  args: [{
20
25
  providedIn: 'root'
21
26
  }]
22
- }] });
23
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZS1vZmZpY2UtbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvc2VydmljZXMvaHR0cC9ob21lLW9mZmljZS9ob21lLW9mZmljZS1sb2cuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxXQUFXLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDbEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ2xELE9BQU8sRUFDTCxhQUFhLEVBRWQsTUFBTSxpQkFBaUIsQ0FBQzs7QUFLekIsTUFBTSxPQUFPLG9CQUFxQixTQUFRLFdBQTZFO0lBSHZIOztRQUlZLGdCQUFXLEdBQUcsa0JBQWtCLENBQUM7UUFDM0MsZUFBVSxHQUF5QixhQUFhLENBQUM7UUFDakQsb0JBQWUsR0FBcUMsQ0FBQSxVQUF5QixDQUF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aG9kW10gPSBbJ3Bvc3RCYXRjaCcsICdwdXRCYXRjaCcsICdkZWxldGVCYXRjaCddO1xufVxuIl19
27
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
28
+ type: Inject,
29
+ args: ['environment']
30
+ }] }] });
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZS1vZmZpY2UtbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvc2VydmljZXMvaHR0cC9ob21lLW9mZmljZS9ob21lLW9mZmljZS1sb2cuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQWMsV0FBVyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQ2xELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQ0wsZUFBZSxFQUNmLGFBQWEsRUFFZCxNQUFNLGlCQUFpQixDQUFDOztBQU16QixNQUFNLE9BQU8sb0JBQXFCLFNBQVEsV0FBNkU7SUFNckgsWUFBNkMsV0FBZ0I7UUFDM0QsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBRHdCLGdCQUFXLEdBQVgsV0FBVyxDQUFLO1FBTG5ELGdCQUFXLEdBQUcsa0JBQWtCLENBQUM7UUFDM0MsZUFBVSxHQUF5QixhQUFhLENBQUM7UUFDakQsb0JBQWUsR0FBcUMsQ0FBQSxVQUF5QixDQUFBLENBQUM7UUFDOUUsb0JBQWUsR0FBaUIsQ0FBQyxXQUFXLEVBQUUsVUFBVSxFQUFFLGFBQWEsQ0FBQyxDQUFDO1FBSXZFLElBQUks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WQgZW5kcG9pbnRVcmkgPSAnaG9tZS1vZmZpY2UtbG9ncyc7XG4gIG1vZGVsQ2xhc3M6IHR5cGVvZiBIb21lT2ZmaWNlTG9nID0gSG9tZU9mZmljZUxvZztcbiAgY29sbGVjdGlvbkNsYXNzOiB0eXBlb2YgQ29sbGVjdGlvbjxIb21lT2ZmaWNlTG9nPiA9IENvbGxlY3Rpb248SG9tZU9mZmljZUxvZz47XG4gIGRpc2FibGVkTWV0aG9kczogUmVzdE1ldGhvZFtdID0gWydwb3N0QmF0Y2gnLCAncHV0QmF0Y2gnLCAnZGVsZXRlQmF0Y2gnXTtcblxuICBjb25zdHJ1Y3RvcihASW5qZWN0KCdlbnZpcm9ubWVudCcpIHByb3RlY3RlZCBlbnZpcm9ubWVudDogYW55KSB7XG4gICAgc3VwZXIoZW52aXJvbm1lbnQpO1xuICAgIHRoaXMubGlzdGVuRXZlbnRzKCk7XG4gIH1cblxuICBsaXN0ZW5FdmVudHMoKTogdm9pZCB7XG4gICAgdGhpcy5saXN0ZW5DU0UoSG9tZU9mZmljZUNsYWltLCB0aGlzLnJlZnJlc2hDYWNoZSwgWydwb3N0J10pO1xuICB9XG59XG4iXX0=
@@ -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());
@@ -16454,14 +16455,19 @@ var HomeOfficeClaimMessagesEnum;
16454
16455
  })(HomeOfficeClaimMessagesEnum || (HomeOfficeClaimMessagesEnum = {}));
16455
16456
 
16456
16457
  class HomeOfficeLogService extends RestService$1 {
16457
- constructor() {
16458
- super(...arguments);
16458
+ constructor(environment) {
16459
+ super(environment);
16460
+ this.environment = environment;
16459
16461
  this.endpointUri = 'home-office-logs';
16460
16462
  this.modelClass = HomeOfficeLog;
16461
16463
  this.collectionClass = (Collection);
16462
16464
  this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
16465
+ this.listenEvents();
16463
16466
  }
16464
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16467
+ listenEvents() {
16468
+ this.listenCSE(HomeOfficeClaim, this.refreshCache, ['post']);
16469
+ }
16470
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
16465
16471
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, providedIn: 'root' }); }
16466
16472
  }
16467
16473
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, decorators: [{
@@ -16469,7 +16475,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
16469
16475
  args: [{
16470
16476
  providedIn: 'root'
16471
16477
  }]
16472
- }] });
16478
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
16479
+ type: Inject,
16480
+ args: ['environment']
16481
+ }] }] });
16473
16482
 
16474
16483
  var HomeOfficeLogMessagesEnum;
16475
16484
  (function (HomeOfficeLogMessagesEnum) {