taxtank-core 0.21.8 → 0.21.11
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/bundles/taxtank-core.umd.js +264 -128
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/collection.js +7 -1
- package/esm2015/lib/db/Enums/chart-accounts-heading-list.enum.js +8 -1
- package/esm2015/lib/db/Enums/income-source-forecast-trust-type.enum.js +15 -0
- package/esm2015/lib/db/Enums/income-source-type-list-other.enum.js +3 -2
- package/esm2015/lib/db/Models/incomeSource/income-source-forecast.js +1 -1
- package/esm2015/lib/forms/abstract.form.js +6 -1
- package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +9 -42
- package/esm2015/lib/forms/bank/bank-account/bank-account-allocation.form.js +31 -0
- package/esm2015/lib/forms/bank/bank-account/bank-account-import.form.js +4 -30
- package/esm2015/lib/forms/bank/bank-account/bank-account-properties.form.js +28 -7
- package/esm2015/lib/forms/index.js +2 -1
- package/esm2015/lib/forms/report/my-tax/my-tax-deductions.form.js +9 -3
- package/esm2015/lib/forms/report/my-tax/my-tax-partnerships-and-trusts.form.js +5 -2
- package/esm2015/lib/interfaces/income-source-forecast.interface.js +1 -1
- package/esm2015/lib/models/income-source/income-source-type.js +3 -3
- package/esm2015/lib/models/report/my-tax/my-tax-deductions/deduction-fields.const.js +9 -2
- package/esm2015/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.js +16 -16
- package/esm2015/lib/models/report/my-tax/my-tax-estimate/my-tax-estimate.js +3 -3
- package/esm2015/lib/models/report/my-tax/my-tax-interest/my-tax-interest.js +2 -2
- package/esm2015/lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts.js +20 -2
- package/esm2015/lib/models/report/my-tax/my-tax-rent/my-tax-rent.js +35 -9
- package/esm2015/lib/validators/conditional.validator.js +26 -0
- package/esm2015/lib/validators/fields-sum.validator.js +26 -0
- package/esm2015/lib/validators/index.js +2 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/taxtank-core.js +255 -124
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/collection.d.ts +2 -0
- package/lib/db/Enums/chart-accounts-heading-list.enum.d.ts +7 -0
- package/lib/db/Enums/income-source-forecast-trust-type.enum.d.ts +13 -0
- package/lib/db/Enums/income-source-type-list-other.enum.d.ts +3 -2
- package/lib/db/Models/incomeSource/income-source-forecast.d.ts +3 -1
- package/lib/forms/abstract.form.d.ts +4 -0
- package/lib/forms/bank/bank-account/bank-account-add-manual.form.d.ts +2 -6
- package/lib/forms/bank/bank-account/bank-account-allocation.form.d.ts +7 -0
- package/lib/forms/bank/bank-account/bank-account-import.form.d.ts +2 -8
- package/lib/forms/bank/bank-account/bank-account-properties.form.d.ts +1 -0
- package/lib/forms/index.d.ts +1 -0
- package/lib/forms/report/my-tax/my-tax-deductions.form.d.ts +1 -1
- package/lib/forms/report/my-tax/my-tax-partnerships-and-trusts.form.d.ts +1 -1
- package/lib/interfaces/income-source-forecast.interface.d.ts +2 -0
- package/lib/models/report/my-tax/my-tax-partnerships-and-trusts/my-tax-partnerships-and-trusts.d.ts +9 -1
- package/lib/models/report/my-tax/my-tax-rent/my-tax-rent.d.ts +11 -1
- package/lib/validators/conditional.validator.d.ts +2 -0
- package/lib/validators/fields-sum.validator.d.ts +8 -0
- package/lib/validators/index.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -2867,6 +2867,12 @@
|
|
|
2867
2867
|
Collection.prototype.removeBy = function (path, values) {
|
|
2868
2868
|
return this.filter(function (item) { return !(Array.isArray(values) ? values : [values]).includes(get__default["default"](item, path)); });
|
|
2869
2869
|
};
|
|
2870
|
+
Collection.prototype.minBy = function (path) {
|
|
2871
|
+
return this.items.reduce(function (prev, current) { return (get__default["default"](prev, path) < get__default["default"](current, path) ? prev : current); });
|
|
2872
|
+
};
|
|
2873
|
+
Collection.prototype.maxBy = function (path) {
|
|
2874
|
+
return this.items.reduce(function (prev, current) { return (get__default["default"](prev, path) > get__default["default"](current, path) ? prev : current); });
|
|
2875
|
+
};
|
|
2870
2876
|
return Collection;
|
|
2871
2877
|
}());
|
|
2872
2878
|
|
|
@@ -5702,10 +5708,16 @@
|
|
|
5702
5708
|
(function (IncomeSourceTypeListOtherEnum) {
|
|
5703
5709
|
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PSI"] = 6] = "PSI";
|
|
5704
5710
|
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
|
|
5705
|
-
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["
|
|
5711
|
+
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["TRUSTS"] = 9] = "TRUSTS";
|
|
5706
5712
|
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["OTHER_INCOME"] = 10] = "OTHER_INCOME";
|
|
5713
|
+
IncomeSourceTypeListOtherEnum[IncomeSourceTypeListOtherEnum["PARTNERSHIPS"] = 12] = "PARTNERSHIPS";
|
|
5707
5714
|
})(exports.IncomeSourceTypeListOtherEnum || (exports.IncomeSourceTypeListOtherEnum = {}));
|
|
5708
5715
|
|
|
5716
|
+
exports.IncomeSourceTypeListSoleEnum = void 0;
|
|
5717
|
+
(function (IncomeSourceTypeListSoleEnum) {
|
|
5718
|
+
IncomeSourceTypeListSoleEnum[IncomeSourceTypeListSoleEnum["SOLE_TRADER"] = 7] = "SOLE_TRADER";
|
|
5719
|
+
})(exports.IncomeSourceTypeListSoleEnum || (exports.IncomeSourceTypeListSoleEnum = {}));
|
|
5720
|
+
|
|
5709
5721
|
var IncomeSourceType = /** @class */ (function (_super) {
|
|
5710
5722
|
__extends(IncomeSourceType, _super);
|
|
5711
5723
|
function IncomeSourceType() {
|
|
@@ -5721,8 +5733,7 @@
|
|
|
5721
5733
|
return !!exports.IncomeSourceTypeListOtherEnum[this.id];
|
|
5722
5734
|
};
|
|
5723
5735
|
IncomeSourceType.prototype.isSole = function () {
|
|
5724
|
-
|
|
5725
|
-
return !!exports.IncomeSourceTypeListOtherEnum[this.id];
|
|
5736
|
+
return !!exports.IncomeSourceTypeListSoleEnum[this.id];
|
|
5726
5737
|
};
|
|
5727
5738
|
Object.defineProperty(IncomeSourceType.prototype, "type", {
|
|
5728
5739
|
get: function () {
|
|
@@ -7148,6 +7159,13 @@
|
|
|
7148
7159
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["HOME_OFFICE_RUNNING"] = 17] = "HOME_OFFICE_RUNNING";
|
|
7149
7160
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["TOOLS_EQUIPMENT"] = 18] = "TOOLS_EQUIPMENT";
|
|
7150
7161
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["HOME_OFFICE_OCCUPANCY"] = 19] = "HOME_OFFICE_OCCUPANCY";
|
|
7162
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["AWARD_OVERTIME_MEAL_ALLOWANCE_EXPENSE"] = 20] = "AWARD_OVERTIME_MEAL_ALLOWANCE_EXPENSE";
|
|
7163
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["NEWSPAPER"] = 21] = "NEWSPAPER";
|
|
7164
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["PRINTING_POSTAGE_STATIONERY"] = 22] = "PRINTING_POSTAGE_STATIONERY";
|
|
7165
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["SEMINARS_ETC"] = 23] = "SEMINARS_ETC";
|
|
7166
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["TELEPHONE"] = 24] = "TELEPHONE";
|
|
7167
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["UNION_FEES"] = 25] = "UNION_FEES";
|
|
7168
|
+
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["OTHER"] = 26] = "OTHER";
|
|
7151
7169
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["DONATIONS"] = 27] = "DONATIONS";
|
|
7152
7170
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["PSI"] = 30] = "PSI";
|
|
7153
7171
|
ChartAccountsHeadingListEnum[ChartAccountsHeadingListEnum["BONUSES"] = 34] = "BONUSES";
|
|
@@ -7238,10 +7256,20 @@
|
|
|
7238
7256
|
DepreciationWriteOffAmountEnum[DepreciationWriteOffAmountEnum["BORROWING_EXPENSES"] = 100] = "BORROWING_EXPENSES";
|
|
7239
7257
|
})(exports.DepreciationWriteOffAmountEnum || (exports.DepreciationWriteOffAmountEnum = {}));
|
|
7240
7258
|
|
|
7241
|
-
exports.
|
|
7242
|
-
(function (
|
|
7243
|
-
|
|
7244
|
-
|
|
7259
|
+
exports.IncomeSourceForecastTrustTypeEnum = void 0;
|
|
7260
|
+
(function (IncomeSourceForecastTrustTypeEnum) {
|
|
7261
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["SPECIAL_DISABILITY_TRUST"] = 1] = "SPECIAL_DISABILITY_TRUST";
|
|
7262
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["DECEASED_ESTATE"] = 2] = "DECEASED_ESTATE";
|
|
7263
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["FIXED_TRUST"] = 3] = "FIXED_TRUST";
|
|
7264
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["HYBRID_TRUST"] = 4] = "HYBRID_TRUST";
|
|
7265
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["DISCRETIONARY_SERVICE_TRUST"] = 5] = "DISCRETIONARY_SERVICE_TRUST";
|
|
7266
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["DISCRETIONARY_TRADING_TRUST"] = 6] = "DISCRETIONARY_TRADING_TRUST";
|
|
7267
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["DISCRETIONARY_INVESTMENT_TRUST"] = 7] = "DISCRETIONARY_INVESTMENT_TRUST";
|
|
7268
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["CASH_MANAGEMENT_UNIT_TRUST"] = 8] = "CASH_MANAGEMENT_UNIT_TRUST";
|
|
7269
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["PUBLIC_UNIT_TRUST_LISTED"] = 9] = "PUBLIC_UNIT_TRUST_LISTED";
|
|
7270
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["PUBLIC_UNIT_TRUST_UNLISTED"] = 10] = "PUBLIC_UNIT_TRUST_UNLISTED";
|
|
7271
|
+
IncomeSourceForecastTrustTypeEnum[IncomeSourceForecastTrustTypeEnum["TESTAMENTARY_TRUST"] = 11] = "TESTAMENTARY_TRUST";
|
|
7272
|
+
})(exports.IncomeSourceForecastTrustTypeEnum || (exports.IncomeSourceForecastTrustTypeEnum = {}));
|
|
7245
7273
|
|
|
7246
7274
|
exports.InviteStatusEnum = void 0;
|
|
7247
7275
|
(function (InviteStatusEnum) {
|
|
@@ -9344,7 +9372,14 @@
|
|
|
9344
9372
|
exports.ChartAccountsHeadingListEnum.OTHER_WORK_RELATED_EXPENSES,
|
|
9345
9373
|
exports.ChartAccountsHeadingListEnum.SUBSCRIPTIONS,
|
|
9346
9374
|
exports.ChartAccountsHeadingListEnum.HOME_OFFICE_RUNNING,
|
|
9347
|
-
exports.ChartAccountsHeadingListEnum.HOME_OFFICE_OCCUPANCY
|
|
9375
|
+
exports.ChartAccountsHeadingListEnum.HOME_OFFICE_OCCUPANCY,
|
|
9376
|
+
exports.ChartAccountsHeadingListEnum.AWARD_OVERTIME_MEAL_ALLOWANCE_EXPENSE,
|
|
9377
|
+
exports.ChartAccountsHeadingListEnum.NEWSPAPER,
|
|
9378
|
+
exports.ChartAccountsHeadingListEnum.PRINTING_POSTAGE_STATIONERY,
|
|
9379
|
+
exports.ChartAccountsHeadingListEnum.SEMINARS_ETC,
|
|
9380
|
+
exports.ChartAccountsHeadingListEnum.TELEPHONE,
|
|
9381
|
+
exports.ChartAccountsHeadingListEnum.UNION_FEES,
|
|
9382
|
+
exports.ChartAccountsHeadingListEnum.OTHER
|
|
9348
9383
|
],
|
|
9349
9384
|
workRelatedSelfEducationExpenses: [
|
|
9350
9385
|
exports.ChartAccountsHeadingListEnum.SELF_EDUCATIONAL_EXPENSES
|
|
@@ -9420,45 +9455,45 @@
|
|
|
9420
9455
|
this.workRelatedClothingExpenses = this.transactions
|
|
9421
9456
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.workRelatedClothingExpenses);
|
|
9422
9457
|
this.personalSuperContributions = this.transactions
|
|
9423
|
-
.filterBy('chartAccounts.
|
|
9458
|
+
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.personalSuperContributions);
|
|
9424
9459
|
this.workRelatedSelfEducationExpenses = this.transactions
|
|
9425
9460
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.workRelatedSelfEducationExpenses);
|
|
9426
9461
|
this.vehicleExpensesTotalAmount = this.getVehicleExpensesTotalAmount();
|
|
9427
9462
|
this.workRelatedTravelExpensesTotalAmount = this.transactions
|
|
9428
9463
|
.filterBy('chartAccounts.heading.id', exports.ChartAccountsHeadingListEnum.WORK_RELATED_TRAVEL_EXPENSES)
|
|
9429
|
-
.sumBy('
|
|
9464
|
+
.sumBy('claimAmount');
|
|
9430
9465
|
this.workRelatedClothingType = this.workRelatedClothingExpenses.length ? exports.DeductionClothingTypeEnum.COMPULSORY_C : null;
|
|
9431
|
-
this.workRelatedClothingTotalAmount = this.workRelatedClothingExpenses.sumBy('
|
|
9466
|
+
this.workRelatedClothingTotalAmount = this.workRelatedClothingExpenses.sumBy('claimAmount');
|
|
9432
9467
|
this.workRelatedSelfEducationType = this.workRelatedSelfEducationExpenses.length ?
|
|
9433
9468
|
exports.DeductionSelfEducationTypeEnum.IMPROVE_SKILLS_FOR_CURRENT_EARNINGS_K : null;
|
|
9434
|
-
this.workRelatedSelfEducationTotalAmount = this.workRelatedSelfEducationExpenses.sumBy('
|
|
9469
|
+
this.workRelatedSelfEducationTotalAmount = this.workRelatedSelfEducationExpenses.sumBy('claimAmount');
|
|
9435
9470
|
this.lowValuePoolDeductionTotalAmount = this.depreciations.getByTankType(exports.TankTypeEnum.WORK)
|
|
9436
9471
|
.getLowValuePoolDepreciations().sumBy('claimAmount');
|
|
9437
9472
|
this.interestExpensesTotalAmount = this.transactions
|
|
9438
9473
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.interestExpenses)
|
|
9439
|
-
.sumBy('
|
|
9474
|
+
.sumBy('claimAmount');
|
|
9440
9475
|
this.dividendExpensesTotalAmount = this.transactions
|
|
9441
9476
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.dividendExpenses)
|
|
9442
|
-
.sumBy('
|
|
9477
|
+
.sumBy('claimAmount');
|
|
9443
9478
|
this.donationsTotalAmount = this.transactions
|
|
9444
9479
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.donations)
|
|
9445
|
-
.sumBy('
|
|
9480
|
+
.sumBy('claimAmount');
|
|
9446
9481
|
this.interestsChargedByATOTotalAmount = this.transactions
|
|
9447
9482
|
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.interestsChargedByATO)
|
|
9448
|
-
.sumBy('
|
|
9483
|
+
.sumBy('claimAmount');
|
|
9449
9484
|
this.litigationCostsTotalAmount = this.transactions
|
|
9450
9485
|
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.litigationCosts)
|
|
9451
|
-
.sumBy('
|
|
9486
|
+
.sumBy('claimAmount');
|
|
9452
9487
|
this.otherManagingCostsTotalAmount = this.transactions
|
|
9453
9488
|
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.otherManagingCosts)
|
|
9454
|
-
.sumBy('
|
|
9455
|
-
this.personalSuperContributionsTotalAmount = this.personalSuperContributions.sumBy('
|
|
9489
|
+
.sumBy('claimAmount');
|
|
9490
|
+
this.personalSuperContributionsTotalAmount = this.personalSuperContributions.sumBy('claimAmount');
|
|
9456
9491
|
this.forestryManagedInvestmentSchemesDeductionsTotalAmount = this.transactions
|
|
9457
9492
|
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.forestryManagedInvestmentSchemesDeductions)
|
|
9458
|
-
.sumBy('
|
|
9493
|
+
.sumBy('claimAmount');
|
|
9459
9494
|
this.otherDeductionsTotalAmount = this.transactions
|
|
9460
9495
|
.filterBy('chartAccounts.id', DEDUCTION_CATEGORIES.otherDeductions)
|
|
9461
|
-
.sumBy('
|
|
9496
|
+
.sumBy('claimAmount');
|
|
9462
9497
|
}
|
|
9463
9498
|
MyTaxDeductions.prototype.getVehicleExpensesTotalAmount = function () {
|
|
9464
9499
|
var _a;
|
|
@@ -9469,7 +9504,7 @@
|
|
|
9469
9504
|
};
|
|
9470
9505
|
MyTaxDeductions.prototype.setVehicleClaimData = function () {
|
|
9471
9506
|
this.klmsMethodClaimAmount = this.vehicleClaim.getKLMsClaimAmount(this.vehicleClaimRate);
|
|
9472
|
-
this.totalExpensesAmount = new VehicleExpenseCollection(this.transactions.getByTankType(this.vehicleClaim.tankType), this.depreciations.getByTankType(this.vehicleClaim.tankType), this.vehicleClaim).sumBy('
|
|
9507
|
+
this.totalExpensesAmount = new VehicleExpenseCollection(this.transactions.getByTankType(this.vehicleClaim.tankType), this.depreciations.getByTankType(this.vehicleClaim.tankType), this.vehicleClaim).sumBy('claimAmount');
|
|
9473
9508
|
};
|
|
9474
9509
|
/**
|
|
9475
9510
|
* Total amount from Other work related expenses and Tools & equipment depreciations
|
|
@@ -9477,7 +9512,7 @@
|
|
|
9477
9512
|
MyTaxDeductions.prototype.setOtherWorkRelatedExpensesTotalAmount = function () {
|
|
9478
9513
|
var otherIncomeRelatedExpenses = this.transactions
|
|
9479
9514
|
.filterBy('chartAccounts.heading.id', DEDUCTION_CATEGORIES.otherIncomeRelatedExpenses);
|
|
9480
|
-
this.otherWorkRelatedExpensesTotalAmount = Math.abs(otherIncomeRelatedExpenses.sumBy('
|
|
9515
|
+
this.otherWorkRelatedExpensesTotalAmount = Math.abs(otherIncomeRelatedExpenses.sumBy('claimAmount')) +
|
|
9481
9516
|
this.depreciations.filterBy('chartAccounts.heading.id', exports.ChartAccountsHeadingListEnum.TOOLS_EQUIPMENT).sumBy('claimAmount');
|
|
9482
9517
|
};
|
|
9483
9518
|
return MyTaxDeductions;
|
|
@@ -9536,8 +9571,8 @@
|
|
|
9536
9571
|
var taxOffsetsReportItem = summarySection.items.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.TAX_OFFSETS);
|
|
9537
9572
|
var lowMiddleIncomeTaxOffsets = this.getLowMiddleIncomeTaxOffsets(taxOffsetsReportItem);
|
|
9538
9573
|
var taxPayable = grossTaxPayableReportItem.items.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.TAX_ON_TAXABLE_INCOME).amount;
|
|
9539
|
-
var medicareLevy = medicareReportItem.details.findBy('name', 'Medicare Levy
|
|
9540
|
-
var medicareLevySurcharge = medicareReportItem.details.findBy('name', 'Medicare Levy
|
|
9574
|
+
var medicareLevy = medicareReportItem.details.findBy('name', 'Medicare Levy (based on single)').amount;
|
|
9575
|
+
var medicareLevySurcharge = medicareReportItem.details.findBy('name', 'Medicare Levy Surcharge').amount;
|
|
9541
9576
|
var taxCredits = summarySection.items.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.TAX_CREDITS).amount;
|
|
9542
9577
|
var taxOffsets = this.getTaxOffsets(taxOffsetsReportItem.amount, lowMiddleIncomeTaxOffsets);
|
|
9543
9578
|
return classTransformer.plainToClass(MyTaxEstimate, {
|
|
@@ -9645,7 +9680,7 @@
|
|
|
9645
9680
|
this.interestPaidTransactions = transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.ATO_INTEREST_PAID);
|
|
9646
9681
|
this.interestEarnedTotalAmount = this.interestEarnedTransactions.sumBy('amount');
|
|
9647
9682
|
this.interestEarnedTotalTax = this.interestEarnedTransactions.sumBy('tax');
|
|
9648
|
-
this.interestPaidTotalAmount = this.
|
|
9683
|
+
this.interestPaidTotalAmount = this.interestPaidTransactions.sumBy('amount');
|
|
9649
9684
|
}
|
|
9650
9685
|
return MyTaxInterest;
|
|
9651
9686
|
}());
|
|
@@ -9697,12 +9732,14 @@
|
|
|
9697
9732
|
}());
|
|
9698
9733
|
|
|
9699
9734
|
var MyTaxPartnershipsAndTrusts = /** @class */ (function () {
|
|
9700
|
-
function MyTaxPartnershipsAndTrusts(transactions) {
|
|
9735
|
+
function MyTaxPartnershipsAndTrusts(transactions, incomeSources) {
|
|
9701
9736
|
this.transactions = transactions;
|
|
9737
|
+
this.incomeSources = incomeSources;
|
|
9702
9738
|
this.partnershipIncomes = this.transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.PARTNERSHIP_INCOME);
|
|
9703
9739
|
this.partnershipExpenses = this.transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.PARTNERSHIP_EXPENSES);
|
|
9704
9740
|
this.trustsIncomes = this.transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.TRUST_INCOME);
|
|
9705
9741
|
this.trustsExpenses = this.transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.TRUST_EXPENSES);
|
|
9742
|
+
this.trustType = this.getTrustType();
|
|
9706
9743
|
this.netNonPrimaryProductionAmount = (this.partnershipIncomes.sumBy('amount') - this.partnershipExpenses.sumBy('amount')) +
|
|
9707
9744
|
(this.trustsIncomes.sumBy('amount') - this.trustsExpenses.sumBy('amount'));
|
|
9708
9745
|
this.partnershipsNetIncome = this.partnershipIncomes.sumBy('amount') -
|
|
@@ -9722,30 +9759,71 @@
|
|
|
9722
9759
|
.sumBy('value');
|
|
9723
9760
|
this.taxOffsetNRASTotalAmount = this.transactions.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.TAX_OFFSETS_N_R_A_S).sumBy('amount');
|
|
9724
9761
|
}
|
|
9762
|
+
/**
|
|
9763
|
+
* Get Income source forecast trust type, related to trust income with max amount
|
|
9764
|
+
*/
|
|
9765
|
+
MyTaxPartnershipsAndTrusts.prototype.getTrustType = function () {
|
|
9766
|
+
var filteredTrustIncomes = this.trustsIncomes
|
|
9767
|
+
.filterBy('incomeSource.id', this.incomeSources
|
|
9768
|
+
.removeBy('actualForecast.trustType', null)
|
|
9769
|
+
.getIds());
|
|
9770
|
+
if (!filteredTrustIncomes.length) {
|
|
9771
|
+
return null;
|
|
9772
|
+
}
|
|
9773
|
+
return this.incomeSources
|
|
9774
|
+
.findBy('id', filteredTrustIncomes.maxBy('amount').incomeSource.id)
|
|
9775
|
+
.actualForecast
|
|
9776
|
+
.trustType;
|
|
9777
|
+
};
|
|
9725
9778
|
return MyTaxPartnershipsAndTrusts;
|
|
9726
9779
|
}());
|
|
9727
9780
|
|
|
9728
9781
|
var MyTaxRent = /** @class */ (function () {
|
|
9729
|
-
function MyTaxRent(transactions, depreciations) {
|
|
9782
|
+
function MyTaxRent(transactions, depreciations, taxSummary) {
|
|
9730
9783
|
this.propertyExpenses = transactions.getPropertyTransactions().getExpenseTransactions();
|
|
9784
|
+
this.taxSummaryPropertySection = taxSummary.property;
|
|
9731
9785
|
this.grossRentAmount = transactions
|
|
9786
|
+
.getPropertyTransactions()
|
|
9732
9787
|
.getIncomeTransactions()
|
|
9733
9788
|
.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.RENTAL_INCOME)
|
|
9734
|
-
.sumBy('
|
|
9735
|
-
transactions
|
|
9736
|
-
|
|
9789
|
+
.sumBy('claimAmount') +
|
|
9790
|
+
transactions
|
|
9791
|
+
.getPropertyTransactions()
|
|
9792
|
+
.getIncomeTransactions()
|
|
9737
9793
|
.filterBy('chartAccounts.id', exports.ChartAccountsListEnum.OTHER_RENTAL_INCOME)
|
|
9738
|
-
.sumBy('
|
|
9794
|
+
.sumBy('claimAmount');
|
|
9739
9795
|
this.interestDeductionsAmount = Math.abs(transactions.getInterestTransactions().sumBy('amount'));
|
|
9740
9796
|
this.capitalWorksDeductionsAmount = Math.abs(depreciations.getCapitalDepreciations().sumBy('claimAmount'));
|
|
9741
|
-
this.otherRentalDeductionsAmount =
|
|
9742
|
-
|
|
9743
|
-
|
|
9797
|
+
this.otherRentalDeductionsAmount = this.calculateOtherRentalDeductionsAmount();
|
|
9798
|
+
/**
|
|
9799
|
+
* @Todo Vik uncomment when task TT-2009 will be implemented
|
|
9800
|
+
*/
|
|
9801
|
+
// this.otherRentalDeductionsAmount = depreciations.getByTankType(TankTypeEnum.PROPERTY).getAssets().claimAmount +
|
|
9802
|
+
// depreciations.getByTankType(TankTypeEnum.PROPERTY).getBorrowingExpenseDepreciations().claimAmount +
|
|
9803
|
+
// Math.abs(this.propertyExpenses.sumBy('claimAmount'));
|
|
9744
9804
|
this.netRent = this.grossRentAmount -
|
|
9745
9805
|
this.interestDeductionsAmount -
|
|
9746
9806
|
this.capitalWorksDeductionsAmount -
|
|
9747
9807
|
this.otherRentalDeductionsAmount;
|
|
9748
9808
|
}
|
|
9809
|
+
/**
|
|
9810
|
+
* @Todo Vik remove when TT-2009 will be implemented.
|
|
9811
|
+
* We use tax summary data here because claim amount from depreciation is different
|
|
9812
|
+
* from the claim amount that we get from tax summary (depreciation claim amount is not affected by property share,
|
|
9813
|
+
* property contract date, e.t.c.). Details in the TT-2009 task
|
|
9814
|
+
*/
|
|
9815
|
+
MyTaxRent.prototype.calculateOtherRentalDeductionsAmount = function () {
|
|
9816
|
+
var plantAndEquipmentAmount = Math.abs(this.taxSummaryPropertySection.items
|
|
9817
|
+
.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.DEPRECIATION)
|
|
9818
|
+
.amount);
|
|
9819
|
+
var borrowingExpensesAmount = Math.abs(this.taxSummaryPropertySection.items
|
|
9820
|
+
.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.BORROWING_EXPENSES)
|
|
9821
|
+
.amount);
|
|
9822
|
+
var otherRentalDeductionsAmount = Math.abs(this.taxSummaryPropertySection.items
|
|
9823
|
+
.findBy('taxReturnCategory.id', exports.TaxReturnCategoryListEnum.OTHER_RENTAL_DEDUCTIONS)
|
|
9824
|
+
.amount);
|
|
9825
|
+
return +Math.floor(plantAndEquipmentAmount + borrowingExpensesAmount + otherRentalDeductionsAmount).toFixed(2);
|
|
9826
|
+
};
|
|
9749
9827
|
return MyTaxRent;
|
|
9750
9828
|
}());
|
|
9751
9829
|
|
|
@@ -14950,6 +15028,7 @@
|
|
|
14950
15028
|
|
|
14951
15029
|
/**
|
|
14952
15030
|
* Abstract form class
|
|
15031
|
+
* @TODO rename to AbstractFormGroup
|
|
14953
15032
|
*/
|
|
14954
15033
|
var AbstractForm = /** @class */ (function (_super) {
|
|
14955
15034
|
__extends(AbstractForm, _super);
|
|
@@ -14976,6 +15055,10 @@
|
|
|
14976
15055
|
this.onSubmit.emit(model);
|
|
14977
15056
|
return model;
|
|
14978
15057
|
};
|
|
15058
|
+
AbstractForm.prototype.addControl = function (name, control, options) {
|
|
15059
|
+
_super.prototype.addControl.call(this, name, control, options);
|
|
15060
|
+
return this;
|
|
15061
|
+
};
|
|
14979
15062
|
AbstractForm.prototype.createModelInstance = function (data) {
|
|
14980
15063
|
if (data === void 0) { data = {}; }
|
|
14981
15064
|
return classTransformer.plainToClass(this.modelClass, data);
|
|
@@ -14983,30 +15066,61 @@
|
|
|
14983
15066
|
return AbstractForm;
|
|
14984
15067
|
}(forms.FormGroup));
|
|
14985
15068
|
|
|
15069
|
+
function conditionalValidator(condition, validator) {
|
|
15070
|
+
return function (control) {
|
|
15071
|
+
revalidateOnChanges(control);
|
|
15072
|
+
if (control && control.parent) {
|
|
15073
|
+
if (condition(control.parent)) {
|
|
15074
|
+
return validator(control);
|
|
15075
|
+
}
|
|
15076
|
+
}
|
|
15077
|
+
return null;
|
|
15078
|
+
};
|
|
15079
|
+
}
|
|
14986
15080
|
/**
|
|
14987
|
-
*
|
|
15081
|
+
* Conditional validator depends on other fields and should be updated on each form value change
|
|
14988
15082
|
*/
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
repaymentType: new forms.FormControl(loan.repaymentType, forms.Validators.required),
|
|
14997
|
-
interestRate: new forms.FormControl(loan.interestRate, [forms.Validators.required, forms.Validators.min(0), forms.Validators.max(100)]),
|
|
14998
|
-
interestType: new forms.FormControl(loan.interestType, forms.Validators.required),
|
|
14999
|
-
availableRedraw: new forms.FormControl(loan.availableRedraw, forms.Validators.required),
|
|
15000
|
-
commencementDate: new forms.FormControl(loan.commencementDate, forms.Validators.required),
|
|
15001
|
-
repaymentAmount: new forms.FormControl(loan.repaymentAmount, forms.Validators.required),
|
|
15002
|
-
repaymentFrequency: new forms.FormControl(loan.repaymentFrequency, forms.Validators.required)
|
|
15003
|
-
}, loan) || this;
|
|
15083
|
+
function revalidateOnChanges(control) {
|
|
15084
|
+
if (control && control.parent && !control['_revalidateOnChanges']) {
|
|
15085
|
+
control['_revalidateOnChanges'] = true;
|
|
15086
|
+
control.parent.valueChanges.pipe(operators.distinctUntilChanged(function (a, b) { return JSON.stringify(a) === JSON.stringify(b); }))
|
|
15087
|
+
.subscribe(function () {
|
|
15088
|
+
control.updateValueAndValidity({ emitEvent: false });
|
|
15089
|
+
});
|
|
15004
15090
|
}
|
|
15005
|
-
return
|
|
15006
|
-
}
|
|
15091
|
+
return;
|
|
15092
|
+
}
|
|
15093
|
+
|
|
15094
|
+
/**
|
|
15095
|
+
* Validator that check if sum amount of provided fields is greater than provided sum
|
|
15096
|
+
* @param field to check in each formArray element
|
|
15097
|
+
* @param summary to compare with fields sum
|
|
15098
|
+
* @param fieldAlias to show it in error message
|
|
15099
|
+
*/
|
|
15100
|
+
function fieldsSumValidator(field, summary, fieldAlias) {
|
|
15101
|
+
if (summary === void 0) { summary = 100; }
|
|
15102
|
+
return function (formArray) {
|
|
15103
|
+
// calculate sum of desired fields in formArray control
|
|
15104
|
+
var fieldsSum = formArray['controls']
|
|
15105
|
+
.reduce(function (acc, group) { return acc += group.get(field).value; }, 0);
|
|
15106
|
+
if (fieldsSum <= summary) {
|
|
15107
|
+
return null;
|
|
15108
|
+
}
|
|
15109
|
+
else {
|
|
15110
|
+
return {
|
|
15111
|
+
fieldsSum: {
|
|
15112
|
+
name: field,
|
|
15113
|
+
alias: fieldAlias,
|
|
15114
|
+
summary: summary
|
|
15115
|
+
}
|
|
15116
|
+
};
|
|
15117
|
+
}
|
|
15118
|
+
};
|
|
15119
|
+
}
|
|
15007
15120
|
|
|
15008
15121
|
/**
|
|
15009
15122
|
* Form array with bank account properties
|
|
15123
|
+
* @TODO create AbstractFormArray
|
|
15010
15124
|
*/
|
|
15011
15125
|
var BankAccountPropertiesForm = /** @class */ (function (_super) {
|
|
15012
15126
|
__extends(BankAccountPropertiesForm, _super);
|
|
@@ -15014,20 +15128,37 @@
|
|
|
15014
15128
|
if (bankAccountProperties === void 0) { bankAccountProperties = [classTransformer.plainToClass(BankAccountProperty, {})]; }
|
|
15015
15129
|
return _super.call(this, bankAccountProperties.map(function (bankAccountProperty) {
|
|
15016
15130
|
return new forms.FormGroup({
|
|
15017
|
-
property: new forms.FormControl(bankAccountProperty.property, forms.Validators.required),
|
|
15131
|
+
property: new forms.FormControl(bankAccountProperty === null || bankAccountProperty === void 0 ? void 0 : bankAccountProperty.property, forms.Validators.required),
|
|
15018
15132
|
percent: new forms.FormControl(bankAccountProperty.percent, forms.Validators.required)
|
|
15019
15133
|
});
|
|
15020
|
-
})
|
|
15134
|
+
}), [
|
|
15135
|
+
conditionalValidator(function (control) { return control.get('tankType').value === exports.TankTypeEnum.PROPERTY; }, forms.Validators.required),
|
|
15136
|
+
fieldsSumValidator('percent', 100)
|
|
15137
|
+
]) || this;
|
|
15021
15138
|
}
|
|
15022
15139
|
BankAccountPropertiesForm.prototype.add = function () {
|
|
15023
15140
|
this.push(new forms.FormGroup({
|
|
15024
15141
|
property: new forms.FormControl(null, forms.Validators.required),
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15142
|
+
// @TODO disable for loans
|
|
15143
|
+
percent: new forms.FormControl({ value: 100, disabled: !this.at(0).contains('percent') }, forms.Validators.required),
|
|
15144
|
+
// @TODO enable for loans
|
|
15145
|
+
// amount: new FormControl(
|
|
15146
|
+
// {value: this.bankAccount.currentBalance * bankAccountProperty.percent / 100},
|
|
15147
|
+
// [Validators.required, Validators.max(Math.abs(this.bankAccount.currentBalance))]
|
|
15148
|
+
// ),
|
|
15149
|
+
}));
|
|
15150
|
+
};
|
|
15151
|
+
// @TODO enable for loans
|
|
15152
|
+
// /**
|
|
15153
|
+
// * Recalculate property percentage for current property form group and round to no more than 3 decimal places
|
|
15154
|
+
// * @param amount: new control value
|
|
15155
|
+
// * @param currentPropertyGroup for which amount will be recalculated
|
|
15156
|
+
// */
|
|
15157
|
+
// recalculatePropertyPercentage(amount: number, currentPropertyGroup: FormGroup): void {
|
|
15158
|
+
// currentPropertyGroup.get('percent').setValue(
|
|
15159
|
+
// roundTo(amount / this.bankAccount.currentBalance, 3)
|
|
15160
|
+
// );
|
|
15161
|
+
// }
|
|
15031
15162
|
BankAccountPropertiesForm.prototype.enablePercent = function () {
|
|
15032
15163
|
this.controls.forEach(function (propertyFormGroup) {
|
|
15033
15164
|
propertyFormGroup.get('percent').enable();
|
|
@@ -15041,6 +15172,57 @@
|
|
|
15041
15172
|
return BankAccountPropertiesForm;
|
|
15042
15173
|
}(forms.FormArray));
|
|
15043
15174
|
|
|
15175
|
+
var BankAccountAllocationForm = /** @class */ (function (_super) {
|
|
15176
|
+
__extends(BankAccountAllocationForm, _super);
|
|
15177
|
+
function BankAccountAllocationForm(bankAccount) {
|
|
15178
|
+
var _this = _super.call(this, {
|
|
15179
|
+
tankType: new forms.FormControl(bankAccount ? bankAccount.tankType : null, forms.Validators.required),
|
|
15180
|
+
}, classTransformer.plainToClass(BankAccount, bankAccount || {})) || this;
|
|
15181
|
+
_this.bankAccount = bankAccount;
|
|
15182
|
+
if (bankAccount === null || bankAccount === void 0 ? void 0 : bankAccount.isPropertyTank()) {
|
|
15183
|
+
_this.addControl('bankAccountProperties', new BankAccountPropertiesForm(bankAccount.bankAccountProperties));
|
|
15184
|
+
}
|
|
15185
|
+
_this.watchTankType();
|
|
15186
|
+
return _this;
|
|
15187
|
+
}
|
|
15188
|
+
BankAccountAllocationForm.prototype.watchTankType = function () {
|
|
15189
|
+
var _this = this;
|
|
15190
|
+
this.get('tankType').valueChanges.subscribe(function (tankType) {
|
|
15191
|
+
var _a;
|
|
15192
|
+
// @TODO vik add businessAllocation
|
|
15193
|
+
if (tankType === exports.TankTypeEnum.PROPERTY) {
|
|
15194
|
+
_this.addControl('bankAccountProperties', new BankAccountPropertiesForm((_a = _this.bankAccount) === null || _a === void 0 ? void 0 : _a.bankAccountProperties));
|
|
15195
|
+
}
|
|
15196
|
+
else {
|
|
15197
|
+
_this.removeControl('bankAccountProperties');
|
|
15198
|
+
}
|
|
15199
|
+
});
|
|
15200
|
+
};
|
|
15201
|
+
return BankAccountAllocationForm;
|
|
15202
|
+
}(AbstractForm));
|
|
15203
|
+
|
|
15204
|
+
/**
|
|
15205
|
+
* Form with bank account loan details
|
|
15206
|
+
*/
|
|
15207
|
+
var BankAccountLoanForm = /** @class */ (function (_super) {
|
|
15208
|
+
__extends(BankAccountLoanForm, _super);
|
|
15209
|
+
function BankAccountLoanForm(loan) {
|
|
15210
|
+
if (loan === void 0) { loan = classTransformer.plainToClass(Loan, {}); }
|
|
15211
|
+
return _super.call(this, {
|
|
15212
|
+
type: new forms.FormControl(loan.type, forms.Validators.required),
|
|
15213
|
+
amount: new forms.FormControl(loan.amount, forms.Validators.required),
|
|
15214
|
+
repaymentType: new forms.FormControl(loan.repaymentType, forms.Validators.required),
|
|
15215
|
+
interestRate: new forms.FormControl(loan.interestRate, [forms.Validators.required, forms.Validators.min(0), forms.Validators.max(100)]),
|
|
15216
|
+
interestType: new forms.FormControl(loan.interestType, forms.Validators.required),
|
|
15217
|
+
availableRedraw: new forms.FormControl(loan.availableRedraw, forms.Validators.required),
|
|
15218
|
+
commencementDate: new forms.FormControl(loan.commencementDate, forms.Validators.required),
|
|
15219
|
+
repaymentAmount: new forms.FormControl(loan.repaymentAmount, forms.Validators.required),
|
|
15220
|
+
repaymentFrequency: new forms.FormControl(loan.repaymentFrequency, forms.Validators.required)
|
|
15221
|
+
}, loan) || this;
|
|
15222
|
+
}
|
|
15223
|
+
return BankAccountLoanForm;
|
|
15224
|
+
}(AbstractForm));
|
|
15225
|
+
|
|
15044
15226
|
/**
|
|
15045
15227
|
* Form is using for import basiq bank accounts.
|
|
15046
15228
|
* Basiq accounts has all data except tank type, properties and loan partially
|
|
@@ -15048,40 +15230,16 @@
|
|
|
15048
15230
|
var BankAccountImportForm = /** @class */ (function (_super) {
|
|
15049
15231
|
__extends(BankAccountImportForm, _super);
|
|
15050
15232
|
function BankAccountImportForm(bankAccount) {
|
|
15051
|
-
var _this = _super.call(this,
|
|
15052
|
-
tankType: new forms.FormControl(bankAccount.tankType, forms.Validators.required),
|
|
15053
|
-
}, bankAccount) || this;
|
|
15233
|
+
var _this = _super.call(this, bankAccount) || this;
|
|
15054
15234
|
if (bankAccount.isLoan()) {
|
|
15055
15235
|
_this.addControl('loan', new BankAccountLoanForm(bankAccount.loan));
|
|
15056
15236
|
}
|
|
15057
15237
|
// basiq account import form should be disabled (unchecked) by default
|
|
15058
15238
|
_this.disable();
|
|
15059
|
-
_this.listenEvents();
|
|
15060
15239
|
return _this;
|
|
15061
15240
|
}
|
|
15062
|
-
BankAccountImportForm.prototype.listenEvents = function () {
|
|
15063
|
-
this.listenTankTypeChanges();
|
|
15064
|
-
};
|
|
15065
|
-
/**
|
|
15066
|
-
* Add/Remove bank account properties form depends on selected tank type
|
|
15067
|
-
*/
|
|
15068
|
-
BankAccountImportForm.prototype.listenTankTypeChanges = function () {
|
|
15069
|
-
var _this = this;
|
|
15070
|
-
this.get('tankType').valueChanges.subscribe(function (tankType) {
|
|
15071
|
-
if (tankType === exports.TankTypeEnum.PROPERTY) {
|
|
15072
|
-
_this.addControl('bankAccountProperties', new BankAccountPropertiesForm());
|
|
15073
|
-
// property percent allowed only for loan bank accounts
|
|
15074
|
-
if (!_this.contains('loan')) {
|
|
15075
|
-
_this.get('bankAccountProperties').disablePercent();
|
|
15076
|
-
}
|
|
15077
|
-
}
|
|
15078
|
-
else {
|
|
15079
|
-
_this.removeControl('bankAccountProperties');
|
|
15080
|
-
}
|
|
15081
|
-
});
|
|
15082
|
-
};
|
|
15083
15241
|
return BankAccountImportForm;
|
|
15084
|
-
}(
|
|
15242
|
+
}(BankAccountAllocationForm));
|
|
15085
15243
|
|
|
15086
15244
|
/**
|
|
15087
15245
|
* Form is using for single manual bank account creation (not Basiq)
|
|
@@ -15089,20 +15247,18 @@
|
|
|
15089
15247
|
var BankAccountAddManualForm = /** @class */ (function (_super) {
|
|
15090
15248
|
__extends(BankAccountAddManualForm, _super);
|
|
15091
15249
|
function BankAccountAddManualForm(connection) {
|
|
15092
|
-
var _this = _super.call(this
|
|
15093
|
-
type: new forms.FormControl(null, forms.Validators.required),
|
|
15094
|
-
accountName: new forms.FormControl(null, forms.Validators.required),
|
|
15095
|
-
currentBalance: new forms.FormControl(null, forms.Validators.required),
|
|
15096
|
-
accountNumber: new forms.FormControl(null, [forms.Validators.required, forms.Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]),
|
|
15097
|
-
tankType: new forms.FormControl(null, forms.Validators.required),
|
|
15098
|
-
}, classTransformer.plainToClass(BankAccount, {})) || this;
|
|
15250
|
+
var _this = _super.call(this) || this;
|
|
15099
15251
|
_this.connection = connection;
|
|
15252
|
+
_this
|
|
15253
|
+
.addControl('type', new forms.FormControl(null, forms.Validators.required))
|
|
15254
|
+
.addControl('accountName', new forms.FormControl(null, forms.Validators.required))
|
|
15255
|
+
.addControl('currentBalance', new forms.FormControl(null, forms.Validators.required))
|
|
15256
|
+
.addControl('accountNumber', new forms.FormControl(null, [forms.Validators.required, forms.Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]));
|
|
15100
15257
|
_this.listenEvents();
|
|
15101
15258
|
return _this;
|
|
15102
15259
|
}
|
|
15103
15260
|
BankAccountAddManualForm.prototype.listenEvents = function () {
|
|
15104
15261
|
this.listenTypeChanges();
|
|
15105
|
-
this.listenTankTypeChanges();
|
|
15106
15262
|
};
|
|
15107
15263
|
/**
|
|
15108
15264
|
* Add/Remove loan form depends on selected bank account type
|
|
@@ -15112,38 +15268,9 @@
|
|
|
15112
15268
|
this.get('type').valueChanges.subscribe(function (type) {
|
|
15113
15269
|
if (BankAccount.loanTypes.includes(type)) {
|
|
15114
15270
|
_this.addControl('loan', new BankAccountLoanForm());
|
|
15115
|
-
// property percent allowed only for loan bank accounts
|
|
15116
|
-
if (_this.contains('bankAccountProperties')) {
|
|
15117
|
-
_this.get('bankAccountProperties').enablePercent();
|
|
15118
|
-
}
|
|
15119
15271
|
}
|
|
15120
15272
|
else {
|
|
15121
15273
|
_this.removeControl('loan');
|
|
15122
|
-
// property percent allowed only for loan bank accounts
|
|
15123
|
-
if (_this.contains('bankAccountProperties')) {
|
|
15124
|
-
_this.get('bankAccountProperties').disablePercent();
|
|
15125
|
-
}
|
|
15126
|
-
}
|
|
15127
|
-
});
|
|
15128
|
-
};
|
|
15129
|
-
/**
|
|
15130
|
-
* Add/Remove bank account properties form depends on selected tank type
|
|
15131
|
-
*/
|
|
15132
|
-
BankAccountAddManualForm.prototype.listenTankTypeChanges = function () {
|
|
15133
|
-
var _this = this;
|
|
15134
|
-
this.get('tankType').valueChanges.subscribe(function (tankType) {
|
|
15135
|
-
if (tankType === exports.TankTypeEnum.PROPERTY) {
|
|
15136
|
-
_this.addControl('bankAccountProperties', new BankAccountPropertiesForm());
|
|
15137
|
-
// property percent allowed only for loan bank accounts
|
|
15138
|
-
if (_this.contains('loan')) {
|
|
15139
|
-
_this.get('bankAccountProperties').enablePercent();
|
|
15140
|
-
}
|
|
15141
|
-
else {
|
|
15142
|
-
_this.get('bankAccountProperties').disablePercent();
|
|
15143
|
-
}
|
|
15144
|
-
}
|
|
15145
|
-
else {
|
|
15146
|
-
_this.removeControl('bankAccountProperties');
|
|
15147
15274
|
}
|
|
15148
15275
|
});
|
|
15149
15276
|
};
|
|
@@ -15154,7 +15281,7 @@
|
|
|
15154
15281
|
return _super.prototype.submit.call(this, { bankConnection: this.connection });
|
|
15155
15282
|
};
|
|
15156
15283
|
return BankAccountAddManualForm;
|
|
15157
|
-
}(
|
|
15284
|
+
}(BankAccountAllocationForm));
|
|
15158
15285
|
BankAccountAddManualForm.accountNumberPattern = '^[0-9]{6}[ ]{1}[0-9]{1,}$';
|
|
15159
15286
|
|
|
15160
15287
|
/**
|
|
@@ -15575,12 +15702,12 @@
|
|
|
15575
15702
|
value: deductions.workRelatedTravelExpensesTotalAmount,
|
|
15576
15703
|
disabled: true
|
|
15577
15704
|
}),
|
|
15578
|
-
workRelatedClothingType: new forms.FormControl(deductions.workRelatedClothingType, forms.Validators.required),
|
|
15705
|
+
workRelatedClothingType: new forms.FormControl(deductions.workRelatedClothingType, conditionalValidator(function () { return !!deductions.workRelatedClothingTotalAmount; }, forms.Validators.required)),
|
|
15579
15706
|
workRelatedClothingTotalAmount: new forms.FormControl({
|
|
15580
15707
|
value: deductions.workRelatedClothingTotalAmount,
|
|
15581
15708
|
disabled: true
|
|
15582
15709
|
}),
|
|
15583
|
-
workRelatedSelfEducationType: new forms.FormControl(deductions.workRelatedSelfEducationType, forms.Validators.required),
|
|
15710
|
+
workRelatedSelfEducationType: new forms.FormControl(deductions.workRelatedSelfEducationType, conditionalValidator(function () { return !!deductions.workRelatedSelfEducationTotalAmount; }, forms.Validators.required)),
|
|
15584
15711
|
workRelatedSelfEducationTotalAmount: new forms.FormControl({
|
|
15585
15712
|
value: deductions.workRelatedSelfEducationTotalAmount,
|
|
15586
15713
|
disabled: true
|
|
@@ -15617,6 +15744,11 @@
|
|
|
15617
15744
|
value: deductions.otherManagingCostsTotalAmount,
|
|
15618
15745
|
disabled: true
|
|
15619
15746
|
}),
|
|
15747
|
+
fundName: new forms.FormControl(''),
|
|
15748
|
+
hasFund: new forms.FormControl(false),
|
|
15749
|
+
fundABN: new forms.FormControl(''),
|
|
15750
|
+
fundTFN: new forms.FormControl(''),
|
|
15751
|
+
fundAccountNumber: new forms.FormControl(''),
|
|
15620
15752
|
personalSuperContributionsTotalAmount: new forms.FormControl({
|
|
15621
15753
|
value: deductions.personalSuperContributionsTotalAmount,
|
|
15622
15754
|
disabled: true
|
|
@@ -15895,7 +16027,9 @@
|
|
|
15895
16027
|
value: partnershipsAndTrusts.trustsNetIncome,
|
|
15896
16028
|
disabled: true
|
|
15897
16029
|
}),
|
|
15898
|
-
trustType: new forms.FormControl(
|
|
16030
|
+
trustType: new forms.FormControl(partnershipsAndTrusts.trustType, conditionalValidator(function (control) {
|
|
16031
|
+
return !!partnershipsAndTrusts.trustsIncomes.length;
|
|
16032
|
+
}, forms.Validators.required)),
|
|
15899
16033
|
partnershipsSmallBusinessNetIncome: new forms.FormControl(partnershipsAndTrusts.partnershipsSmallBusinessNetIncome, forms.Validators.required),
|
|
15900
16034
|
trustsSmallBusinessNetIncome: new forms.FormControl(partnershipsAndTrusts.trustsSmallBusinessNetIncome, forms.Validators.required),
|
|
15901
16035
|
taxPaidTotal: new forms.FormControl({
|
|
@@ -15951,6 +16085,7 @@
|
|
|
15951
16085
|
exports.Bank = Bank;
|
|
15952
16086
|
exports.BankAccount = BankAccount;
|
|
15953
16087
|
exports.BankAccountAddManualForm = BankAccountAddManualForm;
|
|
16088
|
+
exports.BankAccountAllocationForm = BankAccountAllocationForm;
|
|
15954
16089
|
exports.BankAccountCalculationService = BankAccountCalculationService;
|
|
15955
16090
|
exports.BankAccountChartData = BankAccountChartData;
|
|
15956
16091
|
exports.BankAccountCollection = BankAccountCollection;
|
|
@@ -16222,6 +16357,7 @@
|
|
|
16222
16357
|
exports.cloneDeep = cloneDeep;
|
|
16223
16358
|
exports.compare = compare;
|
|
16224
16359
|
exports.compareMatOptions = compareMatOptions;
|
|
16360
|
+
exports.conditionalValidator = conditionalValidator;
|
|
16225
16361
|
exports.createDate = createDate;
|
|
16226
16362
|
exports.displayMatOptions = displayMatOptions;
|
|
16227
16363
|
exports.enumToList = enumToList;
|