taxtank-core 1.0.3 → 1.0.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.
@@ -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 = Math.abs(this.properties.items.reduce((sum, property) => sum + this.getLoanBalanceByYear(property, item.year), 0));
6175
+ item.loanBalance = this.properties.items.reduce((sum, property) => sum + this.getLoanBalanceByYear(property, item.year), 0);
6176
6176
  });
6177
6177
  }
6178
6178
  /**
@@ -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) * (Math.abs(loans.getByBankAccountId(bankAccount.id)?.currentBalance) || 0)), 0) - offset;
6230
6230
  }
6231
- return property.getForecastByYear(year).loanBalance + offset;
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
  }
@@ -6782,7 +6782,7 @@ class Depreciation extends Depreciation$1 {
6782
6782
  && !this.isSBPCalculation()
6783
6783
  && this.isDiminishing()
6784
6784
  && !this.isWrittenOff()
6785
- && this.currentYearForecast.closeBalance <= Depreciation.lowValuePoolThreshold;
6785
+ && this.currentYearForecast.openBalance <= Depreciation.lowValuePoolThreshold;
6786
6786
  }
6787
6787
  isSBP() {
6788
6788
  return this.isAsset() && this.isSBPCalculation() && !this.isWrittenOff();
@@ -6888,7 +6888,7 @@ __decorate([
6888
6888
  // @TODO refactor
6889
6889
  value.forEach((forecast) => {
6890
6890
  forecast.isLVP =
6891
- forecast.closeBalance < 1000 &&
6891
+ forecast.openBalance < 1000 &&
6892
6892
  obj.calculation === DepreciationCalculationEnum.DIMINISHING &&
6893
6893
  obj.type === DepreciationTypeEnum.PLANT_EQUIPMENT &&
6894
6894
  !(obj.amount > Depreciation.writtenOffThreshold && obj.amount < Depreciation.lowValuePoolThreshold) &&
@@ -13428,11 +13428,11 @@ class RestService {
13428
13428
  /**
13429
13429
  * get list of base class instances directly from backend
13430
13430
  */
13431
- fetch(path = this.apiUrl, cache = true) {
13431
+ fetch(path = this.apiUrl, cache = true, params = {}) {
13432
13432
  if (cache) {
13433
13433
  this.setCache([]);
13434
13434
  }
13435
- return this.http.get(path)
13435
+ return this.http.get(path, { params: params })
13436
13436
  .pipe(map((response) => {
13437
13437
  const items = response.map((item) => this.createModelInstance(item));
13438
13438
  if (cache) {
@@ -15821,8 +15821,8 @@ class TransactionService extends RestService {
15821
15821
  getPropertyHoldingCosts(propertyId) {
15822
15822
  return this.fetch(`${this.environment.apiV2}/properties/${propertyId}/holding-costs`, false);
15823
15823
  }
15824
- getWithoutTaxFreeProperty() {
15825
- return this.fetch(`${this.apiUrl}?excludeTaxFreePropertyCategories`, false).pipe(map(transactions => this.groupByParent(transactions)));
15824
+ getWithoutTaxFreeProperty(categories = ['']) {
15825
+ return this.fetch(`${this.apiUrl}`, false, { excludeTaxFreePropertyCategories: categories }).pipe(map(transactions => this.groupByParent(transactions)));
15826
15826
  }
15827
15827
  groupByParent(transactions) {
15828
15828
  transactions.forEach((transaction) => {
@@ -20073,7 +20073,7 @@ class PropertyTransactionReportService {
20073
20073
  */
20074
20074
  getTransactions() {
20075
20075
  // @TODO TT-4886
20076
- return this.transactionService.getWithoutTaxFreeProperty().pipe(map((transactions) => new TransactionCollection(transactions)
20076
+ return this.transactionService.getWithoutTaxFreeProperty([PropertyCategoryListEnum.VACANT_LAND]).pipe(map((transactions) => new TransactionCollection(transactions)
20077
20077
  .getByChartAccountsCategories(CHART_ACCOUNTS_CATEGORIES.property)
20078
20078
  .filter(transaction => transaction.claimPercent > 0)));
20079
20079
  }