taxtank-core 1.0.2 → 1.0.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.
@@ -6172,7 +6172,7 @@ class PropertyEquityChartData {
|
|
6172
6172
|
items.forEach((item) => {
|
6173
6173
|
// increase item values with property actual forecasts for item year
|
6174
6174
|
item.marketValue = this.properties.items.reduce((sum, property) => sum + this.getMarketValueForPropertyByYear(property, item.year), 0);
|
6175
|
-
item.loanBalance =
|
6175
|
+
item.loanBalance = this.properties.items.reduce((sum, property) => sum + this.getLoanBalanceByYear(property, item.year), 0);
|
6176
6176
|
});
|
6177
6177
|
}
|
6178
6178
|
/**
|
@@ -6226,9 +6226,9 @@ class PropertyEquityChartData {
|
|
6226
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) * (Math.abs(loans.getByBankAccountId(bankAccount.id)?.currentBalance) || 0)), 0) - offset;
|
6230
6230
|
}
|
6231
|
-
return property.getForecastByYear(year).loanBalance;
|
6231
|
+
return Math.abs(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
|
}
|