taxtank-core 0.17.5 → 0.17.8
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 +11 -4
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/db/Models/property/property-sale/property-sale.js +1 -1
- package/esm2015/lib/models/property/property.js +7 -4
- package/esm2015/lib/validators/password.validator.js +2 -2
- package/fesm2015/taxtank-core.js +7 -4
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/db/Models/property/property-sale/property-sale.d.ts +2 -1
- package/lib/models/property/property.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4242,6 +4242,13 @@
|
|
|
4242
4242
|
enumerable: false,
|
|
4243
4243
|
configurable: true
|
|
4244
4244
|
});
|
|
4245
|
+
Object.defineProperty(Property.prototype, "shareRatio", {
|
|
4246
|
+
get: function () {
|
|
4247
|
+
return this.myShare.percent / 100;
|
|
4248
|
+
},
|
|
4249
|
+
enumerable: false,
|
|
4250
|
+
configurable: true
|
|
4251
|
+
});
|
|
4245
4252
|
Object.defineProperty(Property.prototype, "previousCategory", {
|
|
4246
4253
|
get: function () {
|
|
4247
4254
|
var previousCategory;
|
|
@@ -4284,13 +4291,13 @@
|
|
|
4284
4291
|
* gross capital gain tax: sale costs - cost base
|
|
4285
4292
|
*/
|
|
4286
4293
|
Property.prototype.calculateCGT = function (sale) {
|
|
4287
|
-
return sale.price - sale.saleCostsTotalAmount - sale.
|
|
4294
|
+
return (sale.price - sale.saleCostsTotalAmount - this.calculateCostBase(sale)) * this.shareRatio - sale.capitalLoss;
|
|
4288
4295
|
};
|
|
4289
4296
|
/**
|
|
4290
4297
|
* net capital gain tax (includes tax exemptions)
|
|
4291
4298
|
*/
|
|
4292
4299
|
Property.prototype.calculateNetCGT = function (sale) {
|
|
4293
|
-
return this.getCGTExemptionRatio(sale) * sale.
|
|
4300
|
+
return this.getCGTExemptionRatio(sale) * sale.grossCGT;
|
|
4294
4301
|
};
|
|
4295
4302
|
/**
|
|
4296
4303
|
* guess tax exemption based on property details
|
|
@@ -4341,7 +4348,7 @@
|
|
|
4341
4348
|
}
|
|
4342
4349
|
};
|
|
4343
4350
|
Property.prototype.isOneYearExemptionApplicable = function (sale) {
|
|
4344
|
-
return sale.
|
|
4351
|
+
return sale.grossCGT > 0 && this.getOwnershipDuration(sale, 'years') > 0;
|
|
4345
4352
|
};
|
|
4346
4353
|
/**
|
|
4347
4354
|
* ownership duration from purchase till sale
|
|
@@ -13874,7 +13881,7 @@
|
|
|
13874
13881
|
return LoginForm;
|
|
13875
13882
|
}(AbstractForm));
|
|
13876
13883
|
|
|
13877
|
-
var passwordPattern = /^(?=.*[a-z])(?=.*[A-Z])(
|
|
13884
|
+
var passwordPattern = /^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})./;
|
|
13878
13885
|
function passwordValidator() {
|
|
13879
13886
|
return function (control) {
|
|
13880
13887
|
return passwordPattern.test(control.value) ? null : { passwordInvalid: true };
|