taxtank-core 0.29.3 → 0.29.5

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.
@@ -8637,8 +8637,9 @@
8637
8637
  /**
8638
8638
  * @TODO vik business transactions calculated differently, separated collection?
8639
8639
  */
8640
- TransactionCollection.prototype.getBusinessClaimAmount = function (businessId, allocations) {
8641
- var transactions = this.filterBy('business.id', businessId);
8640
+ TransactionCollection.prototype.getBusinessClaimAmount = function (allocations, businessId) {
8641
+ if (businessId === void 0) { businessId = null; }
8642
+ var transactions = businessId ? this.filterBy('business.id', businessId) : this;
8642
8643
  var expenses = transactions.getExpenseTransactions();
8643
8644
  var incomes = transactions.getIncomeTransactions();
8644
8645
  return incomes.calculateAllocatedClaimAmount(allocations) + expenses.sumBy('claimAmount');
@@ -9112,7 +9113,7 @@
9112
9113
  var lossOffsetRule = (_a = _this.findBy('business.id', +businessId)) === null || _a === void 0 ? void 0 : _a.offsetRule;
9113
9114
  var businessClaimAmount = transactionsByBusinessId
9114
9115
  .get(businessId)
9115
- .getBusinessClaimAmount(+businessId, allocations);
9116
+ .getBusinessClaimAmount(allocations, +businessId);
9116
9117
  // @TODO vik it has nothing to do with getClaimAmountsByBusinessId
9117
9118
  // no way to apply loss for business without profit if offset rules not met
9118
9119
  if (businessClaimAmount < 0 && !lossOffsetRule) {
@@ -9383,14 +9384,14 @@
9383
9384
  exports.TaxReturnCategoryListEnum.GOVERNMENT_PENSIONS,
9384
9385
  exports.TaxReturnCategoryListEnum.ANNUITIES_SUPER_INCOME_STREAMS,
9385
9386
  exports.TaxReturnCategoryListEnum.SUPERANNUATION_LUMP_SUM_PAYMENTS,
9386
- exports.TaxReturnCategoryListEnum.ATTRIBUTED_PSI_INCOME
9387
+ exports.TaxReturnCategoryListEnum.ATTRIBUTED_PSI_INCOME,
9388
+ exports.TaxReturnCategoryListEnum.DIVIDENDS,
9389
+ exports.TaxReturnCategoryListEnum.GROSS_INTEREST
9387
9390
  ],
9388
9391
  expenses: [
9389
9392
  exports.TaxReturnCategoryListEnum.WORK_EXPENSES
9390
9393
  ],
9391
- interest: [
9392
- exports.TaxReturnCategoryListEnum.GROSS_INTEREST
9393
- ],
9394
+ interest: [],
9394
9395
  taxWithheld: [
9395
9396
  exports.TaxReturnCategoryListEnum.TAX_WITHHELD
9396
9397
  ]
@@ -9414,9 +9415,9 @@
9414
9415
  other: {
9415
9416
  income: [
9416
9417
  exports.TaxReturnCategoryListEnum.GROSS_INTEREST,
9417
- exports.TaxReturnCategoryListEnum.DIVIDENDS,
9418
9418
  exports.TaxReturnCategoryListEnum.SHARE_SCHEMES,
9419
9419
  exports.TaxReturnCategoryListEnum.PARTNERSHIPS,
9420
+ exports.TaxReturnCategoryListEnum.PARTNERSHIPS_TRUSTS,
9420
9421
  exports.TaxReturnCategoryListEnum.TRUSTS,
9421
9422
  exports.TaxReturnCategoryListEnum.PSI_SBE_INCOME,
9422
9423
  exports.TaxReturnCategoryListEnum.SOLE_TRADER_BUSINESS_INCOME,
@@ -11959,9 +11960,8 @@
11959
11960
  this.deductionsForGeneralSmallBusinessPoolAmount = depreciations
11960
11961
  .getSBPDepreciations()
11961
11962
  .sumBy('claimAmount');
11962
- this.currentYearNetNonPrimaryIncomeOrLossesAmount = +(allocations.filterBy('transaction.id', transactions.getIds()).sumBy('amount') -
11963
- depreciations.sumBy('claimAmount'))
11964
- .toFixed(2);
11963
+ this.currentYearNetNonPrimaryIncomeOrLossesAmount = new TransactionCollection(transactions.toArray(), depreciations.toArray())
11964
+ .getBusinessClaimAmount(allocations);
11965
11965
  this.priorYearsNonPrimaryLossesAmount = businessLosses.sumBy('openBalance');
11966
11966
  this.netNonPrimaryIncomeOrLossesAmount = this.currentYearNetNonPrimaryIncomeOrLossesAmount -
11967
11967
  this.priorYearsNonPrimaryLossesAmount;
@@ -12496,7 +12496,7 @@
12496
12496
  var _this = _super.call(this) || this;
12497
12497
  _this.openBalance = loss.openBalance;
12498
12498
  var claimAmount = new TransactionCollection(transactions.toArray(), depreciations.toArray())
12499
- .getBusinessClaimAmount(loss.business.id, new TransactionAllocationCollection(allocations));
12499
+ .getBusinessClaimAmount(new TransactionAllocationCollection(allocations), loss.business.id);
12500
12500
  _this.netIncome = claimAmount;
12501
12501
  _this.closeBalance = loss.offsetRule ? 0 : claimAmount - _this.openBalance;
12502
12502
  return _this;
@@ -19099,11 +19099,11 @@
19099
19099
  openBalance: new forms.FormControl(loss.openBalance, [forms.Validators.required, forms.Validators.min(0)]),
19100
19100
  offsetRule: new forms.FormControl((_a = loss.offsetRule) === null || _a === void 0 ? void 0 : _a.id),
19101
19101
  // sum of depreciations/transactions claim amount - openBalance
19102
- balance: new forms.FormControl({ value: profit - loss.openBalance, disabled: true }),
19102
+ balance: new forms.FormControl({ value: (profit - loss.openBalance).toFixed(2), disabled: true }),
19103
19103
  }, loss) || this;
19104
19104
  _this.loss = loss;
19105
19105
  _this.get('openBalance').valueChanges.subscribe(function (openBalance) {
19106
- _this.get('balance').setValue(profit - openBalance);
19106
+ _this.get('balance').setValue((profit - openBalance).toFixed(2));
19107
19107
  });
19108
19108
  return _this;
19109
19109
  }
@@ -20165,9 +20165,6 @@
20165
20165
  return MyTaxBusinessLossesForm;
20166
20166
  }(AbstractForm));
20167
20167
 
20168
- /**
20169
- * @Todo waiting for the Sole tank implementation
20170
- */
20171
20168
  var MyTaxBusinessIncomeOrLossesForm = /** @class */ (function (_super) {
20172
20169
  __extends(MyTaxBusinessIncomeOrLossesForm, _super);
20173
20170
  function MyTaxBusinessIncomeOrLossesForm(businessDetails, businessIncome, businessLosses) {