taxtank-core 0.33.52 → 0.33.53
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/fesm2022/taxtank-core.mjs +43 -43
- 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
@@ -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();
|
@@ -21576,7 +21576,7 @@ class BankAccountPropertiesForm extends UntypedFormArray {
|
|
21576
21576
|
property: new UntypedFormControl(bankAccountProperty?.property, Validators.required),
|
21577
21577
|
percent: new UntypedFormControl(bankAccountProperty.percent, Validators.required)
|
21578
21578
|
})), [
|
21579
|
-
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.
|
21579
|
+
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.PROPERTY, Validators.required),
|
21580
21580
|
fieldsSumValidator('percent', 100)
|
21581
21581
|
]);
|
21582
21582
|
}
|
@@ -21700,7 +21700,7 @@ class SoleBusinessAllocationsForm extends UntypedFormArray {
|
|
21700
21700
|
business: new UntypedFormControl(businessAllocation?.business, Validators.required),
|
21701
21701
|
percent: new UntypedFormControl(businessAllocation.percent, Validators.required)
|
21702
21702
|
})), [
|
21703
|
-
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.
|
21703
|
+
conditionalValidator((control) => control.get('tankType').value === TankTypeEnum.SOLE, Validators.required),
|
21704
21704
|
fieldsSumValidator('percent', 100)
|
21705
21705
|
]);
|
21706
21706
|
}
|
@@ -22103,10 +22103,10 @@ class BankAccountAllocationForm extends AbstractForm {
|
|
22103
22103
|
this.removeControl('bankAccountProperties');
|
22104
22104
|
this.removeControl('businessAllocations');
|
22105
22105
|
switch (tankType) {
|
22106
|
-
case TankTypeEnum.
|
22106
|
+
case TankTypeEnum.PROPERTY:
|
22107
22107
|
this.addControl('bankAccountProperties', new BankAccountPropertiesForm(this.bankAccount?.bankAccountProperties));
|
22108
22108
|
break;
|
22109
|
-
case TankTypeEnum.
|
22109
|
+
case TankTypeEnum.SOLE:
|
22110
22110
|
this.addControl('businessAllocations', new SoleBusinessAllocationsForm(this.bankAccount?.businessAllocations));
|
22111
22111
|
break;
|
22112
22112
|
}
|
@@ -23764,13 +23764,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23764
23764
|
}
|
23765
23765
|
get tankTypeLabel() {
|
23766
23766
|
switch (this.transactionFormGroup.get('tankType').value) {
|
23767
|
-
case TankTypeEnum.
|
23767
|
+
case TankTypeEnum.WORK:
|
23768
23768
|
return 'work';
|
23769
|
-
case TankTypeEnum.
|
23769
|
+
case TankTypeEnum.PROPERTY:
|
23770
23770
|
return 'property';
|
23771
|
-
case TankTypeEnum.
|
23771
|
+
case TankTypeEnum.SOLE:
|
23772
23772
|
return 'sole';
|
23773
|
-
case TankTypeEnum.
|
23773
|
+
case TankTypeEnum.HOLDING:
|
23774
23774
|
return 'holding';
|
23775
23775
|
default:
|
23776
23776
|
return 'personal';
|
@@ -23800,13 +23800,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23800
23800
|
this.transactionFormGroup.get('business').disable({ emitEvent: false });
|
23801
23801
|
this.transactionFormGroup.get('incomeSource').disable({ emitEvent: false });
|
23802
23802
|
switch (tankType) {
|
23803
|
-
case TankTypeEnum.
|
23803
|
+
case TankTypeEnum.WORK:
|
23804
23804
|
this.transactionFormGroup.get('incomeSource').enable({ emitEvent: false });
|
23805
23805
|
break;
|
23806
|
-
case TankTypeEnum.
|
23806
|
+
case TankTypeEnum.PROPERTY:
|
23807
23807
|
this.transactionFormGroup.get('property').enable({ emitEvent: false });
|
23808
23808
|
break;
|
23809
|
-
case TankTypeEnum.
|
23809
|
+
case TankTypeEnum.SOLE:
|
23810
23810
|
this.transactionFormGroup.get('business').enable({ emitEvent: false });
|
23811
23811
|
break;
|
23812
23812
|
}
|
@@ -23821,13 +23821,13 @@ class AllocationRuleForm extends AbstractForm {
|
|
23821
23821
|
return this.get('type').value === AllocationRuleTypeEnum.TRANSFER;
|
23822
23822
|
}
|
23823
23823
|
isPropertyTank() {
|
23824
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23824
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.PROPERTY;
|
23825
23825
|
}
|
23826
23826
|
isWorkTank() {
|
23827
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23827
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.WORK;
|
23828
23828
|
}
|
23829
23829
|
isSoleTank() {
|
23830
|
-
return this.get('transaction').get('tankType').value === TankTypeEnum.
|
23830
|
+
return this.get('transaction').get('tankType').value === TankTypeEnum.SOLE;
|
23831
23831
|
}
|
23832
23832
|
isPropertyIncome() {
|
23833
23833
|
return this.isIncome() && this.isPropertyTank();
|
@@ -24244,8 +24244,8 @@ class TransactionBaseFilterForm extends FormGroup {
|
|
24244
24244
|
}
|
24245
24245
|
listenEvents() {
|
24246
24246
|
this.get('tankType').valueChanges.subscribe(tankType => {
|
24247
|
-
tankType === TankTypeEnum.
|
24248
|
-
tankType === TankTypeEnum.
|
24247
|
+
tankType === TankTypeEnum.SOLE ? this.get('business').enable() : this.get('business').disable();
|
24248
|
+
tankType === TankTypeEnum.PROPERTY ? this.get('properties').enable() : this.get('properties').disable();
|
24249
24249
|
});
|
24250
24250
|
}
|
24251
24251
|
filter(collection) {
|