taxtank-core 2.1.27 → 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 +20 -9
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +5 -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
|
|
|
@@ -9234,7 +9239,7 @@ class SoleInvoiceCollection extends Collection {
|
|
|
9234
9239
|
return this.getOpen().filter(invoice => round(amountPerInvoice.get(invoice.id), 2) < invoice.grossPrice.toFixed(2));
|
|
9235
9240
|
}
|
|
9236
9241
|
getOpen() {
|
|
9237
|
-
return this.
|
|
9242
|
+
return this.filterBy('status', SoleInvoiceStatusesEnum.OPEN);
|
|
9238
9243
|
}
|
|
9239
9244
|
getInvoiceItemsIds() {
|
|
9240
9245
|
return flatten(this.map(invoice => invoice.items.map(item => item.id)));
|
|
@@ -16710,6 +16715,12 @@ class SoleInvoiceService extends RestService$1 {
|
|
|
16710
16715
|
}
|
|
16711
16716
|
return list.first.number + 1;
|
|
16712
16717
|
}
|
|
16718
|
+
getQuotes() {
|
|
16719
|
+
return this.get().pipe(map((invoices) => invoices.filterBy('type', SoleInvoiceTypeEnum.QUOTE)));
|
|
16720
|
+
}
|
|
16721
|
+
getInvoices() {
|
|
16722
|
+
return this.get().pipe(map((invoices) => invoices.filterBy('type', SoleInvoiceTypeEnum.INVOICE)));
|
|
16723
|
+
}
|
|
16713
16724
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SoleInvoiceService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
16714
16725
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SoleInvoiceService, providedIn: 'root' }); }
|
|
16715
16726
|
}
|