taxtank-core 0.8.3 → 0.8.4
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 +9 -6
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/collection.js +2 -2
- package/esm2015/lib/collections/depreciation.collection.js +3 -3
- package/esm2015/lib/models/property/property.js +7 -4
- package/fesm2015/taxtank-core.js +9 -6
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/collection.d.ts +1 -1
- package/lib/models/property/property.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1261,7 +1261,7 @@
|
|
|
1261
1261
|
Collection.prototype.getIds = function () {
|
|
1262
1262
|
return this.items.map(function (item) { return item['id']; });
|
|
1263
1263
|
};
|
|
1264
|
-
Collection.prototype.
|
|
1264
|
+
Collection.prototype.findBy = function (path, value) {
|
|
1265
1265
|
return this.items.find(function (item) { return get__default["default"](item, path) === value; });
|
|
1266
1266
|
};
|
|
1267
1267
|
Collection.prototype.getBy = function (path, value) {
|
|
@@ -1952,8 +1952,8 @@
|
|
|
1952
1952
|
});
|
|
1953
1953
|
DepreciationCollection.prototype.getClaimAmountByYear = function (year) {
|
|
1954
1954
|
if (year === void 0) { year = +localStorage.getItem('financialYear'); }
|
|
1955
|
-
return this.items.reduce(function (sum, depreciation) {
|
|
1956
|
-
return sum + depreciation.
|
|
1955
|
+
return this.amount - this.items.reduce(function (sum, depreciation) {
|
|
1956
|
+
return sum + depreciation.getCloseBalanceByYear(year);
|
|
1957
1957
|
}, 0);
|
|
1958
1958
|
};
|
|
1959
1959
|
DepreciationCollection.prototype.getCloseBalanceByYear = function (year) {
|
|
@@ -4756,7 +4756,7 @@
|
|
|
4756
4756
|
* net capital gain tax (includes tax exemptions)
|
|
4757
4757
|
*/
|
|
4758
4758
|
Property.prototype.calculateNetCGT = function (sale) {
|
|
4759
|
-
return this.getCGTExemptionRatio(sale) *
|
|
4759
|
+
return this.getCGTExemptionRatio(sale) * sale.cgt;
|
|
4760
4760
|
};
|
|
4761
4761
|
/**
|
|
4762
4762
|
* guess tax exemption based on property details
|
|
@@ -4770,7 +4770,7 @@
|
|
|
4770
4770
|
case this.category.id === PropertyCategoryListEnum.OWNER_OCCUPIED:
|
|
4771
4771
|
return exports.TaxExemptionEnum.PPR;
|
|
4772
4772
|
// exemption for investment properties owned for at least one year
|
|
4773
|
-
case this.
|
|
4773
|
+
case this.isOneYearExemptionApplicable(sale):
|
|
4774
4774
|
return exports.TaxExemptionEnum.ONE_YEAR_RULE;
|
|
4775
4775
|
default:
|
|
4776
4776
|
return null;
|
|
@@ -4793,7 +4793,7 @@
|
|
|
4793
4793
|
// main residence become investment (exemption for home office percent usage)
|
|
4794
4794
|
case exports.TaxExemptionEnum.PPR_TO_INVESTMENT:
|
|
4795
4795
|
// 1 year CGT discount can still apply (on the income producing % if used for 12 months or more)
|
|
4796
|
-
var ratio = this.
|
|
4796
|
+
var ratio = this.isOneYearExemptionApplicable(sale) ? 0.5 : 1;
|
|
4797
4797
|
return metadata.getClaimPercent() / 100 * ratio;
|
|
4798
4798
|
// full exemption
|
|
4799
4799
|
case exports.TaxExemptionEnum.PPR:
|
|
@@ -4806,6 +4806,9 @@
|
|
|
4806
4806
|
return 1;
|
|
4807
4807
|
}
|
|
4808
4808
|
};
|
|
4809
|
+
Property.prototype.isOneYearExemptionApplicable = function (sale) {
|
|
4810
|
+
return sale.cgt > 0 && this.getOwnershipDuration(sale, 'years') > 0;
|
|
4811
|
+
};
|
|
4809
4812
|
/**
|
|
4810
4813
|
* ownership duration from purchase till sale
|
|
4811
4814
|
*/
|