taxtank-core 0.30.110 → 0.30.111
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.
- package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-list.enum.mjs +3 -1
- package/esm2020/lib/forms/transaction/transaction-base.form.mjs +4 -1
- package/esm2020/lib/models/chart-accounts/chart-accounts.mjs +12 -4
- package/fesm2015/taxtank-core.mjs +16 -3
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +16 -3
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/db/Enums/chart-accounts/chart-accounts-list.enum.d.ts +2 -0
- package/lib/models/chart-accounts/chart-accounts.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1122,12 +1122,14 @@ var ChartAccountsListEnum;
|
|
|
1122
1122
|
ChartAccountsListEnum[ChartAccountsListEnum["REGISTRATION"] = 686] = "REGISTRATION";
|
|
1123
1123
|
ChartAccountsListEnum[ChartAccountsListEnum["LEASE_INTEREST_PAYMENTS"] = 687] = "LEASE_INTEREST_PAYMENTS";
|
|
1124
1124
|
ChartAccountsListEnum[ChartAccountsListEnum["SOLE_VEHICLE_LOAN_INTEREST"] = 688] = "SOLE_VEHICLE_LOAN_INTEREST";
|
|
1125
|
+
ChartAccountsListEnum[ChartAccountsListEnum["SOLE_VEHICLE_LOAN_PRINCIPAL"] = 855] = "SOLE_VEHICLE_LOAN_PRINCIPAL";
|
|
1125
1126
|
ChartAccountsListEnum[ChartAccountsListEnum["INSURANCE"] = 689] = "INSURANCE";
|
|
1126
1127
|
ChartAccountsListEnum[ChartAccountsListEnum["TYRES"] = 690] = "TYRES";
|
|
1127
1128
|
ChartAccountsListEnum[ChartAccountsListEnum["BATTERIES"] = 691] = "BATTERIES";
|
|
1128
1129
|
ChartAccountsListEnum[ChartAccountsListEnum["CAR_WASH"] = 692] = "CAR_WASH";
|
|
1129
1130
|
ChartAccountsListEnum[ChartAccountsListEnum["PARKING_TOLLS"] = 693] = "PARKING_TOLLS";
|
|
1130
1131
|
ChartAccountsListEnum[ChartAccountsListEnum["OTHER_SOLE_EXPENSES"] = 694] = "OTHER_SOLE_EXPENSES";
|
|
1132
|
+
ChartAccountsListEnum[ChartAccountsListEnum["SOLE_ENTERTAINMENT"] = 698] = "SOLE_ENTERTAINMENT";
|
|
1131
1133
|
ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_EXPENSES"] = 628] = "PERSONAL_EXPENSES";
|
|
1132
1134
|
ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_INCOME"] = 630] = "PERSONAL_INCOME";
|
|
1133
1135
|
ChartAccountsListEnum[ChartAccountsListEnum["PLATFORM_FEES"] = 857] = "PLATFORM_FEES";
|
|
@@ -3288,7 +3290,13 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
3288
3290
|
* Check if transaction chart account is work related car expenses
|
|
3289
3291
|
*/
|
|
3290
3292
|
isVehicleLoanExpense() {
|
|
3291
|
-
return this.
|
|
3293
|
+
return this.isVehicleLoanInterest() || this.isVehicleLoanPrinciple();
|
|
3294
|
+
}
|
|
3295
|
+
isVehicleLoanPrinciple() {
|
|
3296
|
+
return [ChartAccountsListEnum.VEHICLE_LOAN_PRINCIPAL, ChartAccountsListEnum.SOLE_VEHICLE_LOAN_PRINCIPAL].includes(this.id);
|
|
3297
|
+
}
|
|
3298
|
+
isVehicleLoanInterest() {
|
|
3299
|
+
return [ChartAccountsListEnum.VEHICLE_LOAN_INTEREST, ChartAccountsListEnum.SOLE_VEHICLE_LOAN_INTEREST].includes(this.id);
|
|
3292
3300
|
}
|
|
3293
3301
|
/**
|
|
3294
3302
|
* Get chart accounts value for current financial year
|
|
@@ -3304,10 +3312,12 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
3304
3312
|
}
|
|
3305
3313
|
/**
|
|
3306
3314
|
* no way to check how much used for work/sole, so we let user adjust it
|
|
3307
|
-
* except vehicle expense, which is equal to vehicleClaim.workUsage
|
|
3315
|
+
* except vehicle expense, which is equal to vehicleClaim.workUsage
|
|
3316
|
+
* except when taxablePercent=0, but not SOLE_ENTERTAINMENT
|
|
3308
3317
|
*/
|
|
3309
3318
|
isClaimPercentEditable() {
|
|
3310
|
-
return (this.isWorkExpense() || this.isSoleExpense()) &&
|
|
3319
|
+
return ((this.isWorkExpense() || this.isSoleExpense()) && !this.isVehicleExpense() && this.taxablePercent > 0)
|
|
3320
|
+
|| this.id === ChartAccountsListEnum.SOLE_ENTERTAINMENT;
|
|
3311
3321
|
}
|
|
3312
3322
|
/**
|
|
3313
3323
|
* get label for transaction tax field depended on selected chart account.
|
|
@@ -20439,6 +20449,9 @@ class TransactionBaseForm extends AbstractForm {
|
|
|
20439
20449
|
if (chartAccounts.isClaimPercentEditable()) {
|
|
20440
20450
|
this.get('claimPercent').enable();
|
|
20441
20451
|
}
|
|
20452
|
+
else {
|
|
20453
|
+
this.get('claimPercent').disable();
|
|
20454
|
+
}
|
|
20442
20455
|
// property claim (ownership% x shared%) for property expenses, taxable percent for others
|
|
20443
20456
|
let claimPercent = chartAccounts.taxablePercent;
|
|
20444
20457
|
if (chartAccounts.isPropertyExpense() && chartAccounts.id !== ChartAccountsListEnum.PLATFORM_FEES) {
|