taxtank-core 2.1.37 → 2.1.39

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.
@@ -5496,6 +5496,9 @@ class SoleInvoice extends SoleInvoice$1 {
5496
5496
  get itemsCollection() {
5497
5497
  return new SoleInvoiceItemCollection(this.items);
5498
5498
  }
5499
+ get totalPrice() {
5500
+ return this.itemsCollection.sumBy('totalPrice');
5501
+ }
5499
5502
  /**
5500
5503
  * total without GST
5501
5504
  */
@@ -8812,8 +8815,8 @@ class SolePlItem {
8812
8815
  constructor(transactions, data = {}) {
8813
8816
  this.chartAccounts = transactions.first.chartAccounts;
8814
8817
  this.name = transactions.first.chartAccounts.name;
8815
- this.amount = Math.abs(transactions.filterByFinancialYear('date').claimAmount);
8816
- this.priorAmount = Math.abs(transactions.filterByFinancialYear('date', null, FinancialYear.prev()).claimAmount);
8818
+ this.amount = transactions.filterByFinancialYear('date').claimAmount;
8819
+ this.priorAmount = transactions.filterByFinancialYear('date', null, FinancialYear.prev()).claimAmount;
8817
8820
  if (!this.priorAmount) {
8818
8821
  this.varianceRatio = NaN;
8819
8822
  }
@@ -9186,11 +9189,7 @@ class BudgetRuleItemCollection extends Collection {
9186
9189
  class SolePlItemCollection extends Collection {
9187
9190
  static fromTransactions(transactions) {
9188
9191
  const transactionsByChartAccounts = transactions.groupBy('chartAccounts.id');
9189
- const collection = new SolePlItemCollection(transactionsByChartAccounts.keys.map(chartAccountsId => new SolePlItem(transactionsByChartAccounts.get(chartAccountsId))));
9190
- // collection.push(
9191
- // new SolePlItem(transactions.filterBy('chartAccounts.category', ChartAccountsCategoryEnum.SOLE_DEPRECIATION))
9192
- // );
9193
- return collection;
9192
+ return new SolePlItemCollection(transactionsByChartAccounts.keys.map(chartAccountsId => new SolePlItem(transactionsByChartAccounts.get(chartAccountsId))));
9194
9193
  }
9195
9194
  get amount() {
9196
9195
  return this.sumBy('amount');