taxtank-core 2.1.28 → 2.1.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.
- package/fesm2022/taxtank-core.mjs +13 -8
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -8782,16 +8782,18 @@ class SoleBusinessLossReport extends AbstractModel {
|
|
|
8782
8782
|
* profit/loss report item
|
|
8783
8783
|
*/
|
|
8784
8784
|
class SolePlItem {
|
|
8785
|
-
constructor(transactions,
|
|
8786
|
-
this.chartAccounts =
|
|
8787
|
-
this.
|
|
8788
|
-
this.
|
|
8785
|
+
constructor(transactions, data = {}) {
|
|
8786
|
+
this.chartAccounts = transactions.first.chartAccounts;
|
|
8787
|
+
this.name = transactions.first.chartAccounts.name;
|
|
8788
|
+
this.amount = Math.abs(transactions.filterByFinancialYear('date').claimAmount);
|
|
8789
|
+
this.priorAmount = Math.abs(transactions.filterByFinancialYear('date', null, FinancialYear.prev()).claimAmount);
|
|
8789
8790
|
if (!this.priorAmount) {
|
|
8790
8791
|
this.varianceRatio = NaN;
|
|
8791
8792
|
}
|
|
8792
8793
|
else {
|
|
8793
8794
|
this.varianceRatio = (this.amount - this.priorAmount) / this.priorAmount;
|
|
8794
8795
|
}
|
|
8796
|
+
Object.assign(this, data);
|
|
8795
8797
|
}
|
|
8796
8798
|
}
|
|
8797
8799
|
|
|
@@ -9155,10 +9157,13 @@ class BudgetRuleItemCollection extends Collection {
|
|
|
9155
9157
|
}
|
|
9156
9158
|
|
|
9157
9159
|
class SolePlItemCollection extends Collection {
|
|
9158
|
-
static fromTransactions(transactions
|
|
9160
|
+
static fromTransactions(transactions) {
|
|
9159
9161
|
const transactionsByChartAccounts = transactions.groupBy('chartAccounts.id');
|
|
9160
|
-
const
|
|
9161
|
-
|
|
9162
|
+
const collection = new SolePlItemCollection(transactionsByChartAccounts.keys.map(chartAccountsId => new SolePlItem(transactionsByChartAccounts.get(chartAccountsId))));
|
|
9163
|
+
// collection.push(
|
|
9164
|
+
// new SolePlItem(transactions.filterBy('chartAccounts.category', ChartAccountsCategoryEnum.SOLE_DEPRECIATION))
|
|
9165
|
+
// );
|
|
9166
|
+
return collection;
|
|
9162
9167
|
}
|
|
9163
9168
|
get amount() {
|
|
9164
9169
|
return this.sumBy('amount');
|
|
@@ -9168,7 +9173,7 @@ class SolePlItemCollection extends Collection {
|
|
|
9168
9173
|
}
|
|
9169
9174
|
get varianceRatio() {
|
|
9170
9175
|
const priorAmount = this.priorAmount;
|
|
9171
|
-
return
|
|
9176
|
+
return priorAmount ? (this.amount - priorAmount) / priorAmount : NaN;
|
|
9172
9177
|
}
|
|
9173
9178
|
}
|
|
9174
9179
|
|