taxtank-core 0.33.52 → 0.33.54
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/src/lib/collections/depreciation.collection.mjs +2 -2
- package/esm2022/src/lib/collections/income-source/income-source.collection.mjs +2 -2
- package/esm2022/src/lib/collections/transaction/transaction.collection.mjs +3 -3
- package/esm2022/src/lib/collections/vehicle/vehicle-logbook.collection.mjs +2 -2
- package/esm2022/src/lib/db/Enums/tank-type.enum.mjs +6 -6
- package/esm2022/src/lib/db/Models/transaction/transaction-base.mjs +6 -6
- package/esm2022/src/lib/forms/bank/bank-account/bank-account-allocation.form.mjs +3 -3
- package/esm2022/src/lib/forms/bank/bank-account/bank-account-properties.form.mjs +2 -2
- package/esm2022/src/lib/forms/sole/sole-business-allocations.form.mjs +2 -2
- package/esm2022/src/lib/forms/transaction/allocation-rule.form.mjs +11 -11
- package/esm2022/src/lib/forms/transaction/transaction-base-filter.form.mjs +3 -3
- package/esm2022/src/lib/models/bank/allocation-group.mjs +2 -2
- package/esm2022/src/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.mjs +2 -2
- package/esm2022/src/lib/models/transaction/allocation-rule.mjs +4 -4
- package/esm2022/src/lib/models/user/user.mjs +5 -5
- package/esm2022/src/lib/models/vehicle/vehicle-claim.mjs +2 -2
- package/esm2022/src/lib/models/vehicle/vehicle-logbook.mjs +3 -3
- package/esm2022/src/lib/services/http/home-office/home-office-log.service.mjs +15 -7
- package/fesm2022/taxtank-core.mjs +55 -47
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/db/Enums/tank-type.enum.d.ts +5 -5
- package/src/lib/services/http/home-office/home-office-log.service.d.ts +5 -1
@@ -1,17 +1,22 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
2
2
|
import { RestService } from '../rest';
|
3
3
|
import { Collection } from '../../../collections';
|
4
|
-
import { HomeOfficeLog } from '../../../models';
|
4
|
+
import { HomeOfficeClaim, HomeOfficeLog } from '../../../models';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
export class HomeOfficeLogService extends RestService {
|
7
|
-
constructor() {
|
8
|
-
super(
|
7
|
+
constructor(environment) {
|
8
|
+
super(environment);
|
9
|
+
this.environment = environment;
|
9
10
|
this.endpointUri = 'home-office-logs';
|
10
11
|
this.modelClass = HomeOfficeLog;
|
11
12
|
this.collectionClass = (Collection);
|
12
13
|
this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
|
14
|
+
this.listenEvents();
|
13
15
|
}
|
14
|
-
|
16
|
+
listenEvents() {
|
17
|
+
this.listenCSE(HomeOfficeClaim, this.refreshCache, ['post']);
|
18
|
+
}
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
15
20
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, providedIn: 'root' }); }
|
16
21
|
}
|
17
22
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, decorators: [{
|
@@ -19,5 +24,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
19
24
|
args: [{
|
20
25
|
providedIn: 'root'
|
21
26
|
}]
|
22
|
-
}]
|
23
|
-
|
27
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
28
|
+
type: Inject,
|
29
|
+
args: ['environment']
|
30
|
+
}] }] });
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9tZS1vZmZpY2UtbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9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gnLCAnZGVsZXRlQmF0Y2gnXTtcblxuICBjb25zdHJ1Y3RvcihASW5qZWN0KCdlbnZpcm9ubWVudCcpIHByb3RlY3RlZCBlbnZpcm9ubWVudDogYW55KSB7XG4gICAgc3VwZXIoZW52aXJvbm1lbnQpO1xuICAgIHRoaXMubGlzdGVuRXZlbnRzKCk7XG4gIH1cblxuICBsaXN0ZW5FdmVudHMoKTogdm9pZCB7XG4gICAgdGhpcy5saXN0ZW5DU0UoSG9tZU9mZmljZUNsYWltLCB0aGlzLnJlZnJlc2hDYWNoZSwgWydwb3N0J10pO1xuICB9XG59XG4iXX0=
|
@@ -258,11 +258,11 @@ let DepreciationForecast$1 = class DepreciationForecast extends AbstractModel {
|
|
258
258
|
|
259
259
|
var TankTypeEnum;
|
260
260
|
(function (TankTypeEnum) {
|
261
|
-
TankTypeEnum[TankTypeEnum["
|
262
|
-
TankTypeEnum[TankTypeEnum["
|
263
|
-
TankTypeEnum[TankTypeEnum["
|
264
|
-
TankTypeEnum[TankTypeEnum["
|
265
|
-
TankTypeEnum[TankTypeEnum["
|
261
|
+
TankTypeEnum[TankTypeEnum["PROPERTY"] = 1] = "PROPERTY";
|
262
|
+
TankTypeEnum[TankTypeEnum["WORK"] = 2] = "WORK";
|
263
|
+
TankTypeEnum[TankTypeEnum["OTHER"] = 3] = "OTHER";
|
264
|
+
TankTypeEnum[TankTypeEnum["SOLE"] = 4] = "SOLE";
|
265
|
+
TankTypeEnum[TankTypeEnum["HOLDING"] = 5] = "HOLDING";
|
266
266
|
TankTypeEnum[TankTypeEnum["PERSONAL"] = 6] = "PERSONAL";
|
267
267
|
})(TankTypeEnum || (TankTypeEnum = {}));
|
268
268
|
|
@@ -276,15 +276,15 @@ class TransactionBase extends ObservableModel {
|
|
276
276
|
get tankType() {
|
277
277
|
switch (true) {
|
278
278
|
case this.isPropertyTank():
|
279
|
-
return TankTypeEnum.
|
279
|
+
return TankTypeEnum.PROPERTY;
|
280
280
|
case this.isWorkTank():
|
281
|
-
return TankTypeEnum.
|
281
|
+
return TankTypeEnum.WORK;
|
282
282
|
case this.isSoleTank():
|
283
|
-
return TankTypeEnum.
|
283
|
+
return TankTypeEnum.SOLE;
|
284
284
|
case this.isHoldingTank():
|
285
|
-
return TankTypeEnum.
|
285
|
+
return TankTypeEnum.HOLDING;
|
286
286
|
case this.isOtherTank():
|
287
|
-
return TankTypeEnum.
|
287
|
+
return TankTypeEnum.OTHER;
|
288
288
|
default:
|
289
289
|
return TankTypeEnum.PERSONAL;
|
290
290
|
}
|
@@ -689,7 +689,7 @@ class AllocationGroup extends AbstractModel {
|
|
689
689
|
operation: TransactionOperationEnum.ALLOCATE_INVOICE,
|
690
690
|
description: invoice.reference,
|
691
691
|
invoiceNumber: invoice.getNumber(),
|
692
|
-
tankType: TankTypeEnum.
|
692
|
+
tankType: TankTypeEnum.SOLE,
|
693
693
|
amount: invoice.grossPrice,
|
694
694
|
allocations,
|
695
695
|
bankTransactions
|
@@ -5026,11 +5026,11 @@ class VehicleLogbook extends VehicleLogbook$1 {
|
|
5026
5026
|
get tankType() {
|
5027
5027
|
switch (true) {
|
5028
5028
|
case !!this.business:
|
5029
|
-
return TankTypeEnum.
|
5029
|
+
return TankTypeEnum.SOLE;
|
5030
5030
|
case this.isPersonal:
|
5031
5031
|
return TankTypeEnum.PERSONAL;
|
5032
5032
|
default:
|
5033
|
-
return TankTypeEnum.
|
5033
|
+
return TankTypeEnum.WORK;
|
5034
5034
|
}
|
5035
5035
|
}
|
5036
5036
|
}
|
@@ -5094,7 +5094,7 @@ class VehicleClaim extends VehicleClaim$1 {
|
|
5094
5094
|
return !!this.business;
|
5095
5095
|
}
|
5096
5096
|
get tankType() {
|
5097
|
-
return this.isSoleTank() ? TankTypeEnum.
|
5097
|
+
return this.isSoleTank() ? TankTypeEnum.SOLE : TankTypeEnum.WORK;
|
5098
5098
|
}
|
5099
5099
|
/**
|
5100
5100
|
* Claim amount for KMs method. Exists only for KMs method.
|
@@ -5416,16 +5416,16 @@ class User extends User$1 {
|
|
5416
5416
|
getTankTypes() {
|
5417
5417
|
const tankTypes = [];
|
5418
5418
|
if (this.roles.includes(UserRolesEnum.WORK_TANK)) {
|
5419
|
-
tankTypes.push(TankTypeEnum.
|
5419
|
+
tankTypes.push(TankTypeEnum.WORK);
|
5420
5420
|
}
|
5421
5421
|
if (this.roles.includes(UserRolesEnum.PROPERTY_TANK)) {
|
5422
|
-
tankTypes.push(TankTypeEnum.
|
5422
|
+
tankTypes.push(TankTypeEnum.PROPERTY);
|
5423
5423
|
}
|
5424
5424
|
if (this.roles.includes(UserRolesEnum.SOLE_TANK)) {
|
5425
|
-
tankTypes.push(TankTypeEnum.
|
5425
|
+
tankTypes.push(TankTypeEnum.SOLE);
|
5426
5426
|
}
|
5427
5427
|
if (this.roles.includes(UserRolesEnum.HOLDING_TANK)) {
|
5428
|
-
tankTypes.push(TankTypeEnum.
|
5428
|
+
tankTypes.push(TankTypeEnum.HOLDING);
|
5429
5429
|
}
|
5430
5430
|
tankTypes.push(TankTypeEnum.PERSONAL);
|
5431
5431
|
return tankTypes;
|
@@ -6538,13 +6538,13 @@ class AllocationRule extends AllocationRule$1 {
|
|
6538
6538
|
return this.type === AllocationRuleTypeEnum.TRANSFER;
|
6539
6539
|
}
|
6540
6540
|
isPropertyTank() {
|
6541
|
-
return this.transaction.tankType === TankTypeEnum.
|
6541
|
+
return this.transaction.tankType === TankTypeEnum.PROPERTY;
|
6542
6542
|
}
|
6543
6543
|
isWorkTank() {
|
6544
|
-
return this.transaction.tankType === TankTypeEnum.
|
6544
|
+
return this.transaction.tankType === TankTypeEnum.WORK;
|
6545
6545
|
}
|
6546
6546
|
isSoleTank() {
|
6547
|
-
return this.transaction.tankType === TankTypeEnum.
|
6547
|
+
return this.transaction.tankType === TankTypeEnum.SOLE;
|
6548
6548
|
}
|
6549
6549
|
isPropertyIncome() {
|
6550
6550
|
return this.isIncome() && this.isPropertyTank();
|
@@ -6937,7 +6937,7 @@ class TransactionCollection extends TransactionBaseCollection {
|
|
6937
6937
|
* Get new collection of property transactions
|
6938
6938
|
*/
|
6939
6939
|
getPropertyTransactions() {
|
6940
|
-
return this.filterBy('tankType', TankTypeEnum.
|
6940
|
+
return this.filterBy('tankType', TankTypeEnum.PROPERTY);
|
6941
6941
|
}
|
6942
6942
|
getDebitTransactions() {
|
6943
6943
|
return new TransactionCollection(this.items.filter((transaction) => transaction.isDebit()));
|
@@ -7006,7 +7006,7 @@ class TransactionCollection extends TransactionBaseCollection {
|
|
7006
7006
|
// sole tank may have multiple vehicle claims, so we need to filter by business.id
|
7007
7007
|
? this.getVehicleTransactions().filterBy('business.id', vehicleClaim.business.id)
|
7008
7008
|
// work tank may have only one vehicle claim, so we need to filter by tank type
|
7009
|
-
: this.getVehicleTransactions().filterBy('tankType', TankTypeEnum.
|
7009
|
+
: this.getVehicleTransactions().filterBy('tankType', TankTypeEnum.WORK);
|
7010
7010
|
}
|
7011
7011
|
/**
|
7012
7012
|
* Get list of vehicle transactions except KMS transactions
|
@@ -7187,7 +7187,7 @@ class DepreciationCollection extends TransactionBaseCollection {
|
|
7187
7187
|
// sole tank may have multiple vehicle claims, so we need to filter by business.id
|
7188
7188
|
? this.getVehicleDepreciations().filterBy('business.id', vehicleClaim.business.id)
|
7189
7189
|
// work tank may have only one vehicle claim, so we need to filter by tank type
|
7190
|
-
: this.getVehicleDepreciations().filterBy('tankType', TankTypeEnum.
|
7190
|
+
: this.getVehicleDepreciations().filterBy('tankType', TankTypeEnum.WORK);
|
7191
7191
|
}
|
7192
7192
|
getExportBody(params) {
|
7193
7193
|
return [];
|
@@ -7604,7 +7604,7 @@ class MyTaxDeductions {
|
|
7604
7604
|
this.workRelatedSelfEducationType = this.workRelatedSelfEducationExpenses.length ?
|
7605
7605
|
DeductionSelfEducationTypeEnum.IMPROVE_SKILLS_FOR_CURRENT_EARNINGS_K : null;
|
7606
7606
|
this.workRelatedSelfEducationTotalAmount = this.calculateWorkRelatedSelfEducationTotalAmount();
|
7607
|
-
this.lowValuePoolDeductionTotalAmount = this.depreciations.getByTankType(TankTypeEnum.
|
7607
|
+
this.lowValuePoolDeductionTotalAmount = this.depreciations.getByTankType(TankTypeEnum.WORK)
|
7608
7608
|
.getLVPDepreciations().sumBy('claimAmount');
|
7609
7609
|
this.interestExpensesTotalAmount = this.transactions
|
7610
7610
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.interestExpenses)
|
@@ -8696,7 +8696,7 @@ class VehicleLogbookCollection extends Collection {
|
|
8696
8696
|
// sole tank may have multiple vehicle claims, so we need to filter by business.id
|
8697
8697
|
? this.filterBy('business.id', vehicleClaim.business.id)
|
8698
8698
|
// work tank may have only one vehicle claim, so we need to filter by tank type
|
8699
|
-
: this.filterBy('tankType', TankTypeEnum.
|
8699
|
+
: this.filterBy('tankType', TankTypeEnum.WORK);
|
8700
8700
|
}
|
8701
8701
|
/**
|
8702
8702
|
* get collection of logbooks with the biggest work usage for {@link BestVehicleLogbookCollection.periodDuration}
|
@@ -9275,7 +9275,7 @@ class IncomeSourceCollection extends Collection {
|
|
9275
9275
|
filterByTank(tank) {
|
9276
9276
|
return this.items.filter((incomeSource) => {
|
9277
9277
|
switch (tank) {
|
9278
|
-
case TankTypeEnum.
|
9278
|
+
case TankTypeEnum.OTHER:
|
9279
9279
|
return incomeSource.isOtherIncome();
|
9280
9280
|
default:
|
9281
9281
|
return incomeSource.isWorkIncome();
|
@@ -16454,14 +16454,19 @@ var HomeOfficeClaimMessagesEnum;
|
|
16454
16454
|
})(HomeOfficeClaimMessagesEnum || (HomeOfficeClaimMessagesEnum = {}));
|
16455
16455
|
|
16456
16456
|
class HomeOfficeLogService extends RestService$1 {
|
16457
|
-
constructor() {
|
16458
|
-
super(
|
16457
|
+
constructor(environment) {
|
16458
|
+
super(environment);
|
16459
|
+
this.environment = environment;
|
16459
16460
|
this.endpointUri = 'home-office-logs';
|
16460
16461
|
this.modelClass = HomeOfficeLog;
|
16461
16462
|
this.collectionClass = (Collection);
|
16462
16463
|
this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
|
16464
|
+
this.listenEvents();
|
16463
16465
|
}
|
16464
|
-
|
16466
|
+
listenEvents() {
|
16467
|
+
this.listenCSE(HomeOfficeClaim, this.refreshCache, ['post']);
|
16468
|
+
}
|
16469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
16465
16470
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, providedIn: 'root' }); }
|
16466
16471
|
}
|
16467
16472
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HomeOfficeLogService, decorators: [{
|
@@ -16469,7 +16474,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
16469
16474
|
args: [{
|
16470
16475
|
providedIn: 'root'
|
16471
16476
|
}]
|
16472
|
-
}]
|
16477
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
16478
|
+
type: Inject,
|
16479
|
+
args: ['environment']
|
16480
|
+
}] }] });
|
16473
16481
|
|
16474
16482
|
var HomeOfficeLogMessagesEnum;
|
16475
16483
|
(function (HomeOfficeLogMessagesEnum) {
|
@@ -21576,7 +21584,7 @@ class BankAccountPropertiesForm extends UntypedFormArray {
|
|
21576
21584
|
property: new UntypedFormControl(bankAccountProperty?.property, Validators.required),
|
21577
21585
|
percent: new UntypedFormControl(bankAccountProperty.percent, Validators.required)
|
21578
21586
|
})), [
|
21579
|
-
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.
|
21587
|
+
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.PROPERTY, Validators.required),
|
21580
21588
|
fieldsSumValidator('percent', 100)
|
21581
21589
|
]);
|
21582
21590
|
}
|
@@ -21700,7 +21708,7 @@ class SoleBusinessAllocationsForm extends UntypedFormArray {
|
|
21700
21708
|
business: new UntypedFormControl(businessAllocation?.business, Validators.required),
|
21701
21709
|
percent: new UntypedFormControl(businessAllocation.percent, Validators.required)
|
21702
21710
|
})), [
|
21703
|
-
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.
|
21711
|
+
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.SOLE, Validators.required),
|
21704
21712
|
fieldsSumValidator('percent', 100)
|
21705
21713
|
]);
|
21706
21714
|
}
|
@@ -22103,10 +22111,10 @@ class BankAccountAllocationForm extends AbstractForm {
|
|
22103
22111
|
this.removeControl('bankAccountProperties');
|
22104
22112
|
this.removeControl('businessAllocations');
|
22105
22113
|
switch (tankType) {
|
22106
|
-
case TankTypeEnum.
|
22114
|
+
case TankTypeEnum.PROPERTY:
|
22107
22115
|
this.addControl('bankAccountProperties', new BankAccountPropertiesForm(this.bankAccount?.bankAccountProperties));
|
22108
22116
|
break;
|
22109
|
-
case TankTypeEnum.
|
22117
|
+
case TankTypeEnum.SOLE:
|
22110
22118
|
this.addControl('businessAllocations', new SoleBusinessAllocationsForm(this.bankAccount?.businessAllocations));
|
22111
22119
|
break;
|
22112
22120
|
}
|
@@ -23764,13 +23772,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23764
23772
|
}
|
23765
23773
|
get tankTypeLabel() {
|
23766
23774
|
switch (this.transactionFormGroup.get('tankType').value) {
|
23767
|
-
case TankTypeEnum.
|
23775
|
+
case TankTypeEnum.WORK:
|
23768
23776
|
return 'work';
|
23769
|
-
case TankTypeEnum.
|
23777
|
+
case TankTypeEnum.PROPERTY:
|
23770
23778
|
return 'property';
|
23771
|
-
case TankTypeEnum.
|
23779
|
+
case TankTypeEnum.SOLE:
|
23772
23780
|
return 'sole';
|
23773
|
-
case TankTypeEnum.
|
23781
|
+
case TankTypeEnum.HOLDING:
|
23774
23782
|
return 'holding';
|
23775
23783
|
default:
|
23776
23784
|
return 'personal';
|
@@ -23800,13 +23808,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23800
23808
|
this.transactionFormGroup.get('business').disable({ emitEvent: false });
|
23801
23809
|
this.transactionFormGroup.get('incomeSource').disable({ emitEvent: false });
|
23802
23810
|
switch (tankType) {
|
23803
|
-
case TankTypeEnum.
|
23811
|
+
case TankTypeEnum.WORK:
|
23804
23812
|
this.transactionFormGroup.get('incomeSource').enable({ emitEvent: false });
|
23805
23813
|
break;
|
23806
|
-
case TankTypeEnum.
|
23814
|
+
case TankTypeEnum.PROPERTY:
|
23807
23815
|
this.transactionFormGroup.get('property').enable({ emitEvent: false });
|
23808
23816
|
break;
|
23809
|
-
case TankTypeEnum.
|
23817
|
+
case TankTypeEnum.SOLE:
|
23810
23818
|
this.transactionFormGroup.get('business').enable({ emitEvent: false });
|
23811
23819
|
break;
|
23812
23820
|
}
|
@@ -23821,13 +23829,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23821
23829
|
return this.get('type').value === AllocationRuleTypeEnum.TRANSFER;
|
23822
23830
|
}
|
23823
23831
|
isPropertyTank() {
|
23824
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23832
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.PROPERTY;
|
23825
23833
|
}
|
23826
23834
|
isWorkTank() {
|
23827
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23835
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.WORK;
|
23828
23836
|
}
|
23829
23837
|
isSoleTank() {
|
23830
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23838
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.SOLE;
|
23831
23839
|
}
|
23832
23840
|
isPropertyIncome() {
|
23833
23841
|
return this.isIncome() && this.isPropertyTank();
|
@@ -24244,8 +24252,8 @@ class TransactionBaseFilterForm extends FormGroup {
|
|
24244
24252
|
}
|
24245
24253
|
listenEvents() {
|
24246
24254
|
this.get('tankType').valueChanges.subscribe(tankType => {
|
24247
|
-
tankType === TankTypeEnum.
|
24248
|
-
tankType === TankTypeEnum.
|
24255
|
+
tankType === TankTypeEnum.SOLE ? this.get('business').enable() : this.get('business').disable();
|
24256
|
+
tankType === TankTypeEnum.PROPERTY ? this.get('properties').enable() : this.get('properties').disable();
|
24249
24257
|
});
|
24250
24258
|
}
|
24251
24259
|
filter(collection) {
|