taxtank-core 2.1.62 → 2.1.63

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.
@@ -1311,7 +1311,7 @@ class TransactionBase extends ObservableModel {
1311
1311
  return this.currency !== 'AUD';
1312
1312
  }
1313
1313
  get foreignAmount() {
1314
- return this.amount / this.exchangeRate;
1314
+ return this.amount * this.exchangeRate;
1315
1315
  }
1316
1316
  }
1317
1317
  __decorate([
@@ -2240,6 +2240,9 @@ class Collection {
2240
2240
  }
2241
2241
  return this.filter((item) => arrayValues.includes(get(item, path)));
2242
2242
  }
2243
+ filterByDay(date = new Date(), path = 'date') {
2244
+ return this.filter(item => get(item, path).toISOString().slice(0, 10) === date.toISOString().slice(0, 10));
2245
+ }
2243
2246
  filterByRange(path, from, to) {
2244
2247
  return this.filter((item) => get(item, path) >= from && get(item, path) <= to);
2245
2248
  }
@@ -2520,8 +2523,8 @@ class MoneyCalendarEventCollection extends CalendarEventCollection {
2520
2523
  get incomes() {
2521
2524
  return this.filter(event => event.extendedProps.chartAccounts.isIncome());
2522
2525
  }
2523
- filterByDate(dateFrom, dateTo) {
2524
- return this.filterByRange('date', dateFrom ?? new FinancialYear().startDate, dateTo ?? new FinancialYear().endDate);
2526
+ filterByDate(dateFrom = new FinancialYear().startDate, dateTo = new FinancialYear().endDate) {
2527
+ return this.filterByRange('date', dateFrom, dateTo);
2525
2528
  }
2526
2529
  getByMonth(index) {
2527
2530
  return new MoneyCalendarEventCollection(this.items.filter(event => event.inMonth(index)));
@@ -11077,7 +11080,7 @@ class BankAccount extends BankAccount$1 {
11077
11080
  * Get the current opening balance amount
11078
11081
  */
11079
11082
  getOpeningBalance(year = FinancialYear.year, convertToAud = false) {
11080
- return (this.getBalanceByYear(year)?.openingBalance || 0) * (convertToAud ? this.exchangeRate : 1);
11083
+ return (this.getBalanceByYear(year)?.openingBalance || 0) / (convertToAud ? this.exchangeRate : 1);
11081
11084
  }
11082
11085
  /**
11083
11086
  * Get bank account balance for current financial year
@@ -11205,7 +11208,7 @@ class BankAccount extends BankAccount$1 {
11205
11208
  return this.currency !== 'AUD';
11206
11209
  }
11207
11210
  get convertedBalance() {
11208
- return this.currentBalance * this.exchangeRate;
11211
+ return this.currentBalance / this.exchangeRate;
11209
11212
  }
11210
11213
  }
11211
11214
  __decorate([