taxtank-core 2.1.94 → 2.1.96
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/fesm2022/taxtank-core.mjs +57 -19
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +36 -30
- package/package.json +1 -1
|
@@ -552,8 +552,6 @@ var ChartAccountsListEnum;
|
|
|
552
552
|
ChartAccountsListEnum[ChartAccountsListEnum["VEHICLE_LOAN_INTEREST"] = 37] = "VEHICLE_LOAN_INTEREST";
|
|
553
553
|
ChartAccountsListEnum[ChartAccountsListEnum["VEHICLE_LOAN_PRINCIPAL"] = 38] = "VEHICLE_LOAN_PRINCIPAL";
|
|
554
554
|
ChartAccountsListEnum[ChartAccountsListEnum["HOME_OFFICE_HOURS"] = 103] = "HOME_OFFICE_HOURS";
|
|
555
|
-
ChartAccountsListEnum[ChartAccountsListEnum["PARTNERSHIP_EXPENSES"] = 156] = "PARTNERSHIP_EXPENSES";
|
|
556
|
-
ChartAccountsListEnum[ChartAccountsListEnum["TRUST_EXPENSES"] = 157] = "TRUST_EXPENSES";
|
|
557
555
|
ChartAccountsListEnum[ChartAccountsListEnum["INTEREST_CHARGED_BY_ATO"] = 278] = "INTEREST_CHARGED_BY_ATO";
|
|
558
556
|
ChartAccountsListEnum[ChartAccountsListEnum["LITIGATION_COSTS"] = 280] = "LITIGATION_COSTS";
|
|
559
557
|
ChartAccountsListEnum[ChartAccountsListEnum["ACCOUNTANT_TAX_AGENT_FEES"] = 282] = "ACCOUNTANT_TAX_AGENT_FEES";
|
|
@@ -599,6 +597,18 @@ var ChartAccountsListEnum;
|
|
|
599
597
|
ChartAccountsListEnum[ChartAccountsListEnum["ELECTRICITY_AND_GAS"] = 234] = "ELECTRICITY_AND_GAS";
|
|
600
598
|
ChartAccountsListEnum[ChartAccountsListEnum["TELEPHONE"] = 255] = "TELEPHONE";
|
|
601
599
|
ChartAccountsListEnum[ChartAccountsListEnum["HOME_OFFICE_CLEANING"] = 11871] = "HOME_OFFICE_CLEANING";
|
|
600
|
+
ChartAccountsListEnum[ChartAccountsListEnum["PARTNERSHIP_EXPENSES"] = 609] = "PARTNERSHIP_EXPENSES";
|
|
601
|
+
ChartAccountsListEnum[ChartAccountsListEnum["TRUST_EXPENSES"] = 610] = "TRUST_EXPENSES";
|
|
602
|
+
ChartAccountsListEnum[ChartAccountsListEnum["LANDCARE_EXPENSES"] = 1019] = "LANDCARE_EXPENSES";
|
|
603
|
+
ChartAccountsListEnum[ChartAccountsListEnum["OTHER_DEDUCTIONS"] = 1020] = "OTHER_DEDUCTIONS";
|
|
604
|
+
ChartAccountsListEnum[ChartAccountsListEnum["LANDCARE_WATER"] = 1023] = "LANDCARE_WATER";
|
|
605
|
+
ChartAccountsListEnum[ChartAccountsListEnum["OTHER_DEDUCTIONS_PRIMARY"] = 1024] = "OTHER_DEDUCTIONS_PRIMARY";
|
|
606
|
+
ChartAccountsListEnum[ChartAccountsListEnum["OVERSEAS_WORK_EXPENSES"] = 1034] = "OVERSEAS_WORK_EXPENSES";
|
|
607
|
+
ChartAccountsListEnum[ChartAccountsListEnum["FOREIGN_TAX_WITHHELD_WORK"] = 1035] = "FOREIGN_TAX_WITHHELD_WORK";
|
|
608
|
+
ChartAccountsListEnum[ChartAccountsListEnum["OTHER_OVERSEAS_EXPENSES"] = 1045] = "OTHER_OVERSEAS_EXPENSES";
|
|
609
|
+
ChartAccountsListEnum[ChartAccountsListEnum["FOREIGN_PENSION_EXPENSES"] = 1054] = "FOREIGN_PENSION_EXPENSES";
|
|
610
|
+
ChartAccountsListEnum[ChartAccountsListEnum["ANNUITY_PURCHASE_PRICE"] = 1055] = "ANNUITY_PURCHASE_PRICE";
|
|
611
|
+
ChartAccountsListEnum[ChartAccountsListEnum["FOREIGN_TAX_WITHHELD_PENSION"] = 1056] = "FOREIGN_TAX_WITHHELD_PENSION";
|
|
602
612
|
})(ChartAccountsListEnum || (ChartAccountsListEnum = {}));
|
|
603
613
|
|
|
604
614
|
var BusinessChartAccountsEnum;
|
|
@@ -3920,6 +3930,9 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
3920
3930
|
isHoldingExpense() {
|
|
3921
3931
|
return [ChartAccountsCategoryEnum.HOLDING_EXPENSE].includes(this.category);
|
|
3922
3932
|
}
|
|
3933
|
+
isHoldingIncome() {
|
|
3934
|
+
return [ChartAccountsCategoryEnum.HOLDING_INCOME].includes(this.category);
|
|
3935
|
+
}
|
|
3923
3936
|
/**
|
|
3924
3937
|
* Check if chart accounts is property expense
|
|
3925
3938
|
*/
|
|
@@ -4078,6 +4091,22 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
4078
4091
|
isPersonalTank() {
|
|
4079
4092
|
return CHART_ACCOUNTS_CATEGORIES.personal.includes(this.category);
|
|
4080
4093
|
}
|
|
4094
|
+
hasWorkExpensePayer() {
|
|
4095
|
+
return [
|
|
4096
|
+
ChartAccountsListEnum.PARTNERSHIP_EXPENSES,
|
|
4097
|
+
ChartAccountsListEnum.TRUST_EXPENSES,
|
|
4098
|
+
ChartAccountsListEnum.LANDCARE_EXPENSES,
|
|
4099
|
+
ChartAccountsListEnum.OTHER_DEDUCTIONS,
|
|
4100
|
+
ChartAccountsListEnum.LANDCARE_WATER,
|
|
4101
|
+
ChartAccountsListEnum.OTHER_DEDUCTIONS_PRIMARY,
|
|
4102
|
+
ChartAccountsListEnum.OVERSEAS_WORK_EXPENSES,
|
|
4103
|
+
ChartAccountsListEnum.FOREIGN_TAX_WITHHELD_WORK,
|
|
4104
|
+
ChartAccountsListEnum.OTHER_OVERSEAS_EXPENSES,
|
|
4105
|
+
ChartAccountsListEnum.FOREIGN_PENSION_EXPENSES,
|
|
4106
|
+
ChartAccountsListEnum.ANNUITY_PURCHASE_PRICE,
|
|
4107
|
+
ChartAccountsListEnum.FOREIGN_TAX_WITHHELD_PENSION,
|
|
4108
|
+
].includes(this.id);
|
|
4109
|
+
}
|
|
4081
4110
|
}
|
|
4082
4111
|
__decorate([
|
|
4083
4112
|
Type(() => ChartAccountsHeading)
|
|
@@ -8764,14 +8793,14 @@ class MyTaxPartnershipsAndTrusts {
|
|
|
8764
8793
|
constructor(transactions, incomeSources) {
|
|
8765
8794
|
this.transactions = transactions;
|
|
8766
8795
|
this.incomeSources = incomeSources;
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
this.partnershipsIncomeTotalAmount =
|
|
8772
|
-
this.partnershipsExpenseTotalAmount =
|
|
8773
|
-
this.trustsIncomeTotalAmount =
|
|
8774
|
-
this.trustsExpenseTotalAmount =
|
|
8796
|
+
const partnershipsIncomes = this.transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.PARTNERSHIP_INCOME);
|
|
8797
|
+
const partnershipsExpenses = this.transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.PARTNERSHIP_EXPENSES);
|
|
8798
|
+
const trustsIncomes = this.transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.TRUST_INCOME);
|
|
8799
|
+
const trustsExpenses = this.transactions.filterBy('chartAccounts.id', ChartAccountsListEnum.TRUST_EXPENSES);
|
|
8800
|
+
this.partnershipsIncomeTotalAmount = partnershipsIncomes.sumBy('amount');
|
|
8801
|
+
this.partnershipsExpenseTotalAmount = partnershipsExpenses.sumBy('amount');
|
|
8802
|
+
this.trustsIncomeTotalAmount = trustsIncomes.sumBy('amount');
|
|
8803
|
+
this.trustsExpenseTotalAmount = trustsExpenses.sumBy('amount');
|
|
8775
8804
|
this.partnershipsNetNonPrimaryProductionAmount = this.partnershipsIncomeTotalAmount - this.partnershipsExpenseTotalAmount;
|
|
8776
8805
|
this.trustsNetNonPrimaryProductionAmount = this.trustsIncomeTotalAmount - this.trustsExpenseTotalAmount;
|
|
8777
8806
|
this.frankingCreditsTotal = this.transactions
|
|
@@ -8779,7 +8808,7 @@ class MyTaxPartnershipsAndTrusts {
|
|
|
8779
8808
|
.getTransactionsMetaFields()
|
|
8780
8809
|
.filterBy('chartAccountsMetaField.id', ChartAccountsMetaFieldListEnum.FRANKING_CREDIT)
|
|
8781
8810
|
.sumBy('value');
|
|
8782
|
-
this.trustsIncomeTotalTax =
|
|
8811
|
+
this.trustsIncomeTotalTax = trustsIncomes.sumBy('tax');
|
|
8783
8812
|
this.frankingCreditsTotal = this.transactions
|
|
8784
8813
|
.filterBy('chartAccounts.heading.id', ChartAccountsHeadingTaxableEnum.PARTNERSHIPS_AND_TRUSTS_INCOME)
|
|
8785
8814
|
.getTransactionsMetaFields()
|
|
@@ -29475,7 +29504,8 @@ class WorkTransactionForm extends TransactionForm {
|
|
|
29475
29504
|
metaFields: new FormArray((transaction.metaFields || []).map((transactionMetaField) => new FormGroup({
|
|
29476
29505
|
value: new FormControl(transactionMetaField.value),
|
|
29477
29506
|
chartAccountsMetaField: new FormControl(transactionMetaField.chartAccountsMetaField)
|
|
29478
|
-
})))
|
|
29507
|
+
}))),
|
|
29508
|
+
incomeSource: new FormControl(transaction.incomeSource, [Validators.required, autocompleteValidator()]),
|
|
29479
29509
|
}));
|
|
29480
29510
|
// forbid to edit chartAccounts if it's in edit mode
|
|
29481
29511
|
// if (transaction.id) {
|
|
@@ -29596,9 +29626,12 @@ class WorkIncomeForm extends WorkTransactionForm {
|
|
|
29596
29626
|
}
|
|
29597
29627
|
|
|
29598
29628
|
class WorkExpenseForm extends WorkTransactionForm {
|
|
29599
|
-
constructor(transaction, registeredForGst, allocations, homeOfficeClaim
|
|
29600
|
-
super(transaction, registeredForGst, allocations
|
|
29629
|
+
constructor(transaction, registeredForGst, allocations, homeOfficeClaim) {
|
|
29630
|
+
super(transaction, registeredForGst, allocations);
|
|
29601
29631
|
this.homeOfficeClaim = homeOfficeClaim;
|
|
29632
|
+
if (!transaction.chartAccounts?.hasWorkExpensePayer()) {
|
|
29633
|
+
this.get('incomeSource').disable();
|
|
29634
|
+
}
|
|
29602
29635
|
// amount set automatically for chartAccounts with hours meta field
|
|
29603
29636
|
if (transaction.getMetaFieldValue(ChartAccountsMetaFieldListEnum.HOURS)) {
|
|
29604
29637
|
this.get('amount').disable();
|
|
@@ -29628,12 +29661,17 @@ class WorkExpenseForm extends WorkTransactionForm {
|
|
|
29628
29661
|
watchChartAccounts() {
|
|
29629
29662
|
super.watchChartAccounts();
|
|
29630
29663
|
this.get('chartAccounts').valueChanges.subscribe((chartAccounts) => {
|
|
29631
|
-
if (
|
|
29632
|
-
|
|
29664
|
+
if (chartAccounts.hasWorkExpensePayer()) {
|
|
29665
|
+
this.get('incomeSource').enable();
|
|
29666
|
+
}
|
|
29667
|
+
else {
|
|
29668
|
+
this.get('incomeSource').disable();
|
|
29669
|
+
}
|
|
29670
|
+
if (chartAccounts.isHomeOfficeExpense() && this.homeOfficeClaim) {
|
|
29671
|
+
const claims = this.homeOfficeClaim.getChartAccountsClaims();
|
|
29672
|
+
this.get('claimPercent').patchValue(claims.get(chartAccounts.id));
|
|
29673
|
+
this.get('claimPercent').disable();
|
|
29633
29674
|
}
|
|
29634
|
-
const claims = this.homeOfficeClaim.getChartAccountsClaims();
|
|
29635
|
-
this.get('claimPercent').patchValue(claims.get(chartAccounts.id));
|
|
29636
|
-
this.get('claimPercent').disable();
|
|
29637
29675
|
});
|
|
29638
29676
|
}
|
|
29639
29677
|
}
|