taxtank-core 0.27.4 → 0.27.7

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 (85) hide show
  1. package/bundles/taxtank-core.umd.js +412 -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/forms/abstract.form.js +11 -5
  14. package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +6 -10
  15. package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +6 -3
  16. package/esm2015/lib/forms/sole/index.js +3 -1
  17. package/esm2015/lib/forms/sole/sole-business-allocations.form.js +2 -1
  18. package/esm2015/lib/forms/sole/sole-invoice-item.form.js +43 -0
  19. package/esm2015/lib/forms/sole/sole-invoice-template.form.js +6 -4
  20. package/esm2015/lib/forms/sole/sole-invoice.form.js +51 -0
  21. package/esm2015/lib/forms/vehicle/vehicle-claim-details.form.js +3 -7
  22. package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +8 -2
  23. package/esm2015/lib/forms/vehicle/vehicle-logbook.form.js +22 -15
  24. package/esm2015/lib/models/account-setup/account-setup-items.const.js +2 -2
  25. package/esm2015/lib/models/bank/bank-account.js +4 -1
  26. package/esm2015/lib/models/chart-accounts/chart-accounts.js +9 -9
  27. package/esm2015/lib/models/endpoint/endpoints.const.js +5 -1
  28. package/esm2015/lib/models/financial-year/financial-year.js +2 -1
  29. package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +2 -2
  30. package/esm2015/lib/models/sole/sole-details.js +3 -1
  31. package/esm2015/lib/models/sole/sole-invoice-item.js +8 -1
  32. package/esm2015/lib/models/sole/sole-invoice-template.js +15 -4
  33. package/esm2015/lib/models/sole/sole-invoice.js +55 -2
  34. package/esm2015/lib/models/transaction/transaction.js +3 -3
  35. package/esm2015/lib/models/vehicle/logbook-period.js +2 -1
  36. package/esm2015/lib/models/vehicle/vehicle-claim-details.js +12 -11
  37. package/esm2015/lib/models/vehicle/vehicle-claim.js +14 -13
  38. package/esm2015/lib/models/vehicle/vehicle-logbook.js +18 -5
  39. package/esm2015/lib/services/account-setup/account-setup.service.js +2 -2
  40. package/esm2015/lib/services/http/depreciation/depreciation.service.js +1 -2
  41. package/esm2015/lib/services/http/sole/index.js +2 -1
  42. package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +21 -0
  43. package/esm2015/lib/services/http/transaction/transaction.service.js +1 -2
  44. package/esm2015/lib/services/http/vehicle/vehicle-claim-details.service.js +7 -6
  45. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +10 -10
  46. package/esm2015/public-api.js +3 -1
  47. package/fesm2015/taxtank-core.js +347 -138
  48. package/fesm2015/taxtank-core.js.map +1 -1
  49. package/lib/collections/chart-accounts.collection.d.ts +2 -2
  50. package/lib/collections/transaction/transaction.collection.d.ts +2 -2
  51. package/lib/collections/vehicle/vehicle-claim.collection.d.ts +1 -3
  52. package/lib/collections/vehicle/vehicle-logbook.collection.d.ts +4 -9
  53. package/lib/db/Enums/depreciation-calculation.enum.d.ts +1 -0
  54. package/lib/db/Enums/sole-invoice-statuses.enum.d.ts +6 -0
  55. package/lib/db/Enums/sole-invoice-template-tax-type.enum.d.ts +5 -0
  56. package/lib/db/Models/chart-accounts/chart-accounts.d.ts +1 -0
  57. package/lib/db/Models/sole/sole-invoice-template.d.ts +2 -1
  58. package/lib/db/Models/sole/sole-invoice.d.ts +2 -1
  59. package/lib/forms/abstract.form.d.ts +3 -1
  60. package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +1 -3
  61. package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +4 -2
  62. package/lib/forms/sole/index.d.ts +2 -0
  63. package/lib/forms/sole/sole-business-allocations.form.d.ts +1 -0
  64. package/lib/forms/sole/sole-invoice-item.form.d.ts +10 -0
  65. package/lib/forms/sole/sole-invoice-template.form.d.ts +3 -2
  66. package/lib/forms/sole/sole-invoice.form.d.ts +14 -0
  67. package/lib/forms/vehicle/vehicle-claim-details.form.d.ts +1 -6
  68. package/lib/forms/vehicle/vehicle-claim.form.d.ts +3 -0
  69. package/lib/forms/vehicle/vehicle-logbook.form.d.ts +4 -0
  70. package/lib/models/bank/bank-account.d.ts +2 -0
  71. package/lib/models/chart-accounts/chart-accounts.d.ts +6 -6
  72. package/lib/models/financial-year/financial-year.d.ts +1 -0
  73. package/lib/models/sole/sole-details.d.ts +2 -0
  74. package/lib/models/sole/sole-invoice-item.d.ts +2 -0
  75. package/lib/models/sole/sole-invoice-template.d.ts +5 -1
  76. package/lib/models/sole/sole-invoice.d.ts +12 -0
  77. package/lib/models/transaction/transaction.d.ts +2 -2
  78. package/lib/models/vehicle/logbook-period.d.ts +1 -0
  79. package/lib/models/vehicle/vehicle-claim-details.d.ts +8 -2
  80. package/lib/models/vehicle/vehicle-claim.d.ts +6 -4
  81. package/lib/models/vehicle/vehicle-logbook.d.ts +8 -4
  82. package/lib/services/http/sole/index.d.ts +1 -0
  83. package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +11 -0
  84. package/package.json +1 -1
  85. package/public-api.d.ts +2 -0
@@ -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 });
@@ -9412,7 +9519,7 @@ const ACCOUNT_SETUP_ITEMS = {
9412
9519
  }),
9413
9520
  [AccountSetupItemsEnum.WORK_LOGBOOK]: plainToClass(AccountSetupItem, {
9414
9521
  title: 'Set up your logbook method',
9415
- 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.',
9416
9523
  url: '/client/work-tank/logbook',
9417
9524
  urlFragment: 'productTour'
9418
9525
  }),
@@ -10288,7 +10395,6 @@ class TransactionService extends RestService {
10288
10395
  this.eventDispatcherService.on([
10289
10396
  AppEventTypeEnum.VEHICLE_CLAIM_CREATED,
10290
10397
  AppEventTypeEnum.VEHICLE_CLAIM_UPDATED,
10291
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_CREATED,
10292
10398
  AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED
10293
10399
  ]).subscribe(() => {
10294
10400
  this.resetCache();
@@ -10392,7 +10498,7 @@ class AccountSetupService {
10392
10498
  }
10393
10499
  // Bank feeds item is completed when user added at least one bank account (basiq or manual)
10394
10500
  batch.push(this.create(AccountSetupItemsEnum.BANK_FEEDS, this.bankAccountsService.get()));
10395
- // 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)
10396
10502
  batch.push(this.getLogbookItem());
10397
10503
  // @TODO waiting for sole tank forecast page
10398
10504
  // Sole item is completed when user added at least one sole income source
@@ -11532,7 +11638,6 @@ class DepreciationService extends RestService {
11532
11638
  this.eventDispatcherService.on([
11533
11639
  AppEventTypeEnum.VEHICLE_CLAIM_CREATED,
11534
11640
  AppEventTypeEnum.VEHICLE_CLAIM_UPDATED,
11535
- AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_CREATED,
11536
11641
  AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED
11537
11642
  ]).subscribe(() => {
11538
11643
  this.resetCache();
@@ -13822,7 +13927,7 @@ function taxReviewFilterPredicate(data, filter) {
13822
13927
  /**
13823
13928
  * Abstract form class
13824
13929
  * @TODO rename to AbstractFormGroup
13825
- * @TODO Alex: refactor: check and improve logic
13930
+ * @TODO Alex TT-2190: refactor: check and improve logic
13826
13931
  */
13827
13932
  class AbstractForm extends FormGroup {
13828
13933
  constructor(controls, model, validatorOrOpts, asyncValidator) {
@@ -13838,13 +13943,14 @@ class AbstractForm extends FormGroup {
13838
13943
  if (model && !model['id']) {
13839
13944
  this.markAsUnsaved();
13840
13945
  }
13841
- this.valueChanges.subscribe(() => {
13842
- !!model && !!model['id'] && isEqual(this.value, this.initialValue) ? this.markAsSaved() : this.markAsUnsaved();
13843
- });
13946
+ this.listenValueChanges();
13844
13947
  }
13845
13948
  get saved() {
13846
13949
  return !this.unsaved;
13847
13950
  }
13951
+ get currentValue() {
13952
+ return this.createModelInstance(Object.assign({}, this.model, this.getRawValue()));
13953
+ }
13848
13954
  /**
13849
13955
  * Check validation and return a new instance of generic model.
13850
13956
  * Merge form value to initial object
@@ -13873,6 +13979,11 @@ class AbstractForm extends FormGroup {
13873
13979
  createModelInstance(data = {}) {
13874
13980
  return plainToClass(this.modelClass, data);
13875
13981
  }
13982
+ listenValueChanges() {
13983
+ this.valueChanges.subscribe(() => {
13984
+ !!this.model && !!this.model['id'] && isEqual(this.value, this.initialValue) ? this.markAsSaved() : this.markAsUnsaved();
13985
+ });
13986
+ }
13876
13987
  }
13877
13988
 
13878
13989
  /**
@@ -14152,6 +14263,7 @@ class SoleBusinessForm extends AbstractForm {
14152
14263
  /**
14153
14264
  * Form array with bank account business allocations
14154
14265
  * @TODO create AbstractFormArray
14266
+ * @TODO Alex/Vik (TT-2184): copypasted from bank-account-properties.form, improve logic and create common parent class maybe
14155
14267
  */
14156
14268
  class SoleBusinessAllocationsForm extends FormArray {
14157
14269
  constructor(businessAllocations) {
@@ -14242,14 +14354,103 @@ class SoleDetailsForm extends AbstractForm {
14242
14354
  }
14243
14355
  }
14244
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
+
14245
14444
  class SoleInvoiceTemplateForm extends AbstractForm {
14246
- constructor(invoiceTemplate) {
14445
+ constructor(invoiceTemplate, soleDetails) {
14247
14446
  super({
14248
14447
  name: new FormControl(invoiceTemplate.name, Validators.required),
14249
- 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),
14250
14450
  term: new FormControl(invoiceTemplate.term, [Validators.required, Validators.min(0)]),
14251
- bankAccount: new FormControl(invoiceTemplate.bankAccount)
14451
+ bankAccount: new FormControl(invoiceTemplate.bankAccount, [Validators.required])
14252
14452
  }, invoiceTemplate);
14453
+ this.soleDetails = soleDetails;
14253
14454
  }
14254
14455
  }
14255
14456
 
@@ -14265,9 +14466,12 @@ class BankAccountAllocationForm extends AbstractForm {
14265
14466
  if (bankAccount === null || bankAccount === void 0 ? void 0 : bankAccount.isSoleTank()) {
14266
14467
  this.addControl('businessAllocations', new SoleBusinessAllocationsForm(bankAccount.businessAllocations));
14267
14468
  }
14268
- this.watchTankType();
14469
+ this.listenEvents();
14269
14470
  }
14270
- watchTankType() {
14471
+ listenEvents() {
14472
+ this.listenTankTypeChanges();
14473
+ }
14474
+ listenTankTypeChanges() {
14271
14475
  this.get('tankType').valueChanges.subscribe((tankType) => {
14272
14476
  var _a, _b;
14273
14477
  this.removeControl('bankAccountProperties');
@@ -14309,14 +14513,10 @@ class BankAccountAddManualForm extends BankAccountAllocationForm {
14309
14513
  constructor(connection) {
14310
14514
  super();
14311
14515
  this.connection = connection;
14312
- this
14313
- .addControl('type', new FormControl(null, Validators.required))
14314
- .addControl('accountName', new FormControl(null, Validators.required))
14315
- .addControl('currentBalance', new FormControl(null, Validators.required))
14316
- .addControl('accountNumber', new FormControl(null, [Validators.required, Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]));
14317
- this.listenEvents();
14318
- }
14319
- 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)]));
14320
14520
  this.listenTypeChanges();
14321
14521
  }
14322
14522
  /**
@@ -14928,9 +15128,14 @@ class VehicleClaimForm extends AbstractForm {
14928
15128
  }),
14929
15129
  workUsage: new FormControl({
14930
15130
  value: vehicleClaim.workUsage,
14931
- disabled: !details.isManual || details.isKlmsMethod()
15131
+ disabled: !details.isManual || details.isKmsMethod()
14932
15132
  })
14933
15133
  }, vehicleClaim);
15134
+ this.vehicleClaim = vehicleClaim;
15135
+ this.details = details;
15136
+ }
15137
+ getAverageWeeklyKMS() {
15138
+ return this.get('kilometers').value / FinancialYear.weeksInYear;
14934
15139
  }
14935
15140
  }
14936
15141
 
@@ -14938,16 +15143,12 @@ class VehicleClaimForm extends AbstractForm {
14938
15143
  * Add/Edit vehicle claim details form
14939
15144
  */
14940
15145
  class VehicleClaimDetailsForm extends AbstractForm {
14941
- /**
14942
- * @param vehicleClaimDetails required because we create a new details with prefilled data (like Financial year)
14943
- * @param logbooks required for isManual field disabled state management
14944
- */
14945
- constructor(vehicleClaimDetails, logbooks) {
15146
+ constructor(vehicleClaimDetails, isBestPeriodExist) {
14946
15147
  super({
14947
15148
  method: new FormControl(vehicleClaimDetails.method, Validators.required),
14948
15149
  isManual: new FormControl({
14949
15150
  value: vehicleClaimDetails.isManual,
14950
- disabled: !logbooks.isBestPeriodExist()
15151
+ disabled: !isBestPeriodExist
14951
15152
  }),
14952
15153
  }, vehicleClaimDetails);
14953
15154
  }
@@ -14972,30 +15173,38 @@ class VehicleLogbookForm extends AbstractForm {
14972
15173
  date: new FormControl(logbook.date, Validators.required),
14973
15174
  odometerStart: new FormControl(logbook.odometerStart, Validators.required),
14974
15175
  odometerEnd: new FormControl(logbook.odometerEnd, Validators.required),
14975
- business: new FormControl(logbook.business),
14976
- // @TODO Alex: remove when backend fixed
14977
- purpose: new FormControl(VehicleLogbookPurposeEnum.BUSINESS)
15176
+ business: new FormControl(logbook.business)
14978
15177
  }, logbook);
14979
15178
  this.logbook = logbook;
14980
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() {
14981
15186
  switch (true) {
14982
15187
  // Create the first or edit the single logbook
14983
- case !logbook.id && !logbooks.length:
14984
- case !!logbook.id && logbooks.length === 1:
15188
+ case !this.logbook.id && !this.logbooks.length:
15189
+ case !!this.logbook.id && this.logbooks.length === 1:
14985
15190
  this.get('odometerStart').setValidators(Validators.min(0));
14986
15191
  this.get('date').setValidators(dateRangeValidator(new FinancialYear().startDate, new FinancialYear().endDate));
14987
15192
  break;
14988
- // Create the non-first or edit the last logbook
14989
- case !logbook.id && !!logbooks.length:
14990
- case !!logbook.id && logbook.id === logbooks.last.id && logbooks.length > 1:
15193
+ // Create the non-first
15194
+ case !this.logbook.id && !!this.logbooks.length:
14991
15195
  this.get('odometerStart').disable();
14992
- this.get('odometerEnd').setValidators(Validators.min(logbooks.last.odometerEnd));
14993
- if (!!logbook.id) {
14994
- }
14995
- 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));
14996
15205
  break;
14997
15206
  // Edit the non-last logbook
14998
- 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:
14999
15208
  this.get('odometerStart').disable();
15000
15209
  this.get('odometerEnd').disable();
15001
15210
  this.get('date').disable();
@@ -15010,5 +15219,5 @@ VehicleLogbookForm.maxDescriptionLength = 60;
15010
15219
  * Generated bundle index. Do not edit.
15011
15220
  */
15012
15221
 
15013
- 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, 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 };
15014
15223
  //# sourceMappingURL=taxtank-core.js.map