taxtank-core 0.27.3 → 0.27.6

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.
Files changed (91) hide show
  1. package/bundles/taxtank-core.umd.js +448 -163
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/chart-accounts.collection.js +3 -3
  4. package/esm2015/lib/collections/transaction/transaction.collection.js +5 -2
  5. package/esm2015/lib/collections/vehicle/vehicle-claim.collection.js +2 -4
  6. package/esm2015/lib/collections/vehicle/vehicle-logbook.collection.js +15 -30
  7. package/esm2015/lib/db/Enums/depreciation-calculation.enum.js +2 -1
  8. package/esm2015/lib/db/Enums/sole-invoice-statuses.enum.js +8 -0
  9. package/esm2015/lib/db/Enums/sole-invoice-template-tax-type.enum.js +7 -0
  10. package/esm2015/lib/db/Models/chart-accounts/chart-accounts.js +1 -1
  11. package/esm2015/lib/db/Models/sole/sole-invoice-template.js +1 -1
  12. package/esm2015/lib/db/Models/sole/sole-invoice.js +1 -1
  13. package/esm2015/lib/db/Models/user/user.js +1 -1
  14. package/esm2015/lib/forms/abstract.form.js +11 -5
  15. package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +6 -10
  16. package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +6 -3
  17. package/esm2015/lib/forms/sole/index.js +3 -1
  18. package/esm2015/lib/forms/sole/sole-business-allocations.form.js +2 -1
  19. package/esm2015/lib/forms/sole/sole-invoice-item.form.js +43 -0
  20. package/esm2015/lib/forms/sole/sole-invoice-template.form.js +6 -4
  21. package/esm2015/lib/forms/sole/sole-invoice.form.js +51 -0
  22. package/esm2015/lib/forms/vehicle/vehicle-claim-details.form.js +3 -7
  23. package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +8 -2
  24. package/esm2015/lib/forms/vehicle/vehicle-logbook.form.js +22 -15
  25. package/esm2015/lib/models/account-setup/account-setup-items.const.js +2 -2
  26. package/esm2015/lib/models/bank/bank-account.js +4 -1
  27. package/esm2015/lib/models/chart-accounts/chart-accounts.js +9 -9
  28. package/esm2015/lib/models/endpoint/endpoints.const.js +5 -1
  29. package/esm2015/lib/models/financial-year/financial-year.js +2 -1
  30. package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +2 -2
  31. package/esm2015/lib/models/sole/sole-details.js +3 -1
  32. package/esm2015/lib/models/sole/sole-invoice-item.js +8 -1
  33. package/esm2015/lib/models/sole/sole-invoice-template.js +15 -4
  34. package/esm2015/lib/models/sole/sole-invoice.js +55 -2
  35. package/esm2015/lib/models/transaction/transaction.js +3 -3
  36. package/esm2015/lib/models/vehicle/logbook-period.js +2 -1
  37. package/esm2015/lib/models/vehicle/vehicle-claim-details.js +12 -11
  38. package/esm2015/lib/models/vehicle/vehicle-claim.js +14 -13
  39. package/esm2015/lib/models/vehicle/vehicle-logbook.js +18 -5
  40. package/esm2015/lib/services/account-setup/account-setup.service.js +2 -2
  41. package/esm2015/lib/services/affiliate/rewardful/rewardful.service.js +34 -0
  42. package/esm2015/lib/services/http/depreciation/depreciation.service.js +1 -2
  43. package/esm2015/lib/services/http/sole/index.js +2 -1
  44. package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +21 -0
  45. package/esm2015/lib/services/http/transaction/transaction.service.js +1 -2
  46. package/esm2015/lib/services/http/vehicle/vehicle-claim-details.service.js +7 -6
  47. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +10 -10
  48. package/esm2015/lib/services/index.js +2 -1
  49. package/esm2015/public-api.js +3 -1
  50. package/fesm2015/taxtank-core.js +379 -139
  51. package/fesm2015/taxtank-core.js.map +1 -1
  52. package/lib/collections/chart-accounts.collection.d.ts +2 -2
  53. package/lib/collections/transaction/transaction.collection.d.ts +2 -2
  54. package/lib/collections/vehicle/vehicle-claim.collection.d.ts +1 -3
  55. package/lib/collections/vehicle/vehicle-logbook.collection.d.ts +4 -9
  56. package/lib/db/Enums/depreciation-calculation.enum.d.ts +1 -0
  57. package/lib/db/Enums/sole-invoice-statuses.enum.d.ts +6 -0
  58. package/lib/db/Enums/sole-invoice-template-tax-type.enum.d.ts +5 -0
  59. package/lib/db/Models/chart-accounts/chart-accounts.d.ts +1 -0
  60. package/lib/db/Models/sole/sole-invoice-template.d.ts +2 -1
  61. package/lib/db/Models/sole/sole-invoice.d.ts +2 -1
  62. package/lib/db/Models/user/user.d.ts +1 -0
  63. package/lib/forms/abstract.form.d.ts +3 -1
  64. package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +1 -3
  65. package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +4 -2
  66. package/lib/forms/sole/index.d.ts +2 -0
  67. package/lib/forms/sole/sole-business-allocations.form.d.ts +1 -0
  68. package/lib/forms/sole/sole-invoice-item.form.d.ts +10 -0
  69. package/lib/forms/sole/sole-invoice-template.form.d.ts +3 -2
  70. package/lib/forms/sole/sole-invoice.form.d.ts +14 -0
  71. package/lib/forms/vehicle/vehicle-claim-details.form.d.ts +1 -6
  72. package/lib/forms/vehicle/vehicle-claim.form.d.ts +3 -0
  73. package/lib/forms/vehicle/vehicle-logbook.form.d.ts +4 -0
  74. package/lib/models/bank/bank-account.d.ts +2 -0
  75. package/lib/models/chart-accounts/chart-accounts.d.ts +6 -6
  76. package/lib/models/financial-year/financial-year.d.ts +1 -0
  77. package/lib/models/sole/sole-details.d.ts +2 -0
  78. package/lib/models/sole/sole-invoice-item.d.ts +2 -0
  79. package/lib/models/sole/sole-invoice-template.d.ts +5 -1
  80. package/lib/models/sole/sole-invoice.d.ts +12 -0
  81. package/lib/models/transaction/transaction.d.ts +2 -2
  82. package/lib/models/vehicle/logbook-period.d.ts +1 -0
  83. package/lib/models/vehicle/vehicle-claim-details.d.ts +8 -2
  84. package/lib/models/vehicle/vehicle-claim.d.ts +6 -4
  85. package/lib/models/vehicle/vehicle-logbook.d.ts +8 -4
  86. package/lib/services/affiliate/rewardful/rewardful.service.d.ts +13 -0
  87. package/lib/services/http/sole/index.d.ts +1 -0
  88. package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +11 -0
  89. package/lib/services/index.d.ts +1 -0
  90. package/package.json +1 -1
  91. package/public-api.d.ts +2 -0
@@ -4,7 +4,7 @@ import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, DatePipe } from '@angular/common';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
7
- import { ReplaySubject, Subject, BehaviorSubject, throwError, combineLatest, forkJoin, of, Observable, from } from 'rxjs';
7
+ import { ReplaySubject, Subject, BehaviorSubject, throwError, combineLatest, forkJoin, Observable, of, from } from 'rxjs';
8
8
  import { map, filter, catchError, take, switchMap, finalize, mergeMap, skip, distinctUntilChanged } from 'rxjs/operators';
9
9
  import { plainToClass, classToPlain, Type, Exclude, Transform, Expose } from 'class-transformer';
10
10
  import { JwtHelperService } from '@auth0/angular-jwt';
@@ -14,8 +14,8 @@ import last from 'lodash/last';
14
14
  import flatten from 'lodash/flatten';
15
15
  import hasIn from 'lodash/hasIn';
16
16
  import first from 'lodash/first';
17
- import * as moment from 'moment';
18
- import { DateRange } from 'moment-range';
17
+ import * as moment$1 from 'moment';
18
+ import { extendMoment, DateRange } from 'moment-range';
19
19
  import uniqBy from 'lodash/uniqBy';
20
20
  import concat from 'lodash/concat';
21
21
  import { throwError as throwError$1 } from 'rxjs/internal/observable/throwError';
@@ -685,6 +685,10 @@ const ENDPOINTS = {
685
685
  SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
686
686
  SOLE_DEPRECIATION_METHODS_GET: new Endpoint('GET', '\\/sole-depreciation-methods'),
687
687
  SOLE_DEPRECIATION_METHODS_PUT: new Endpoint('PUT', '\\/sole-depreciation-methods\\/\\d+'),
688
+ SOLE_INVOICES_GET: new Endpoint('GET', '\\/sole-invoices'),
689
+ SOLE_INVOICES_POST: new Endpoint('POST', '\\/sole-invoices'),
690
+ SOLE_INVOICES_PUT: new Endpoint('PUT', '\\/sole-invoices\\/\\d+'),
691
+ SOLE_INVOICES_DELETE: new Endpoint('DELETE', '\\/sole-invoices\\/\\d+'),
688
692
  SOLE_INVOICE_TEMPLATES_GET: new Endpoint('GET', '\\/sole-invoice-templates'),
689
693
  SOLE_INVOICE_TEMPLATES_POST: new Endpoint('POST', '\\/sole-invoice-templates'),
690
694
  SOLE_INVOICE_TEMPLATES_PUT: new Endpoint('PUT', '\\/sole-invoice-templates\\/\\d+'),
@@ -1241,6 +1245,7 @@ class FinancialYear {
1241
1245
  return months;
1242
1246
  }
1243
1247
  }
1248
+ FinancialYear.weeksInYear = 52;
1244
1249
  FinancialYear.startMonthIndex = 6;
1245
1250
 
1246
1251
  /**
@@ -2241,26 +2246,26 @@ class ChartAccounts extends ChartAccounts$1 {
2241
2246
  return this.name;
2242
2247
  }
2243
2248
  /**
2244
- * Check if chart accounts id is related for 'Klms travelled for work' category
2249
+ * Check if chart accounts id is related for 'Kms travelled for work' category
2245
2250
  */
2246
- isKlmsForWork() {
2251
+ isKmsForWork() {
2247
2252
  return this.id === ChartAccountsListEnum.KLMS_TRAVELLED_FOR_WORK;
2248
2253
  }
2249
2254
  /**
2250
- * Check if chart accounts id is related for 'Klms travelled for sole' category
2255
+ * Check if chart accounts id is related for 'Kms travelled for sole' category
2251
2256
  */
2252
- isKlmsForSole() {
2257
+ isKmsForSole() {
2253
2258
  return this.id === ChartAccountsListEnum.KLMS_TRAVELLED;
2254
2259
  }
2255
2260
  /**
2256
- * Check if accounts id is related for KLMs category related to passed tank type
2261
+ * Check if accounts id is related for KMs category related to passed tank type
2257
2262
  */
2258
- isKLMsByTankType(tankType) {
2263
+ isKMsByTankType(tankType) {
2259
2264
  switch (tankType) {
2260
2265
  case TankTypeEnum.WORK:
2261
- return this.isKlmsForWork();
2266
+ return this.isKmsForWork();
2262
2267
  case TankTypeEnum.SOLE:
2263
- return this.isKlmsForSole();
2268
+ return this.isKmsForSole();
2264
2269
  default:
2265
2270
  return false;
2266
2271
  }
@@ -2380,6 +2385,13 @@ __decorate([
2380
2385
  ], ChartAccounts.prototype, "metadata", void 0);
2381
2386
 
2382
2387
  class SoleInvoiceItem extends SoleInvoiceItem$1 {
2388
+ constructor() {
2389
+ super(...arguments);
2390
+ this.isGST = false;
2391
+ }
2392
+ get amount() {
2393
+ return this.price * this.quantity;
2394
+ }
2383
2395
  }
2384
2396
  __decorate([
2385
2397
  Type(() => SoleInvoice)
@@ -2420,9 +2432,26 @@ __decorate([
2420
2432
  class SoleInvoiceTemplate$1 extends AbstractModel {
2421
2433
  }
2422
2434
 
2435
+ var SoleInvoiceTemplateTaxTypeEnum;
2436
+ (function (SoleInvoiceTemplateTaxTypeEnum) {
2437
+ SoleInvoiceTemplateTaxTypeEnum[SoleInvoiceTemplateTaxTypeEnum["EXCLUSIVE"] = 0] = "EXCLUSIVE";
2438
+ SoleInvoiceTemplateTaxTypeEnum[SoleInvoiceTemplateTaxTypeEnum["INCLUSIVE"] = 1] = "INCLUSIVE";
2439
+ SoleInvoiceTemplateTaxTypeEnum[SoleInvoiceTemplateTaxTypeEnum["NONE"] = 2] = "NONE";
2440
+ })(SoleInvoiceTemplateTaxTypeEnum || (SoleInvoiceTemplateTaxTypeEnum = {}));
2441
+
2423
2442
  class SoleInvoiceTemplate extends SoleInvoiceTemplate$1 {
2424
- static create(businessId) {
2425
- return plainToClass(SoleInvoiceTemplate, { business: { id: businessId }, isTaxIncluded: false });
2443
+ constructor() {
2444
+ super(...arguments);
2445
+ this.taxType = SoleInvoiceTemplateTaxTypeEnum.NONE;
2446
+ }
2447
+ isNoTax() {
2448
+ return this.taxType === SoleInvoiceTemplateTaxTypeEnum.NONE;
2449
+ }
2450
+ isTaxExclusive() {
2451
+ return this.taxType === SoleInvoiceTemplateTaxTypeEnum.EXCLUSIVE;
2452
+ }
2453
+ isTaxInclusive() {
2454
+ return this.taxType === SoleInvoiceTemplateTaxTypeEnum.INCLUSIVE;
2426
2455
  }
2427
2456
  }
2428
2457
  __decorate([
@@ -2432,7 +2461,77 @@ __decorate([
2432
2461
  Type(() => BankAccount)
2433
2462
  ], SoleInvoiceTemplate.prototype, "bankAccount", void 0);
2434
2463
 
2464
+ var SoleInvoiceStatusesEnum;
2465
+ (function (SoleInvoiceStatusesEnum) {
2466
+ SoleInvoiceStatusesEnum[SoleInvoiceStatusesEnum["CANCELED"] = 0] = "CANCELED";
2467
+ SoleInvoiceStatusesEnum[SoleInvoiceStatusesEnum["DRAFT"] = 1] = "DRAFT";
2468
+ SoleInvoiceStatusesEnum[SoleInvoiceStatusesEnum["PENDING"] = 2] = "PENDING";
2469
+ SoleInvoiceStatusesEnum[SoleInvoiceStatusesEnum["PAID"] = 3] = "PAID";
2470
+ })(SoleInvoiceStatusesEnum || (SoleInvoiceStatusesEnum = {}));
2471
+
2472
+ class SoleDetails$1 extends AbstractModel {
2473
+ }
2474
+
2475
+ class SoleDetails extends SoleDetails$1 {
2476
+ }
2477
+ SoleDetails.GSTPercentMultiplier = 0.1;
2478
+ SoleDetails.GSTPercentDivider = 11;
2479
+ __decorate([
2480
+ Type(() => User)
2481
+ ], SoleDetails.prototype, "user", void 0);
2482
+
2435
2483
  class SoleInvoice extends SoleInvoice$1 {
2484
+ constructor() {
2485
+ super(...arguments);
2486
+ this.items = [plainToClass(SoleInvoiceItem, {})];
2487
+ this.status = SoleInvoiceStatusesEnum.DRAFT;
2488
+ }
2489
+ get amount() {
2490
+ return this.items.reduce((sum, item) => sum + item.amount, 0);
2491
+ }
2492
+ getGSTItems() {
2493
+ return this.items.filter((item) => item.isGST);
2494
+ }
2495
+ getGSTItemsAmount() {
2496
+ return this.getGSTItems().reduce((sum, item) => sum + item.amount, 0);
2497
+ }
2498
+ get subtotal() {
2499
+ var _a;
2500
+ if ((_a = this.template) === null || _a === void 0 ? void 0 : _a.isTaxInclusive()) {
2501
+ return this.amount - this.GSTAmount;
2502
+ }
2503
+ return this.amount;
2504
+ }
2505
+ get GSTAmount() {
2506
+ var _a, _b;
2507
+ switch (true) {
2508
+ case (_a = this.template) === null || _a === void 0 ? void 0 : _a.isTaxInclusive():
2509
+ return +(this.getGSTItemsAmount() / SoleDetails.GSTPercentDivider).toFixed(2);
2510
+ case (_b = this.template) === null || _b === void 0 ? void 0 : _b.isTaxExclusive():
2511
+ return +(this.getGSTItemsAmount() * SoleDetails.GSTPercentMultiplier).toFixed(2);
2512
+ default:
2513
+ return 0;
2514
+ }
2515
+ }
2516
+ get total() {
2517
+ var _a;
2518
+ if ((_a = this.template) === null || _a === void 0 ? void 0 : _a.isTaxExclusive()) {
2519
+ return this.amount + this.GSTAmount;
2520
+ }
2521
+ return this.amount;
2522
+ }
2523
+ isDraft() {
2524
+ return this.status === SoleInvoiceStatusesEnum.DRAFT;
2525
+ }
2526
+ isCancelled() {
2527
+ return this.status === SoleInvoiceStatusesEnum.CANCELED;
2528
+ }
2529
+ isPending() {
2530
+ return this.status === SoleInvoiceStatusesEnum.PENDING;
2531
+ }
2532
+ isPaid() {
2533
+ return this.status === SoleInvoiceStatusesEnum.PAID;
2534
+ }
2436
2535
  }
2437
2536
  __decorate([
2438
2537
  Type(() => Date)
@@ -2459,6 +2558,7 @@ __decorate([
2459
2558
  /**
2460
2559
  * Class contains traveled kilometers and work usage percent in 12 weeks date range
2461
2560
  * @TODO Vik: Best period: move this and related logic to backend
2561
+ * @TODO Alex: check if we need this class when calculation refactored with backend
2462
2562
  */
2463
2563
  class LogbookPeriod {
2464
2564
  isEndOfYear() {
@@ -2482,6 +2582,7 @@ class Vehicle$1 extends AbstractModel {
2482
2582
  class VehicleLogbook$1 extends AbstractModel {
2483
2583
  }
2484
2584
 
2585
+ const moment = extendMoment(moment$1);
2485
2586
  class VehicleLogbook extends VehicleLogbook$1 {
2486
2587
  get kilometers() {
2487
2588
  return this.odometerEnd - this.odometerStart;
@@ -2495,13 +2596,18 @@ class VehicleLogbook extends VehicleLogbook$1 {
2495
2596
  isSoleTank() {
2496
2597
  return !!this.business;
2497
2598
  }
2599
+ /**
2600
+ * Get logbook period date range from logbook date and weeksInPeriod duration
2601
+ */
2602
+ getPeriod() {
2603
+ return moment.rangeFromInterval('weeks', VehicleLogbook.bestPeriodWeeks, this.date);
2604
+ }
2498
2605
  }
2499
2606
  /**
2500
- * 12 weeks in milliseconds
2501
- * "To work out your business-use percentage, you need to keep a logbook and the odometer readings for the logbook period.
2502
- * The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
2607
+ * Logbook period duration in weeks.
2608
+ * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
2503
2609
  */
2504
- VehicleLogbook.periodDuration = 7257600000;
2610
+ VehicleLogbook.bestPeriodWeeks = 12;
2505
2611
  __decorate([
2506
2612
  Type(() => Date)
2507
2613
  ], VehicleLogbook.prototype, "date", void 0);
@@ -2528,26 +2634,32 @@ var VehicleClaimDetailsMethodEnum;
2528
2634
  })(VehicleClaimDetailsMethodEnum || (VehicleClaimDetailsMethodEnum = {}));
2529
2635
 
2530
2636
  class VehicleClaimDetails extends VehicleClaimDetails$1 {
2637
+ constructor() {
2638
+ super(...arguments);
2639
+ /**
2640
+ * Init default values for the new instances
2641
+ */
2642
+ this.isManual = true;
2643
+ this.method = VehicleClaimDetailsMethodEnum.KMS;
2644
+ this.financialYear = new FinancialYear().year;
2645
+ }
2531
2646
  isLogbookMethod() {
2532
2647
  return this.method === VehicleClaimDetailsMethodEnum.LOGBOOK;
2533
2648
  }
2534
- isKlmsMethod() {
2649
+ isKmsMethod() {
2535
2650
  return this.method === VehicleClaimDetailsMethodEnum.KMS;
2536
2651
  }
2537
- // @TODO Alex: discuss with Vik and think about abstract method in AbstractModel
2538
- static create() {
2539
- return plainToClass(VehicleClaimDetails, {
2540
- isManual: true,
2541
- method: VehicleClaimDetailsMethodEnum.KMS,
2542
- financialYear: new FinancialYear().year
2543
- });
2544
- }
2545
2652
  }
2546
2653
  __decorate([
2547
2654
  Type(() => User)
2548
2655
  ], VehicleClaimDetails.prototype, "user", void 0);
2549
2656
 
2550
2657
  class VehicleClaim extends VehicleClaim$1 {
2658
+ constructor() {
2659
+ super(...arguments);
2660
+ this.kilometers = 0;
2661
+ this.workUsage = 0;
2662
+ }
2551
2663
  isWorkTank() {
2552
2664
  return !this.business;
2553
2665
  }
@@ -2558,9 +2670,9 @@ class VehicleClaim extends VehicleClaim$1 {
2558
2670
  return this.isSoleTank() ? TankTypeEnum.SOLE : TankTypeEnum.WORK;
2559
2671
  }
2560
2672
  /**
2561
- * Claim amount for KLMs method. Exists only for KLMs method.
2673
+ * Claim amount for KMs method. Exists only for KMs method.
2562
2674
  */
2563
- getKLMsClaimAmount(vehicleClaimRate) {
2675
+ getKMSClaimAmount(vehicleClaimRate) {
2564
2676
  return +(this.kilometers * vehicleClaimRate).toFixed(2);
2565
2677
  }
2566
2678
  /**
@@ -2575,19 +2687,14 @@ class VehicleClaim extends VehicleClaim$1 {
2575
2687
  // Math.abs because amount will be negative (because we sum expenses), but we don't want negative percent value
2576
2688
  return Math.abs(transactionsAmount) * this.workUsage / 100;
2577
2689
  }
2578
- getKlmsChartAccountsIdByTankType(tankType = this.tankType) {
2690
+ getAverageWeeklyKMS() {
2691
+ return this.kilometers / FinancialYear.weeksInYear;
2692
+ }
2693
+ static getKMSChartAccountsIdByTankType(tankType) {
2579
2694
  return tankType === TankTypeEnum.WORK
2580
2695
  ? ChartAccountsListEnum.KLMS_TRAVELLED_FOR_WORK
2581
2696
  : ChartAccountsListEnum.KLMS_TRAVELLED;
2582
2697
  }
2583
- static create(details, business) {
2584
- return plainToClass(VehicleClaim, {
2585
- kilometers: 0,
2586
- workUsage: 0,
2587
- details,
2588
- business
2589
- });
2590
- }
2591
2698
  }
2592
2699
  /**
2593
2700
  * limit for kms claim method
@@ -2673,6 +2780,7 @@ var DepreciationCalculationEnum;
2673
2780
  (function (DepreciationCalculationEnum) {
2674
2781
  DepreciationCalculationEnum[DepreciationCalculationEnum["PRIME_COST"] = 1] = "PRIME_COST";
2675
2782
  DepreciationCalculationEnum[DepreciationCalculationEnum["DIMINISHING"] = 2] = "DIMINISHING";
2783
+ DepreciationCalculationEnum[DepreciationCalculationEnum["CAPITAL"] = 3] = "CAPITAL";
2676
2784
  DepreciationCalculationEnum[DepreciationCalculationEnum["LVP"] = 4] = "LVP";
2677
2785
  DepreciationCalculationEnum[DepreciationCalculationEnum["AMORTISATION"] = 5] = "AMORTISATION";
2678
2786
  DepreciationCalculationEnum[DepreciationCalculationEnum["SBP"] = 6] = "SBP";
@@ -2695,7 +2803,7 @@ class DepreciationForecast extends DepreciationForecast$1 {
2695
2803
  return this.claimAmount / this.daysApplied;
2696
2804
  }
2697
2805
  get daysApplied() {
2698
- return moment(this.toDate).diff(moment(this.fromDate), 'days');
2806
+ return moment$1(this.toDate).diff(moment$1(this.fromDate), 'days');
2699
2807
  }
2700
2808
  getDaysByMonth(month) {
2701
2809
  // @TODO find a better place
@@ -3047,9 +3155,9 @@ class Transaction extends Transaction$1 {
3047
3155
  }
3048
3156
  }
3049
3157
  /**
3050
- * Check if transaction has 'Klms travelled for work' chart accounts category
3158
+ * Check if transaction has 'Kms travelled for work' chart accounts category
3051
3159
  */
3052
- get isKlmsChartAccountsCategory() {
3160
+ get isKmsChartAccountsCategory() {
3053
3161
  return this.chartAccounts.id === ChartAccountsListEnum.KLMS_TRAVELLED_FOR_WORK;
3054
3162
  }
3055
3163
  /**
@@ -3487,15 +3595,6 @@ class SoleDepreciationMethod extends SoleDepreciationMethod$1 {
3487
3595
  }
3488
3596
  }
3489
3597
 
3490
- class SoleDetails$1 extends AbstractModel {
3491
- }
3492
-
3493
- class SoleDetails extends SoleDetails$1 {
3494
- }
3495
- __decorate([
3496
- Type(() => User)
3497
- ], SoleDetails.prototype, "user", void 0);
3498
-
3499
3598
  class User extends User$1 {
3500
3599
  get fullName() {
3501
3600
  return `${this.firstName} ${this.lastName}`;
@@ -3992,7 +4091,7 @@ class Property extends Property$1 {
3992
4091
  * ownership duration from purchase till sale
3993
4092
  */
3994
4093
  getOwnershipDuration(sale, unitOfTime = 'days') {
3995
- return moment(sale.contractDate).diff(moment(this.contractDate), unitOfTime);
4094
+ return moment$1(sale.contractDate).diff(moment$1(this.contractDate), unitOfTime);
3996
4095
  }
3997
4096
  /**
3998
4097
  * Tax Position = Income - Expense - Interest - Depreciation
@@ -4132,6 +4231,9 @@ __decorate([
4132
4231
  ], BankConnection.prototype, "bank", void 0);
4133
4232
 
4134
4233
  class BankAccount extends BankAccount$1 {
4234
+ get bank() {
4235
+ return this.bankConnection.bank;
4236
+ }
4135
4237
  /**
4136
4238
  * Get current opening balance amount
4137
4239
  */
@@ -4758,9 +4860,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
4758
4860
  class VehicleClaimCollection extends Collection {
4759
4861
  /**
4760
4862
  * Get remaining kilometers limit. Total limit ({@link VehicleClaim.totalKmsLimit}) - claimed kilometers from other vehicle claims
4761
- * @param claim may not exist when user come to vehicle claim page 1st time and not created claim yet
4762
4863
  */
4763
- getKlmsLimitForClaim(claim) {
4864
+ getKmsLimitForClaim(claim) {
4764
4865
  let collection = this;
4765
4866
  if (claim) {
4766
4867
  collection = collection.removeBy('id', claim.id);
@@ -4769,7 +4870,6 @@ class VehicleClaimCollection extends Collection {
4769
4870
  }
4770
4871
  /**
4771
4872
  * Get remaining work usage limit. Total limit ({@link VehicleClaim.totalWorkUsagePercent}) - claimed percent from other vehicle claims
4772
- * @param claim may not exist when user come to vehicle claim page 1st time and not created claim yet
4773
4873
  */
4774
4874
  getWorkUsageLimitForClaim(claim) {
4775
4875
  let collection = this;
@@ -4782,14 +4882,14 @@ class VehicleClaimCollection extends Collection {
4782
4882
 
4783
4883
  class VehicleLogbookCollection extends Collection {
4784
4884
  /**
4785
- * Best period may be calculated only when user has logbooks minimum for {@link VehicleLogbook.periodDuration}
4885
+ * Best period may be calculated only when user has logbooks minimum for VehicleLogbook.bestPeriodWeeks
4786
4886
  * @TODO Vik: Best period: move this and related logic to backend
4787
4887
  */
4788
4888
  isBestPeriodExist() {
4789
4889
  if (this.items.length < 2) {
4790
4890
  return false;
4791
4891
  }
4792
- return VehicleLogbook.periodDuration < (this.last.date.getTime() - this.first.date.getTime());
4892
+ return VehicleLogbook.bestPeriodWeeks < (this.last.date.getTime() - this.first.date.getTime());
4793
4893
  }
4794
4894
  /**
4795
4895
  * Get collection of non-personal logbooks (work-related, sole-related).
@@ -4799,15 +4899,14 @@ class VehicleLogbookCollection extends Collection {
4799
4899
  return this.filterBy('isPersonal', false);
4800
4900
  }
4801
4901
  /**
4802
- * Logbook Period is the best when it has the biggest work usage percent
4803
- * Best period duration is defined as {@link VehicleLogbook.periodDuration} by the ATO
4902
+ * Get Logbook Period with the biggest work usage percent
4903
+ * Best period duration is defined as VehicleLogbook.bestPeriodWeeks by the ATO
4804
4904
  * @TODO Vik: Best period: move this and related logic to backend
4805
4905
  */
4806
4906
  getBestPeriod() {
4807
4907
  if (!this.isBestPeriodExist()) {
4808
4908
  return null;
4809
4909
  }
4810
- // declare best period variable
4811
4910
  let bestPeriod;
4812
4911
  // get list of all logbooks available for best period calculation
4813
4912
  const claimableLogbooks = this.getClaimableLogbooks().toArray();
@@ -4817,12 +4916,12 @@ class VehicleLogbookCollection extends Collection {
4817
4916
  break;
4818
4917
  }
4819
4918
  // get date range started from current handling logbook date
4820
- const dateRange = this.getPeriodRange(claimableLogbooks[i].date);
4919
+ const dateRange = claimableLogbooks[i].getPeriod();
4821
4920
  // get all logbooks included in current logbook period
4822
- const logbooksInRange = this.filterByRange('date', dateRange.from, dateRange.to);
4921
+ const logbooksInRange = this.filterByRange('date', dateRange.start, dateRange.end);
4823
4922
  const currentPeriod = plainToClass(LogbookPeriod, {
4824
- from: dateRange.from,
4825
- to: dateRange.to,
4923
+ from: dateRange.start,
4924
+ to: dateRange.end,
4826
4925
  kilometers: logbooksInRange.getClaimableLogbooks().kilometers,
4827
4926
  workUsage: logbooksInRange.getWorkUsage(),
4828
4927
  logbooks: logbooksInRange
@@ -4856,28 +4955,15 @@ class VehicleLogbookCollection extends Collection {
4856
4955
  const workKilometers = this.getClaimableLogbooks().kilometers;
4857
4956
  return Math.round(workKilometers / this.kilometers * 100);
4858
4957
  }
4859
- /**
4860
- * Get LOGBOOK_PERIOD_DURATION date range from passed start date
4861
- * @TODO Vik: Best period: move this and related logic to backend
4862
- */
4863
- getPeriodRange(from) {
4864
- // set end date as VehicleLogbook.periodDuration after start date
4865
- let to = new Date(from.getTime() + VehicleLogbook.periodDuration);
4866
- const financialYear = new FinancialYear();
4867
- // set as period last VehicleLogbook.periodDuration of current year if period end date after end of current year
4868
- if (to > financialYear.endDate) {
4869
- to = financialYear.endDate;
4870
- from = new Date(to.getTime() - VehicleLogbook.periodDuration);
4871
- }
4872
- return { from, to };
4873
- }
4874
4958
  /**
4875
4959
  * Get list of logbooks related to passed vehicle claim
4876
4960
  */
4877
- getByVehicleClaim(claim) {
4878
- return claim.isWorkTank()
4879
- ? this.filterBy('tankType', TankTypeEnum.WORK)
4880
- : this.filterBy('business.id', claim.business.id);
4961
+ getByVehicleClaim(vehicleClaim) {
4962
+ return vehicleClaim.isSoleTank()
4963
+ // sole tank may have multiple vehicle claims, so we need to filter by business.id
4964
+ ? this.filterBy('business.id', vehicleClaim.business.id)
4965
+ // work tank may have only one vehicle claim, so we need to filter by tank type
4966
+ : this.filterBy('tankType', TankTypeEnum.WORK);
4881
4967
  }
4882
4968
  }
4883
4969
 
@@ -5011,9 +5097,9 @@ class BankTransactionCollection extends Collection {
5011
5097
 
5012
5098
  class ChartAccountsCollection extends Collection {
5013
5099
  /**
5014
- * Get 'Klms travelled for work' related chart account value
5100
+ * Get 'Kms travelled for work' related chart account value
5015
5101
  */
5016
- getVehicleKlmsRate(year = new FinancialYear().year) {
5102
+ getVehicleKmsRate(year = new FinancialYear().year) {
5017
5103
  return this.findBy('id', ChartAccountsListEnum.KLMS_TRAVELLED_FOR_WORK).getValueByYear(year).value;
5018
5104
  }
5019
5105
  }
@@ -5271,6 +5357,9 @@ class TransactionCollection extends ExportableCollection {
5271
5357
  * Get list of vehicle transactions filtered by vehicle claim
5272
5358
  */
5273
5359
  getByVehicleClaim(vehicleClaim) {
5360
+ if (!vehicleClaim) {
5361
+ return this.create([]);
5362
+ }
5274
5363
  return vehicleClaim.isSoleTank()
5275
5364
  // sole tank may have multiple vehicle claims, so we need to filter by business.id
5276
5365
  ? this.getVehicleTransactions().filterBy('business.id', vehicleClaim.business.id)
@@ -5278,7 +5367,7 @@ class TransactionCollection extends ExportableCollection {
5278
5367
  : this.getVehicleTransactions().filterBy('tankType', TankTypeEnum.WORK);
5279
5368
  }
5280
5369
  /**
5281
- * Get list of vehicle transactions except KLMS transactions
5370
+ * Get list of vehicle transactions except KMS transactions
5282
5371
  */
5283
5372
  getLogbookTransactions() {
5284
5373
  return this
@@ -8101,7 +8190,7 @@ class MyTaxDeductions {
8101
8190
  return 0;
8102
8191
  }
8103
8192
  setVehicleClaimData() {
8104
- this.klmsMethodClaimAmount = this.vehicleClaim.getKLMsClaimAmount(this.vehicleClaimRate);
8193
+ this.klmsMethodClaimAmount = this.vehicleClaim.getKMSClaimAmount(this.vehicleClaimRate);
8105
8194
  this.totalExpensesAmount = this.vehicleClaim.getLogbookClaimAmount(new TransactionCollection([
8106
8195
  ...this.transactions.getByTankType(this.vehicleClaim.tankType),
8107
8196
  ...this.depreciations.getByTankType(this.vehicleClaim.tankType).toTransactions().toArray()
@@ -8945,6 +9034,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
8945
9034
  args: ['environment']
8946
9035
  }] }]; } });
8947
9036
 
9037
+ class SoleInvoiceService extends RestService {
9038
+ constructor() {
9039
+ super(...arguments);
9040
+ this.modelClass = SoleInvoice;
9041
+ this.url = 'sole-invoices';
9042
+ this.isHydra = true;
9043
+ }
9044
+ }
9045
+ SoleInvoiceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleInvoiceService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
9046
+ SoleInvoiceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleInvoiceService, providedIn: 'root' });
9047
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: SoleInvoiceService, decorators: [{
9048
+ type: Injectable,
9049
+ args: [{
9050
+ providedIn: 'root'
9051
+ }]
9052
+ }] });
9053
+
8948
9054
  class SoleInvoiceTemplateService extends RestService {
8949
9055
  constructor() {
8950
9056
  super(...arguments);
@@ -9008,10 +9114,7 @@ class VehicleClaimService extends RestService {
9008
9114
  * when details method changed, all claims current values become 0
9009
9115
  */
9010
9116
  listenVehicleClaimDetailsChanges() {
9011
- this.eventDispatcherService.on([
9012
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_CREATED,
9013
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED
9014
- ])
9117
+ this.eventDispatcherService.on(AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED)
9015
9118
  .subscribe(() => {
9016
9119
  this.resetCache();
9017
9120
  });
@@ -9036,14 +9139,17 @@ class VehicleClaimService extends RestService {
9036
9139
  * @TODO Vik: Best period move this and related logic to backend
9037
9140
  */
9038
9141
  updateWorkUsage(bestPeriod) {
9039
- // We are sure this.cache exist here because logbook best period calculation is based on vehicle claims,
9040
- // so before we can get logbook best period changes, we must get vehicle claims
9142
+ // no need to update if cache not exist
9143
+ if (!this.cache) {
9144
+ return;
9145
+ }
9146
+ // @TODO Vik (TT-2210): need batch endpoint for this update
9147
+ // @TODO Alex (TT-2210): fix frontend when endpoint ready
9041
9148
  const batch$ = this.cache.map((claim) => {
9042
9149
  const claimToUpdate = plainToClass(VehicleClaim, Object.assign({}, claim, { workUsage: bestPeriod === null || bestPeriod === void 0 ? void 0 : bestPeriod.getWorkUsageByClaim(claim) }));
9043
9150
  return this.update(claimToUpdate);
9044
9151
  });
9045
- // take(1) is using to avoid unnecessary callback calling whe user updated details directly
9046
- combineLatest(batch$).pipe(take(1)).subscribe();
9152
+ combineLatest(batch$).subscribe();
9047
9153
  }
9048
9154
  }
9049
9155
  VehicleClaimService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: VehicleClaimService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
@@ -9117,11 +9223,12 @@ class VehicleClaimDetailsService {
9117
9223
  * @TODO Vik: Best period move this and related logic to backend
9118
9224
  */
9119
9225
  updateToManual() {
9120
- // We are sure this.cache exist here because logbook best period calculation is based on vehicle claim details,
9121
- // so before we can get logbook best period changes, we must get vehicle claim details
9226
+ // no need to update if cache not exist
9227
+ if (!this.cache) {
9228
+ return;
9229
+ }
9122
9230
  const vehicleClaimDetails = plainToClass(VehicleClaimDetails, Object.assign({}, this.cache, { isManual: true }));
9123
- // take(1) is using to avoid unnecessary callback calling whe user updated details directly
9124
- this.update(vehicleClaimDetails).pipe(take(1)).subscribe();
9231
+ this.update(vehicleClaimDetails).subscribe();
9125
9232
  }
9126
9233
  }
9127
9234
  VehicleClaimDetailsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: VehicleClaimDetailsService, deps: [{ token: 'environment' }, { token: i1.HttpClient }, { token: EventDispatcherService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -9272,6 +9379,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
9272
9379
  }]
9273
9380
  }] });
9274
9381
 
9382
+ /**
9383
+ * Service to work with Rewardful (affiliate program) API
9384
+ * https://developers.rewardful.com/javascript-api/overview#executing-code-when-rewardful-loads
9385
+ */
9386
+ class RewardfulService {
9387
+ constructor(environment) {
9388
+ this.environment = environment;
9389
+ }
9390
+ getReferralCode() {
9391
+ return new Observable((observer) => {
9392
+ if (!this.environment.rewardfulId) {
9393
+ return observer.next(null);
9394
+ }
9395
+ window['rewardful']('ready', () => {
9396
+ observer.next(window['Rewardful'].referral);
9397
+ });
9398
+ });
9399
+ }
9400
+ }
9401
+ RewardfulService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RewardfulService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
9402
+ RewardfulService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RewardfulService, providedIn: 'root' });
9403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: RewardfulService, decorators: [{
9404
+ type: Injectable,
9405
+ args: [{
9406
+ providedIn: 'root'
9407
+ }]
9408
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
9409
+ type: Inject,
9410
+ args: ['environment']
9411
+ }] }]; } });
9412
+
9275
9413
  /**
9276
9414
  * Service for logbook best period calculation
9277
9415
  * @TODO Vik: improve structure for such cases (TT-2043)
@@ -9381,7 +9519,7 @@ const ACCOUNT_SETUP_ITEMS = {
9381
9519
  }),
9382
9520
  [AccountSetupItemsEnum.WORK_LOGBOOK]: plainToClass(AccountSetupItem, {
9383
9521
  title: 'Set up your logbook method',
9384
- description: 'Do you use your vehicle for work? Select your method and the klms or logbook % to automate accurately all vehicle expenses throughout the year.',
9522
+ description: 'Do you use your vehicle for work? Select your method and the kms or logbook % to automate accurately all vehicle expenses throughout the year.',
9385
9523
  url: '/client/work-tank/logbook',
9386
9524
  urlFragment: 'productTour'
9387
9525
  }),
@@ -10257,7 +10395,6 @@ class TransactionService extends RestService {
10257
10395
  this.eventDispatcherService.on([
10258
10396
  AppEventTypeEnum.VEHICLE_CLAIM_CREATED,
10259
10397
  AppEventTypeEnum.VEHICLE_CLAIM_UPDATED,
10260
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_CREATED,
10261
10398
  AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED
10262
10399
  ]).subscribe(() => {
10263
10400
  this.resetCache();
@@ -10361,7 +10498,7 @@ class AccountSetupService {
10361
10498
  }
10362
10499
  // Bank feeds item is completed when user added at least one bank account (basiq or manual)
10363
10500
  batch.push(this.create(AccountSetupItemsEnum.BANK_FEEDS, this.bankAccountsService.get()));
10364
- // Logbook item is completed when user has at least one vehicle claim with any method (klms or logbook)
10501
+ // Logbook item is completed when user has at least one vehicle claim with any method (kms or logbook)
10365
10502
  batch.push(this.getLogbookItem());
10366
10503
  // @TODO waiting for sole tank forecast page
10367
10504
  // Sole item is completed when user added at least one sole income source
@@ -11501,7 +11638,6 @@ class DepreciationService extends RestService {
11501
11638
  this.eventDispatcherService.on([
11502
11639
  AppEventTypeEnum.VEHICLE_CLAIM_CREATED,
11503
11640
  AppEventTypeEnum.VEHICLE_CLAIM_UPDATED,
11504
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_CREATED,
11505
11641
  AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED
11506
11642
  ]).subscribe(() => {
11507
11643
  this.resetCache();
@@ -13791,7 +13927,7 @@ function taxReviewFilterPredicate(data, filter) {
13791
13927
  /**
13792
13928
  * Abstract form class
13793
13929
  * @TODO rename to AbstractFormGroup
13794
- * @TODO Alex: refactor: check and improve logic
13930
+ * @TODO Alex TT-2190: refactor: check and improve logic
13795
13931
  */
13796
13932
  class AbstractForm extends FormGroup {
13797
13933
  constructor(controls, model, validatorOrOpts, asyncValidator) {
@@ -13807,13 +13943,14 @@ class AbstractForm extends FormGroup {
13807
13943
  if (model && !model['id']) {
13808
13944
  this.markAsUnsaved();
13809
13945
  }
13810
- this.valueChanges.subscribe(() => {
13811
- !!model && !!model['id'] && isEqual(this.value, this.initialValue) ? this.markAsSaved() : this.markAsUnsaved();
13812
- });
13946
+ this.listenValueChanges();
13813
13947
  }
13814
13948
  get saved() {
13815
13949
  return !this.unsaved;
13816
13950
  }
13951
+ get currentValue() {
13952
+ return this.createModelInstance(Object.assign({}, this.model, this.getRawValue()));
13953
+ }
13817
13954
  /**
13818
13955
  * Check validation and return a new instance of generic model.
13819
13956
  * Merge form value to initial object
@@ -13842,6 +13979,11 @@ class AbstractForm extends FormGroup {
13842
13979
  createModelInstance(data = {}) {
13843
13980
  return plainToClass(this.modelClass, data);
13844
13981
  }
13982
+ listenValueChanges() {
13983
+ this.valueChanges.subscribe(() => {
13984
+ !!this.model && !!this.model['id'] && isEqual(this.value, this.initialValue) ? this.markAsSaved() : this.markAsUnsaved();
13985
+ });
13986
+ }
13845
13987
  }
13846
13988
 
13847
13989
  /**
@@ -14121,6 +14263,7 @@ class SoleBusinessForm extends AbstractForm {
14121
14263
  /**
14122
14264
  * Form array with bank account business allocations
14123
14265
  * @TODO create AbstractFormArray
14266
+ * @TODO Alex/Vik (TT-2184): copypasted from bank-account-properties.form, improve logic and create common parent class maybe
14124
14267
  */
14125
14268
  class SoleBusinessAllocationsForm extends FormArray {
14126
14269
  constructor(businessAllocations) {
@@ -14211,14 +14354,103 @@ class SoleDetailsForm extends AbstractForm {
14211
14354
  }
14212
14355
  }
14213
14356
 
14357
+ class SoleInvoiceItemForm extends AbstractForm {
14358
+ constructor(item) {
14359
+ var _a;
14360
+ super({
14361
+ description: new FormControl(item.description, Validators.required),
14362
+ quantity: new FormControl(item.quantity, Validators.required),
14363
+ price: new FormControl(item.price, Validators.required),
14364
+ isGST: new FormControl({ value: item.isGST, disabled: !((_a = item.chartAccounts) === null || _a === void 0 ? void 0 : _a.isGST) }),
14365
+ chartAccounts: new FormControl(item.chartAccounts, Validators.required)
14366
+ }, item);
14367
+ this.listenEvents();
14368
+ }
14369
+ listenEvents() {
14370
+ this.listenChartAccountsChanges();
14371
+ }
14372
+ onTemplateChanged(template) {
14373
+ this.template = template;
14374
+ if (this.template.isNoTax()) {
14375
+ this.get('isGST').setValue(false);
14376
+ this.get('isGST').disable();
14377
+ }
14378
+ else {
14379
+ this.get('isGST').enable();
14380
+ }
14381
+ }
14382
+ listenChartAccountsChanges() {
14383
+ this.get('chartAccounts').valueChanges.subscribe((chartAccounts) => {
14384
+ if (this.template.isNoTax()) {
14385
+ return;
14386
+ }
14387
+ if (chartAccounts.isGST) {
14388
+ this.get('isGST').enable();
14389
+ }
14390
+ else {
14391
+ this.get('isGST').setValue(false);
14392
+ this.get('isGST').disable();
14393
+ }
14394
+ });
14395
+ }
14396
+ }
14397
+
14398
+ class SoleInvoiceForm extends AbstractForm {
14399
+ constructor(invoice) {
14400
+ super({
14401
+ dateFrom: new FormControl(invoice.dateFrom, Validators.required),
14402
+ dateTo: new FormControl(invoice.dateTo, Validators.required),
14403
+ items: new FormArray(invoice.items.map((item) => new SoleInvoiceItemForm(item))),
14404
+ payer: new FormControl(invoice.payer, Validators.required),
14405
+ template: new FormControl(invoice.template, Validators.required)
14406
+ }, invoice);
14407
+ if (invoice.id) {
14408
+ this.updateItemsForm(invoice.template);
14409
+ }
14410
+ this.listenEvents();
14411
+ }
14412
+ get items() {
14413
+ return this.get('items');
14414
+ }
14415
+ listenEvents() {
14416
+ this.listenTemplateChanges();
14417
+ }
14418
+ addItem() {
14419
+ this.items.push(new SoleInvoiceItemForm(plainToClass(SoleInvoiceItem, {})));
14420
+ }
14421
+ removeItem(index) {
14422
+ // do not remove the last item
14423
+ if (this.items.length === 1) {
14424
+ return;
14425
+ }
14426
+ this.items.removeAt(index);
14427
+ }
14428
+ submit(data = {}) {
14429
+ const items = this.items.controls.map((control) => control.submit());
14430
+ return super.submit(Object.assign({}, data, { items }));
14431
+ }
14432
+ listenTemplateChanges() {
14433
+ this.get('template').valueChanges.subscribe((template) => {
14434
+ this.updateItemsForm(template);
14435
+ });
14436
+ }
14437
+ updateItemsForm(template) {
14438
+ this.items.controls.forEach((itemForm) => {
14439
+ itemForm.onTemplateChanged(template);
14440
+ });
14441
+ }
14442
+ }
14443
+
14214
14444
  class SoleInvoiceTemplateForm extends AbstractForm {
14215
- constructor(invoiceTemplate) {
14445
+ constructor(invoiceTemplate, soleDetails) {
14216
14446
  super({
14217
14447
  name: new FormControl(invoiceTemplate.name, Validators.required),
14218
- isTaxIncluded: new FormControl(invoiceTemplate.isTaxIncluded),
14448
+ // taxType always 'No Tax' when sole details are not GST registered
14449
+ taxType: new FormControl({ value: invoiceTemplate.taxType, disabled: !soleDetails.isGST }, Validators.required),
14219
14450
  term: new FormControl(invoiceTemplate.term, [Validators.required, Validators.min(0)]),
14220
- bankAccount: new FormControl(invoiceTemplate.bankAccount)
14451
+ bankAccount: new FormControl(invoiceTemplate.bankAccount, [Validators.required])
14221
14452
  }, invoiceTemplate);
14453
+ this.soleDetails = soleDetails;
14222
14454
  }
14223
14455
  }
14224
14456
 
@@ -14234,9 +14466,12 @@ class BankAccountAllocationForm extends AbstractForm {
14234
14466
  if (bankAccount === null || bankAccount === void 0 ? void 0 : bankAccount.isSoleTank()) {
14235
14467
  this.addControl('businessAllocations', new SoleBusinessAllocationsForm(bankAccount.businessAllocations));
14236
14468
  }
14237
- this.watchTankType();
14469
+ this.listenEvents();
14470
+ }
14471
+ listenEvents() {
14472
+ this.listenTankTypeChanges();
14238
14473
  }
14239
- watchTankType() {
14474
+ listenTankTypeChanges() {
14240
14475
  this.get('tankType').valueChanges.subscribe((tankType) => {
14241
14476
  var _a, _b;
14242
14477
  this.removeControl('bankAccountProperties');
@@ -14278,14 +14513,10 @@ class BankAccountAddManualForm extends BankAccountAllocationForm {
14278
14513
  constructor(connection) {
14279
14514
  super();
14280
14515
  this.connection = connection;
14281
- this
14282
- .addControl('type', new FormControl(null, Validators.required))
14283
- .addControl('accountName', new FormControl(null, Validators.required))
14284
- .addControl('currentBalance', new FormControl(null, Validators.required))
14285
- .addControl('accountNumber', new FormControl(null, [Validators.required, Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]));
14286
- this.listenEvents();
14287
- }
14288
- listenEvents() {
14516
+ this.addControl('type', new FormControl(null, Validators.required));
14517
+ this.addControl('accountName', new FormControl(null, Validators.required));
14518
+ this.addControl('currentBalance', new FormControl(null, Validators.required));
14519
+ this.addControl('accountNumber', new FormControl(null, [Validators.required, Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]));
14289
14520
  this.listenTypeChanges();
14290
14521
  }
14291
14522
  /**
@@ -14897,9 +15128,14 @@ class VehicleClaimForm extends AbstractForm {
14897
15128
  }),
14898
15129
  workUsage: new FormControl({
14899
15130
  value: vehicleClaim.workUsage,
14900
- disabled: !details.isManual || details.isKlmsMethod()
15131
+ disabled: !details.isManual || details.isKmsMethod()
14901
15132
  })
14902
15133
  }, vehicleClaim);
15134
+ this.vehicleClaim = vehicleClaim;
15135
+ this.details = details;
15136
+ }
15137
+ getAverageWeeklyKMS() {
15138
+ return this.get('kilometers').value / FinancialYear.weeksInYear;
14903
15139
  }
14904
15140
  }
14905
15141
 
@@ -14907,16 +15143,12 @@ class VehicleClaimForm extends AbstractForm {
14907
15143
  * Add/Edit vehicle claim details form
14908
15144
  */
14909
15145
  class VehicleClaimDetailsForm extends AbstractForm {
14910
- /**
14911
- * @param vehicleClaimDetails required because we create a new details with prefilled data (like Financial year)
14912
- * @param logbooks required for isManual field disabled state management
14913
- */
14914
- constructor(vehicleClaimDetails, logbooks) {
15146
+ constructor(vehicleClaimDetails, isBestPeriodExist) {
14915
15147
  super({
14916
15148
  method: new FormControl(vehicleClaimDetails.method, Validators.required),
14917
15149
  isManual: new FormControl({
14918
15150
  value: vehicleClaimDetails.isManual,
14919
- disabled: !logbooks.isBestPeriodExist()
15151
+ disabled: !isBestPeriodExist
14920
15152
  }),
14921
15153
  }, vehicleClaimDetails);
14922
15154
  }
@@ -14941,30 +15173,38 @@ class VehicleLogbookForm extends AbstractForm {
14941
15173
  date: new FormControl(logbook.date, Validators.required),
14942
15174
  odometerStart: new FormControl(logbook.odometerStart, Validators.required),
14943
15175
  odometerEnd: new FormControl(logbook.odometerEnd, Validators.required),
14944
- business: new FormControl(logbook.business),
14945
- // @TODO Alex: remove when backend fixed
14946
- purpose: new FormControl(VehicleLogbookPurposeEnum.BUSINESS)
15176
+ business: new FormControl(logbook.business)
14947
15177
  }, logbook);
14948
15178
  this.logbook = logbook;
14949
15179
  this.logbooks = logbooks;
15180
+ this.updateStateAndValidators();
15181
+ }
15182
+ /**
15183
+ * Set logbook validators and disable state depends of initial logbook and its place in the whole list
15184
+ */
15185
+ updateStateAndValidators() {
14950
15186
  switch (true) {
14951
15187
  // Create the first or edit the single logbook
14952
- case !logbook.id && !logbooks.length:
14953
- case !!logbook.id && logbooks.length === 1:
15188
+ case !this.logbook.id && !this.logbooks.length:
15189
+ case !!this.logbook.id && this.logbooks.length === 1:
14954
15190
  this.get('odometerStart').setValidators(Validators.min(0));
14955
15191
  this.get('date').setValidators(dateRangeValidator(new FinancialYear().startDate, new FinancialYear().endDate));
14956
15192
  break;
14957
- // Create the non-first or edit the last logbook
14958
- case !logbook.id && !!logbooks.length:
14959
- case !!logbook.id && logbook.id === logbooks.last.id && logbooks.length > 1:
15193
+ // Create the non-first
15194
+ case !this.logbook.id && !!this.logbooks.length:
14960
15195
  this.get('odometerStart').disable();
14961
- this.get('odometerEnd').setValidators(Validators.min(logbooks.last.odometerEnd));
14962
- if (!!logbook.id) {
14963
- }
14964
- this.get('date').setValidators(dateRangeValidator(logbooks.last.date, new FinancialYear().endDate));
15196
+ this.get('odometerEnd').setValidators(Validators.min(this.logbooks.last.odometerEnd));
15197
+ this.get('date').setValidators(dateRangeValidator(this.logbooks.last.date, new FinancialYear().endDate));
15198
+ break;
15199
+ // Edit the last logbook
15200
+ case !!this.logbook.id && this.logbook.id === this.logbooks.last.id && this.logbooks.length > 1:
15201
+ this.get('odometerStart').disable();
15202
+ this.get('odometerEnd').setValidators(Validators.min(this.logbooks.last.odometerEnd));
15203
+ const preLastDate = this.logbooks.toArray()[this.logbooks.length - 1].date;
15204
+ this.get('date').setValidators(dateRangeValidator(preLastDate, new FinancialYear().endDate));
14965
15205
  break;
14966
15206
  // Edit the non-last logbook
14967
- case !!logbook.id && logbook.id !== logbooks.last.id && logbooks.length > 1:
15207
+ case !!this.logbook.id && this.logbook.id !== this.logbooks.last.id && this.logbooks.length > 1:
14968
15208
  this.get('odometerStart').disable();
14969
15209
  this.get('odometerEnd').disable();
14970
15210
  this.get('date').disable();
@@ -14979,5 +15219,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
14979
15219
  * Generated bundle index. Do not edit.
14980
15220
  */
14981
15221
 
14982
- export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressService, AddressTypeEnum, AlphabetColorsEnum, AppEvent, AppEventTypeEnum, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankLoginData, BankLoginForm, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqConfig, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartData, ChartSerie, Chat, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientIncomeTypes, ClientIncomeTypesForm, ClientIncomeTypesService, ClientInvite, ClientInviteCollection, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, DEDUCTION_CATEGORIES, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DeductionClothingTypeEnum, DeductionSelfEducationTypeEnum, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCapitalProjectService, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, DepreciationLvpReportItem, DepreciationLvpReportItemCollection, DepreciationReceipt, DepreciationReceiptService, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JwtService, KompassifyService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, LoginForm, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessOrLosses, MyTaxBusinessOrLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEmployeeShareSchemes, MyTaxEmployeeShareSchemesForm, MyTaxEstimate, MyTaxIncomeStatements, MyTaxIncomeStatementsForm, MyTaxIncomeTests, MyTaxIncomeTestsForm, MyTaxInterest, MyTaxInterestForm, MyTaxLosses, MyTaxLossesForm, MyTaxMedicareForm, MyTaxOffsets, MyTaxOffsetsForm, MyTaxOtherIncome, MyTaxOtherIncomeForm, MyTaxPartnershipsAndTrusts, MyTaxPartnershipsAndTrustsForm, MyTaxRent, MyTaxRentForm, Notification, Occupation, OccupationService, PASSWORD_REGEXPS, PasswordForm, PdfFromDataTableService, PdfFromDomElementService, PdfFromHtmlTableService, PdfOrientationEnum, PdfSettings, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductIdEnum, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceItem, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionEnum, TaxExemptionMetadata, TaxExemptionMetadataEnum, TaxExemptionService, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserInviteForm, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleService, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
15222
+ export { AbstractForm, AbstractModel, AccountSetupItem, AccountSetupItemCollection, AccountSetupService, Address, AddressService, AddressTypeEnum, AlphabetColorsEnum, AppEvent, AppEventTypeEnum, AssetEntityTypeEnum, AssetTypeEnum, AssetsService, AuthService, BANK_ACCOUNT_TYPES, Badge, BadgeColorEnum, Bank, BankAccount, BankAccountAddManualForm, BankAccountAllocationForm, BankAccountCalculationService, BankAccountChartData, BankAccountCollection, BankAccountImportForm, BankAccountPropertiesForm, BankAccountProperty, BankAccountService, BankAccountStatusEnum, BankAccountTypeEnum, BankAccountsImportForm, BankConnection, BankConnectionService, BankConnectionStatusEnum, BankLoginData, BankLoginForm, BankService, BankTransaction, BankTransactionCalculationService, BankTransactionChartData, BankTransactionCollection, BankTransactionService, BankTransactionSummaryFieldsEnum, BankTransactionTypeEnum, BasiqConfig, BasiqJob, BasiqService, BasiqToken, BorrowingExpense, BorrowingExpenseLoan, BorrowingExpenseService, CAPITAL_COSTS_ITEMS, CHART_ACCOUNTS_CATEGORIES, CalculationFormItem, CalculationFormTypeEnum, CgtExemptionAndRolloverCodeEnum, ChartAccounts, ChartAccountsCategoryECollection, ChartAccountsCategoryEnum, ChartAccountsCollection, ChartAccountsDepreciation, ChartAccountsDepreciationService, ChartAccountsEtpEnum, ChartAccountsHeading, ChartAccountsHeadingListEnum, ChartAccountsHeadingTaxDeductibleEnum, ChartAccountsHeadingTaxableEnum, ChartAccountsHeadingVehicleListEnum, ChartAccountsListEnum, ChartAccountsMetadata, ChartAccountsMetadataListEnum, ChartAccountsMetadataTypeEnum, ChartAccountsService, ChartAccountsTaxLabelsEnum, ChartAccountsTypeEnum, ChartAccountsValue, ChartData, ChartSerie, Chat, ChatService, ChatStatusEnum, ChatViewTypeEnum, ClientCollection, ClientDetails, ClientDetailsMedicareExemptionEnum, ClientDetailsWorkDepreciationCalculationEnum, ClientDetailsWorkingHolidayMakerEnum, ClientIncomeTypes, ClientIncomeTypesForm, ClientIncomeTypesService, ClientInvite, ClientInviteCollection, ClientInviteService, ClientInviteStatusEnum, ClientInviteTypeEnum, ClientMovement, ClientMovementCollection, ClientMovementService, ClientPortfolioChartData, ClientPortfolioReport, ClientPortfolioReportCollection, ClientPortfolioReportService, Collection, CollectionDictionary, CorelogicService, CorelogicSuggestion, Country, DEDUCTION_CATEGORIES, DEPRECIATION_GROUPS, DOCUMENT_FILE_TYPES, DeductionClothingTypeEnum, DeductionSelfEducationTypeEnum, Depreciation, DepreciationCalculationEnum, DepreciationCalculationPercentEnum, DepreciationCapitalProject, DepreciationCapitalProjectService, DepreciationCollection, DepreciationForecast, DepreciationForecastCollection, DepreciationGroup, DepreciationGroupEnum, DepreciationGroupItem, DepreciationLvpAssetTypeEnum, DepreciationLvpReportItem, DepreciationLvpReportItemCollection, DepreciationReceipt, DepreciationReceiptService, DepreciationReportItem, DepreciationReportItemCollection, DepreciationService, DepreciationTypeEnum, DepreciationWriteOffAmountEnum, Dictionary, Document, DocumentApiUrlPrefixEnum, DocumentFolder, DocumentFolderService, ENDPOINTS, EmployeeCollection, EmployeeDetails, EmployeeInvite, EmployeeInviteService, EmployeeService, Endpoint, EquityPositionChartService, EventDispatcherService, ExportDataTable, ExportFormatEnum, ExportFormatterService, ExportableCollection, FacebookService, FinancialYear, Firm, FirmService, FirmTypeEnum, HeaderTitleService, IconsFileEnum, IncomeAmountTypeEnum, IncomePosition, IncomeSource, IncomeSourceChartData, IncomeSourceCollection, IncomeSourceForecast, IncomeSourceForecastService, IncomeSourceForecastTrustTypeEnum, IncomeSourceService, IncomeSourceType, IncomeSourceTypeEnum, IncomeSourceTypeListOtherEnum, IncomeSourceTypeListSoleEnum, IncomeSourceTypeListWorkEnum, InterceptorsModule, IntercomService, InviteStatusEnum, JwtService, KompassifyService, Loan, LoanBankTypeEnum, LoanCollection, LoanForm, LoanFrequencyEnum, LoanInterestTypeEnum, LoanMaxNumberOfPaymentsEnum, LoanPayment, LoanPaymentCollection, LoanPayout, LoanPayoutTypeEnum, LoanRepaymentFrequencyEnum, LoanRepaymentTypeEnum, LoanService, LoanTypeEnum, LoanVehicleTypeEnum, LogbookBestPeriodService, LogbookPeriod, LoginForm, MODULE_URL_LIST, MONTHS, Message, MessageCollection, MessageDocument, MessageDocumentCollection, MessageDocumentService, MessageService, MonthNameShortEnum, MonthNumberEnum, MyAccountHistory, MyAccountHistoryInitiatedByEnum, MyAccountHistoryStatusEnum, MyAccountHistoryTypeEnum, MyTaxBusinessOrLosses, MyTaxBusinessOrLossesForm, MyTaxCgt, MyTaxCgtForm, MyTaxDeductions, MyTaxDeductionsForm, MyTaxDividends, MyTaxDividendsForm, MyTaxEmployeeShareSchemes, MyTaxEmployeeShareSchemesForm, MyTaxEstimate, MyTaxIncomeStatements, MyTaxIncomeStatementsForm, MyTaxIncomeTests, MyTaxIncomeTestsForm, MyTaxInterest, MyTaxInterestForm, MyTaxLosses, MyTaxLossesForm, MyTaxMedicareForm, MyTaxOffsets, MyTaxOffsetsForm, MyTaxOtherIncome, MyTaxOtherIncomeForm, MyTaxPartnershipsAndTrusts, MyTaxPartnershipsAndTrustsForm, MyTaxRent, MyTaxRentForm, Notification, Occupation, OccupationService, PASSWORD_REGEXPS, PasswordForm, PdfFromDataTableService, PdfFromDomElementService, PdfFromHtmlTableService, PdfOrientationEnum, PdfSettings, Phone, PhoneTypeEnum, PreloaderService, Property, PropertyCalculationService, PropertyCategory, PropertyCategoryListEnum, PropertyCategoryMovement, PropertyCategoryMovementService, PropertyCategoryService, PropertyCollection, PropertyDepreciationCalculationEnum, PropertyDocument, PropertyDocumentService, PropertyEquityChartData, PropertyEquityChartItem, PropertyForecast, PropertyReportItem, PropertyReportItemCollection, PropertyReportItemDepreciationCollection, PropertyReportItemTransaction, PropertyReportItemTransactionCollection, PropertySale, PropertySaleCollection, PropertySaleService, PropertySaleTaxExemptionMetadata, PropertyService, PropertyShare, PropertyShareAccessEnum, PropertyShareService, PropertyShareStatusEnum, PropertySubscription, PropertyTransactionReportService, PropertyValuation, RegisterClientForm, RegisterFirmForm, RegistrationInvite, RegistrationInviteStatusEnum, ReportItem, ReportItemCollection, ReportItemDetails, ResetPasswordForm, RewardfulService, SUBSCRIPTION_DESCRIPTION, SUBSCRIPTION_TITLE, SalaryForecast, SalaryForecastFrequencyEnum, SalaryForecastService, ServiceNotificationService, ServiceNotificationStatusEnum, ServiceNotificationTypeEnum, ServicePayment, ServicePaymentStatusEnum, ServicePrice, ServicePriceRecurringIntervalEnum, ServicePriceService, ServicePriceTypeEnum, ServiceProduct, ServiceProductIdEnum, ServiceProductStatusEnum, ServiceSubscription, ServiceSubscriptionCollection, ServiceSubscriptionItem, ServiceSubscriptionStatusEnum, ShareFilterOptionsEnum, SoleBusiness, SoleBusinessActivity, SoleBusinessActivityService, SoleBusinessAllocation, SoleBusinessAllocationsForm, SoleBusinessForm, SoleBusinessLoss, SoleBusinessService, SoleContact, SoleContactForm, SoleContactService, SoleDepreciationMethod, SoleDepreciationMethodEnum, SoleDepreciationMethodForm, SoleDepreciationMethodService, SoleDetails, SoleDetailsForm, SoleDetailsService, SoleForecast, SoleForecastService, SoleInvoice, SoleInvoiceForm, SoleInvoiceItem, SoleInvoiceItemForm, SoleInvoiceService, SoleInvoiceStatusesEnum, SoleInvoiceTemplate, SoleInvoiceTemplateForm, SoleInvoiceTemplateService, SoleInvoiceTemplateTaxTypeEnum, SpareDocumentSpareTypeEnum, SseService, SubscriptionService, SubscriptionTypeEnum, TAX_RETURN_CATEGORIES, TYPE_LOAN, TankTypeEnum, TaxCalculationMedicareExemptionEnum, TaxCalculationTypeEnum, TaxExemption, TaxExemptionEnum, TaxExemptionMetadata, TaxExemptionMetadataEnum, TaxExemptionService, TaxReturnCategoryListEnum, TaxReturnCategorySectionEnum, TaxReview, TaxReviewCollection, TaxReviewHistoryService, TaxReviewService, TaxReviewStatusEnum, TaxSummary, TaxSummaryListEnum, TaxSummarySection, TaxSummarySectionEnum, TaxSummaryService, TaxSummaryTaxSummaryEnum, TaxSummaryTypeEnum, TicketFeedbackEnum, TicketStatusEnum, TicketTypesEnum, Toast, ToastService, ToastTypeEnum, Transaction, TransactionAllocation, TransactionAllocationCollection, TransactionAllocationService, TransactionBase, TransactionCalculationService, TransactionCategoryEnum, TransactionCollection, TransactionMetadata, TransactionOperationEnum, TransactionReceipt, TransactionService, TransactionSourceEnum, TransactionTypeEnum, TtCoreModule, TutorialVideoService, USER_ROLES, USER_WORK_POSITION, User, UserEventSetting, UserEventSettingCollection, UserEventSettingFieldEnum, UserEventSettingService, UserEventStatusEnum, UserEventType, UserEventTypeCategory, UserEventTypeClientTypeEnum, UserEventTypeEmployeeTypeEnum, UserEventTypeFrequencyEnum, UserEventTypeService, UserEventTypeUserTypeEnum, UserInviteForm, UserMedicareExemptionEnum, UserRolesEnum, UserService, UserStatusEnum, UserSwitcherService, UserTitleEnum, UserToRegister, UserWorkDepreciationCalculationEnum, UserWorkingHolidayMakerEnum, UsersInviteService, Vehicle, VehicleClaim, VehicleClaimCollection, VehicleClaimDetails, VehicleClaimDetailsForm, VehicleClaimDetailsMethodEnum, VehicleClaimDetailsService, VehicleClaimForm, VehicleClaimService, VehicleExpense, VehicleExpenseCollection, VehicleForm, VehicleLogbook, VehicleLogbookCollection, VehicleLogbookForm, VehicleLogbookPurposeEnum, VehicleLogbookService, VehicleService, XlsxService, atLeastOneCheckedValidator, atoLinks, autocompleteValidator, cloneDeep, compare, compareMatOptions, conditionalValidator, createDate, displayMatOptions, enumToList, fieldsSumValidator, getDocIcon, minDateValidator, passwordMatchValidator, passwordValidator, replace, roundTo, sort, sortDeep, taxReviewFilterPredicate };
14983
15223
  //# sourceMappingURL=taxtank-core.js.map