taxtank-core 1.0.0 → 1.0.3

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.
@@ -6223,12 +6223,12 @@ class PropertyEquityChartData {
6223
6223
  const loans = this.loans.getByBankAccountsIds(bankAccounts.getIds());
6224
6224
  const offset = bankAccounts.filterBy('type', BankAccountTypeEnum.OFFSET).getPropertyBalanceAmount(property.id);
6225
6225
  if (year > this.currentYear) {
6226
- return bankAccounts.items.reduce((totalSum, bankAccount) => totalSum + (bankAccount.getPropertyPercentage(property.id) * (loans.getByBankAccountId(bankAccount.id)?.getLastPaymentByYear(year)?.totalOwed || 0)), 0) - offset;
6226
+ return bankAccounts.items.reduce((totalSum, bankAccount) => totalSum + (bankAccount.getPropertyPercentage(property.id) * (-loans.getByBankAccountId(bankAccount.id)?.getLastPaymentByYear(year)?.totalOwed || 0)), 0) + offset;
6227
6227
  }
6228
6228
  if (year == this.currentYear) {
6229
- return bankAccounts.items.reduce((totalSum, bankAccount) => totalSum + (bankAccount.getPropertyPercentage(property.id) * (loans.getByBankAccountId(bankAccount.id)?.currentBalance || 0)), 0) - offset;
6229
+ return bankAccounts.items.reduce((totalSum, bankAccount) => totalSum + (bankAccount.getPropertyPercentage(property.id) * (loans.getByBankAccountId(bankAccount.id)?.currentBalance || 0)), 0) + offset;
6230
6230
  }
6231
- return property.getForecastByYear(year).loanBalance;
6231
+ return property.getForecastByYear(year).loanBalance + offset;
6232
6232
  // @TODO TT-4888 no idea why it was calculated like that
6233
6233
  // return property.getValuationByYear(year).marketValue - offset;
6234
6234
  }