taxtank-core 1.0.27 → 1.0.29

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.
@@ -9110,7 +9110,10 @@ class BankTransactionCollection extends Collection {
9110
9110
  * get date of the last transaction
9111
9111
  */
9112
9112
  getLastTransactionDate() {
9113
- return new Date(Math.max.apply(Math, this.items.map((bankTransaction) => bankTransaction.date)));
9113
+ if (!this.length) {
9114
+ return null;
9115
+ }
9116
+ return new Date(Math.max(...this.items.map(transaction => transaction.date.getTime())));
9114
9117
  }
9115
9118
  /**
9116
9119
  * get list of credit transactions
@@ -22699,10 +22702,8 @@ class BasReportForm extends AbstractForm {
22699
22702
  // prefill income/expense data based on transactions/depreciations filtered by specified date
22700
22703
  combineLatest([this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
22701
22704
  .subscribe(([dateFrom, dateTo]) => {
22702
- const from = clone(dateFrom).setHours(0, 0, 0);
22703
- const to = clone(dateTo).setHours(23, 59, 59);
22704
- const filteredTransactions = transactions.filterByRange('date', from, to);
22705
- const filteredDepreciations = depreciations.filterByRange('date', from, to);
22705
+ const filteredTransactions = transactions.filterByRange('date', dateFrom, dateTo);
22706
+ const filteredDepreciations = depreciations.filterByRange('date', dateFrom, dateTo);
22706
22707
  const incomeTransactions = filteredTransactions.getIncomeTransactions();
22707
22708
  const expenseTransactions = new TransactionCollection(filteredTransactions.getExpenseTransactions().toArray(), filteredDepreciations.toArray());
22708
22709
  // all sole income claimed as 100%