taxtank-core 2.1.37 → 2.1.38
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.
|
@@ -8812,8 +8812,8 @@ class SolePlItem {
|
|
|
8812
8812
|
constructor(transactions, data = {}) {
|
|
8813
8813
|
this.chartAccounts = transactions.first.chartAccounts;
|
|
8814
8814
|
this.name = transactions.first.chartAccounts.name;
|
|
8815
|
-
this.amount =
|
|
8816
|
-
this.priorAmount =
|
|
8815
|
+
this.amount = transactions.filterByFinancialYear('date').claimAmount;
|
|
8816
|
+
this.priorAmount = transactions.filterByFinancialYear('date', null, FinancialYear.prev()).claimAmount;
|
|
8817
8817
|
if (!this.priorAmount) {
|
|
8818
8818
|
this.varianceRatio = NaN;
|
|
8819
8819
|
}
|
|
@@ -9186,11 +9186,7 @@ class BudgetRuleItemCollection extends Collection {
|
|
|
9186
9186
|
class SolePlItemCollection extends Collection {
|
|
9187
9187
|
static fromTransactions(transactions) {
|
|
9188
9188
|
const transactionsByChartAccounts = transactions.groupBy('chartAccounts.id');
|
|
9189
|
-
|
|
9190
|
-
// collection.push(
|
|
9191
|
-
// new SolePlItem(transactions.filterBy('chartAccounts.category', ChartAccountsCategoryEnum.SOLE_DEPRECIATION))
|
|
9192
|
-
// );
|
|
9193
|
-
return collection;
|
|
9189
|
+
return new SolePlItemCollection(transactionsByChartAccounts.keys.map(chartAccountsId => new SolePlItem(transactionsByChartAccounts.get(chartAccountsId))));
|
|
9194
9190
|
}
|
|
9195
9191
|
get amount() {
|
|
9196
9192
|
return this.sumBy('amount');
|