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.
@@ -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.capitalLoss - this.calculateCostBase(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.cgt;
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.cgt > 0 && this.getOwnershipDuration(sale, 'years') > 0;
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])(?=.*\d)(?=.*[@$!%*?&#])[\w@$!%*?&#]{8,}$/;
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 };