taxtank-core 0.9.2 → 0.10.0
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/bundles/taxtank-core.umd.js +3247 -3216
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/collection.js +3 -4
- package/esm2015/lib/collections/depreciation.collection.js +7 -10
- package/esm2015/lib/collections/report/depreciation/depreciation-lvp-report-item.collection.js +12 -0
- package/esm2015/lib/collections/report/depreciation/depreciation-report-item.collection.js +14 -0
- package/esm2015/lib/collections/transaction.collection.js +2 -2
- package/esm2015/lib/db/Models/depreciation-forecast.js +1 -1
- package/esm2015/lib/interfaces/exportable.interface.js +2 -0
- package/esm2015/lib/interfaces/updatable.interface.js +2 -0
- package/esm2015/lib/models/depreciation/depreciation-forecast.js +13 -1
- package/esm2015/lib/models/depreciation/depreciation-group-item.js +2 -2
- package/esm2015/lib/models/depreciation/depreciation.js +7 -32
- package/esm2015/lib/models/export/export-format.enum.js +6 -0
- package/esm2015/lib/models/pdf/pdf-config.js +12 -1
- package/esm2015/lib/models/report/depreciation/depreciation-lvp-asset-type.enum.js +10 -0
- package/esm2015/lib/models/report/depreciation/depreciation-lvp-report-item.js +21 -0
- package/esm2015/lib/models/report/depreciation/depreciation-report-item.js +25 -0
- package/esm2015/lib/models/transaction/transaction.js +3 -3
- package/esm2015/lib/services/http/depreciation/depreciation.service.js +2 -2
- package/esm2015/lib/services/kompassify/kompassify.service.js +31 -0
- package/esm2015/lib/services/pdf/pdf.service.js +4 -49
- package/esm2015/lib/services/xlsx/xlsx.service.js +13 -20
- package/esm2015/public-api.js +10 -4
- package/fesm2015/taxtank-core.js +2541 -2556
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/collection.d.ts +1 -2
- package/lib/collections/depreciation.collection.d.ts +3 -3
- package/lib/collections/report/depreciation/depreciation-lvp-report-item.collection.d.ts +8 -0
- package/lib/collections/report/depreciation/depreciation-report-item.collection.d.ts +8 -0
- package/lib/collections/transaction.collection.d.ts +1 -1
- package/lib/db/Models/depreciation-forecast.d.ts +0 -1
- package/lib/interfaces/exportable.interface.d.ts +9 -0
- package/lib/interfaces/updatable.interface.d.ts +8 -0
- package/lib/models/depreciation/depreciation-forecast.d.ts +4 -0
- package/lib/models/depreciation/depreciation.d.ts +1 -11
- package/lib/models/export/export-format.enum.d.ts +4 -0
- package/lib/models/report/depreciation/depreciation-lvp-asset-type.enum.d.ts +8 -0
- package/lib/models/report/depreciation/depreciation-lvp-report-item.d.ts +8 -0
- package/lib/models/report/depreciation/depreciation-report-item.d.ts +9 -0
- package/lib/services/http/depreciation/depreciation.service.d.ts +1 -1
- package/lib/services/kompassify/kompassify.service.d.ts +14 -0
- package/lib/services/pdf/pdf.service.d.ts +1 -14
- package/lib/services/xlsx/xlsx.service.d.ts +4 -5
- package/package.json +1 -1
- package/public-api.d.ts +9 -3
- package/esm2015/lib/models/data-table/data-table-column.js +0 -13
- package/esm2015/lib/models/data-table/data-table.js +0 -42
- package/esm2015/lib/models/depreciation/depreciation-lvp-rate.enum.js +0 -6
- package/lib/models/data-table/data-table-column.d.ts +0 -20
- package/lib/models/data-table/data-table.d.ts +0 -24
- package/lib/models/depreciation/depreciation-lvp-rate.enum.d.ts +0 -4
|
@@ -29,9 +29,8 @@ export declare class Collection<Model extends object> implements Iterable<Model>
|
|
|
29
29
|
getByIds(ids: number[]): Model[];
|
|
30
30
|
/**
|
|
31
31
|
* Get total sum of items by field
|
|
32
|
-
* @param field Name of the field for sum
|
|
33
32
|
*/
|
|
34
|
-
sumBy(
|
|
33
|
+
sumBy(path: string): number;
|
|
35
34
|
toArray(): Model[];
|
|
36
35
|
/**
|
|
37
36
|
* Filter items by specific provided callback
|
|
@@ -3,6 +3,7 @@ import { Collection } from './collection';
|
|
|
3
3
|
import { Depreciation } from '../models/depreciation/depreciation';
|
|
4
4
|
import { DepreciationCapitalProject } from '../models/depreciation/depreciation-capital-project';
|
|
5
5
|
import { TransactionCollection } from './transaction.collection';
|
|
6
|
+
import { ChartAccountsCategoryEnum } from '../db/Enums/chart-accounts-category.enum';
|
|
6
7
|
export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
7
8
|
/**
|
|
8
9
|
* Get total amount of all depreciations in the collection
|
|
@@ -12,7 +13,7 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
12
13
|
getClaimAmountByYear(year?: number): number;
|
|
13
14
|
getCloseBalanceByYear(year?: number): number;
|
|
14
15
|
getCurrentYearForecastAmount(): number;
|
|
15
|
-
get
|
|
16
|
+
get closeBalance(): number;
|
|
16
17
|
/**
|
|
17
18
|
* Get new depreciations collections filtered by tank type
|
|
18
19
|
*/
|
|
@@ -21,8 +22,7 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
21
22
|
getWithCapitalProject(): DepreciationCollection;
|
|
22
23
|
getWithoutCapitalProject(): DepreciationCollection;
|
|
23
24
|
getWithoutBorrowingExpenses(): DepreciationCollection;
|
|
24
|
-
|
|
25
|
-
getPropertyDepreciations(): DepreciationCollection;
|
|
25
|
+
getByChartAccountsCategories(categories: ChartAccountsCategoryEnum[]): this;
|
|
26
26
|
getPlantEquipment(): DepreciationCollection;
|
|
27
27
|
getCapitalDepreciations(): DepreciationCollection;
|
|
28
28
|
getBorrowingExpenseDepreciations(): DepreciationCollection;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Depreciation } from '../../../models/depreciation/depreciation';
|
|
2
|
+
import { DepreciationCollection } from '../../depreciation.collection';
|
|
3
|
+
/**
|
|
4
|
+
* Collection of depreciation Low Value Pool report items
|
|
5
|
+
*/
|
|
6
|
+
export declare class DepreciationLvpReportItemCollection extends DepreciationCollection {
|
|
7
|
+
static fromDepreciations(deprectiations: Depreciation[]): DepreciationLvpReportItemCollection;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Depreciation } from '../../../models/depreciation/depreciation';
|
|
2
|
+
import { DepreciationCollection } from '../../depreciation.collection';
|
|
3
|
+
export declare class DepreciationReportItemCollection extends DepreciationCollection {
|
|
4
|
+
/**
|
|
5
|
+
* Create new collection from provided depreciations list
|
|
6
|
+
*/
|
|
7
|
+
static fromDepreciations(deprectiations: Depreciation[]): DepreciationReportItemCollection;
|
|
8
|
+
}
|
|
@@ -29,7 +29,7 @@ export declare class TransactionCollection extends Collection<Transaction> {
|
|
|
29
29
|
*/
|
|
30
30
|
get claimAmount(): number;
|
|
31
31
|
get grossAmount(): number;
|
|
32
|
-
|
|
32
|
+
getByChartAccountsCategories(categories: ChartAccountsCategoryEnum[]): TransactionCollection;
|
|
33
33
|
/**
|
|
34
34
|
* Get transactions by month
|
|
35
35
|
* @param monthIndex by which desired month should be taken
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for implementation by components that use an update event emitters.
|
|
4
|
+
* Created to avoid using "change" event emitter name, because that name can cause unexpected events of Angular/JS
|
|
5
|
+
*/
|
|
6
|
+
export interface Updatable<T> {
|
|
7
|
+
update: EventEmitter<T>;
|
|
8
|
+
}
|
|
@@ -4,5 +4,9 @@ export declare class DepreciationForecast extends DepreciationForecastBase {
|
|
|
4
4
|
get dailyClaimAmount(): number;
|
|
5
5
|
get daysApplied(): number;
|
|
6
6
|
getDaysByMonth(month: number): number;
|
|
7
|
+
get claimOpenBalance(): number;
|
|
8
|
+
get claimCloseBalance(): number;
|
|
9
|
+
get claimAmount(): number;
|
|
10
|
+
get claimRate(): number;
|
|
7
11
|
getClaimAmountByMonth(month: number): number;
|
|
8
12
|
}
|
|
@@ -41,8 +41,6 @@ export declare class Depreciation extends DepreciationBase implements ITank, IRe
|
|
|
41
41
|
* @TODO new FinancialYear(this.writeOffDate) === new FinancialYear()
|
|
42
42
|
*/
|
|
43
43
|
isLowValuePool(): boolean;
|
|
44
|
-
isPropertyTank(): boolean;
|
|
45
|
-
isWorkTank(): boolean;
|
|
46
44
|
isPrimeCost(): boolean;
|
|
47
45
|
isDiminishing(): boolean;
|
|
48
46
|
/**
|
|
@@ -58,20 +56,12 @@ export declare class Depreciation extends DepreciationBase implements ITank, IRe
|
|
|
58
56
|
*/
|
|
59
57
|
get currentYearForecast(): DepreciationForecast;
|
|
60
58
|
getForecastByYear(year: number): DepreciationForecast;
|
|
61
|
-
/**
|
|
62
|
-
* get depreciation's closing balance for current financial year
|
|
63
|
-
* open balance here because closing balance in POST actually saves to previous financial year forecast
|
|
64
|
-
*/
|
|
65
|
-
getCloseBalance(): number;
|
|
66
|
-
get claimAmount(): number;
|
|
67
59
|
getClaimAmountByYear(year: number): number;
|
|
68
60
|
getCloseBalanceByYear(year: number): number;
|
|
69
|
-
get assetValue(): number;
|
|
70
|
-
getClaimPercent(): number;
|
|
71
|
-
getCurrentYearForecastAmount(): number;
|
|
72
61
|
isBuildingAtCost(): boolean;
|
|
73
62
|
/**
|
|
74
63
|
* Create a new transaction from current depreciation
|
|
75
64
|
*/
|
|
76
65
|
toTransaction(): Transaction;
|
|
66
|
+
get claimAmount(): number;
|
|
77
67
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DepreciationLvpAssetTypeEnum } from './depreciation-lvp-asset-type.enum';
|
|
2
|
+
import { Depreciation } from '../../depreciation/depreciation';
|
|
3
|
+
export declare class DepreciationLvpReportItem extends Depreciation {
|
|
4
|
+
/**
|
|
5
|
+
* Asset type symbol based on write off manual date / low value pool date
|
|
6
|
+
*/
|
|
7
|
+
assetType: DepreciationLvpAssetTypeEnum;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Depreciation } from '../../depreciation/depreciation';
|
|
2
|
+
/**
|
|
3
|
+
* Class for depreciation report item
|
|
4
|
+
*/
|
|
5
|
+
export declare class DepreciationReportItem extends Depreciation {
|
|
6
|
+
get primeCost(): number;
|
|
7
|
+
get diminishingValue(): number;
|
|
8
|
+
get categoryTitle(): string;
|
|
9
|
+
}
|
|
@@ -30,7 +30,7 @@ export declare class DepreciationService extends RestService<DepreciationBase, D
|
|
|
30
30
|
* Get depreciations related to Vehicle category
|
|
31
31
|
*/
|
|
32
32
|
getVehicleDepreciations(): Observable<Depreciation[]>;
|
|
33
|
-
|
|
33
|
+
getOpenBalance(depreciation: Depreciation): Observable<number>;
|
|
34
34
|
/**
|
|
35
35
|
* @TODO wrong place, move to collection model
|
|
36
36
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import { IEventListener } from '../../interfaces/event-listener.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Service listen and handle kompassify events
|
|
6
|
+
* @TODO break to different services when we got new kompassify functionality (check lists, progress, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export declare class KompassifyService implements IEventListener {
|
|
9
|
+
private router;
|
|
10
|
+
constructor(router: Router);
|
|
11
|
+
listenEvents(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KompassifyService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KompassifyService>;
|
|
14
|
+
}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import { DataTable } from '../../models/data-table/data-table';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class PdfService {
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
download(tables: DataTable<any>[], title: string, fileName: string): void;
|
|
8
|
-
/**
|
|
9
|
-
* @Todo rename when all DataTable dependent methods will be cleared-up
|
|
4
|
+
* Export file form provided HTML tables
|
|
10
5
|
*/
|
|
11
6
|
exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string): void;
|
|
12
|
-
/**
|
|
13
|
-
* @Todo rename when all DataTable dependent methods will be cleared-up
|
|
14
|
-
*/
|
|
15
7
|
private generateFromTables;
|
|
16
8
|
private setDocumentTitle;
|
|
17
9
|
private setDocumentLogo;
|
|
18
|
-
/**
|
|
19
|
-
* @Todo remove/refactor when all DataTable dependent methods will be cleared-up
|
|
20
|
-
* Generate PDF file from provided data
|
|
21
|
-
*/
|
|
22
|
-
private generatePdfFile;
|
|
23
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<PdfService, never>;
|
|
24
11
|
static ɵprov: i0.ɵɵInjectableDeclaration<PdfService>;
|
|
25
12
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { DataTable } from '../../models/data-table/data-table';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class XlsxService {
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
3
|
+
/**
|
|
4
|
+
* Export file form provided HTML tables
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
private
|
|
6
|
+
exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string): void;
|
|
7
|
+
private generateFromTables;
|
|
9
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<XlsxService, never>;
|
|
10
9
|
static ɵprov: i0.ɵɵInjectableDeclaration<XlsxService>;
|
|
11
10
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export * from './lib/collections/logbook.collection';
|
|
|
21
21
|
export * from './lib/collections/message.collection';
|
|
22
22
|
export * from './lib/collections/message-document.collection';
|
|
23
23
|
export * from './lib/collections/property/property.collection';
|
|
24
|
+
export * from './lib/collections/report/depreciation/depreciation-lvp-report-item.collection';
|
|
25
|
+
export * from './lib/collections/report/depreciation/depreciation-report-item.collection';
|
|
24
26
|
export * from './lib/collections/service-price.collection';
|
|
25
27
|
export * from './lib/collections/service-subscription.collection';
|
|
26
28
|
export * from './lib/collections/tax-summary/report-item.collection';
|
|
@@ -154,10 +156,7 @@ export * from './lib/models/client/client-movement';
|
|
|
154
156
|
export * from './lib/models/client/client-portfolio-chart-data';
|
|
155
157
|
export * from './lib/models/client/client-portfolio-report';
|
|
156
158
|
export * from './lib/models/color/alphabet-colors.enum';
|
|
157
|
-
export * from './lib/models/data-table/data-table';
|
|
158
|
-
export * from './lib/models/data-table/data-table-column';
|
|
159
159
|
export * from './lib/models/depreciation/depreciation';
|
|
160
|
-
export * from './lib/models/depreciation/depreciation-lvp-rate.enum';
|
|
161
160
|
export * from './lib/models/depreciation/depreciation-capital-project';
|
|
162
161
|
export * from './lib/models/depreciation/depreciation-forecast';
|
|
163
162
|
export * from './lib/models/depreciation/depreciation-group.enum';
|
|
@@ -175,6 +174,7 @@ export * from './lib/models/endpoint/endpoint';
|
|
|
175
174
|
export * from './lib/models/endpoint/endpoints.const';
|
|
176
175
|
export * from './lib/models/event/app-event';
|
|
177
176
|
export * from './lib/models/event/app-event-type.enum';
|
|
177
|
+
export * from './lib/models/export/export-format.enum';
|
|
178
178
|
export * from './lib/models/file/icons-file.enum';
|
|
179
179
|
export * from './lib/models/financial-year/financial-year';
|
|
180
180
|
export * from './lib/models/financial-year/month-name-short.enum';
|
|
@@ -220,6 +220,9 @@ export * from './lib/models/property/property-sale/property-sale-tax-exemption-m
|
|
|
220
220
|
export * from './lib/models/property/property-subscription';
|
|
221
221
|
export * from './lib/models/property/property-valuation';
|
|
222
222
|
export * from './lib/models/registration-invite/registration-invite';
|
|
223
|
+
export * from './lib/models/report/depreciation/depreciation-lvp-report-item';
|
|
224
|
+
export * from './lib/models/report/depreciation/depreciation-report-item';
|
|
225
|
+
export * from './lib/models/report/depreciation/depreciation-lvp-asset-type.enum';
|
|
223
226
|
export * from './lib/models/service-subscription/module-url-list.const';
|
|
224
227
|
export * from './lib/models/service-subscription/service-payment';
|
|
225
228
|
export * from './lib/models/service-subscription/service-price';
|
|
@@ -292,6 +295,7 @@ export * from './lib/services/http/income-source/income-source-forecast/income-s
|
|
|
292
295
|
export * from './lib/services/http/income-source/salary-forecast/salary-forecast.service';
|
|
293
296
|
export * from './lib/services/http/income-source/sole-forecast/sole-forecast.service';
|
|
294
297
|
export * from './lib/services/intercom/intercom.service';
|
|
298
|
+
export * from './lib/services/kompassify/kompassify.service';
|
|
295
299
|
export * from './lib/services/http/loan/loan.service';
|
|
296
300
|
export * from './lib/services/http/service-notification/service-notification.service';
|
|
297
301
|
export * from './lib/services/pdf/pdf.service';
|
|
@@ -336,8 +340,10 @@ export * from './lib/interfaces/event-listener.interface';
|
|
|
336
340
|
export * from './lib/interfaces/income-source-forecast.interface';
|
|
337
341
|
export * from './lib/interfaces/option.interface';
|
|
338
342
|
export * from './lib/interfaces/photoable';
|
|
343
|
+
export * from './lib/interfaces/exportable.interface';
|
|
339
344
|
export * from './lib/interfaces/receipt.interface';
|
|
340
345
|
export * from './lib/interfaces/tank.interface';
|
|
346
|
+
export * from './lib/interfaces/updatable.interface';
|
|
341
347
|
/**
|
|
342
348
|
* Functions
|
|
343
349
|
*/
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class DataTableColumn {
|
|
2
|
-
constructor(name, key, total, pipe) {
|
|
3
|
-
/**
|
|
4
|
-
* Flag that shows should the column be in the total calculation or not
|
|
5
|
-
*/
|
|
6
|
-
this.total = false;
|
|
7
|
-
this.name = name;
|
|
8
|
-
this.key = key;
|
|
9
|
-
this.total = total;
|
|
10
|
-
this.pipe = pipe;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS10YWJsZS1jb2x1bW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvbW9kZWxzL2RhdGEtdGFibGUvZGF0YS10YWJsZS1jb2x1bW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLGVBQWU7SUFrQjFCLFlBQ0UsSUFBWSxFQUNaLEdBQWdCLEVBQ2hCLEtBQWMsRUFDZCxJQUFtQjtRQWJyQjs7V0FFRzt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GFsID0gdG90YWw7XG4gICAgdGhpcy5waXBlID0gcGlwZTtcbiAgfVxufVxuIl19
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class to generate data-table structure based on provided collection.
|
|
3
|
-
* Use to work with HTML/PDF/XLSX tables
|
|
4
|
-
*/
|
|
5
|
-
export class DataTable {
|
|
6
|
-
constructor(collection, columns, caption, footerCaption) {
|
|
7
|
-
this.caption = caption;
|
|
8
|
-
this.columns = columns;
|
|
9
|
-
this.setRows(collection);
|
|
10
|
-
if (footerCaption) {
|
|
11
|
-
this.setFooterRow(collection, footerCaption);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
setRows(collection) {
|
|
15
|
-
this.rows = collection.items.map((item) => {
|
|
16
|
-
// parse table columns to return items based on column properties
|
|
17
|
-
return this.columns.map((column) => {
|
|
18
|
-
// if the pipe is provided - transform the return value
|
|
19
|
-
if (column.pipe) {
|
|
20
|
-
return column.pipe.transform(item[column.key]);
|
|
21
|
-
}
|
|
22
|
-
return (item[column.key] ? item[column.key] : '-').toString();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
setFooterRow(collection, footerCaption) {
|
|
27
|
-
this.footerRow = this.columns.map((column, index) => {
|
|
28
|
-
if (index === 0) {
|
|
29
|
-
return footerCaption.toString();
|
|
30
|
-
}
|
|
31
|
-
if (!column.total) {
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
const totalValue = collection.items.reduce((sum, item) => {
|
|
35
|
-
// check if current collection item has value. If not - don't add it to the sum
|
|
36
|
-
return item[column.key] !== null ? sum + Number(item[column.key]) : sum;
|
|
37
|
-
}, null);
|
|
38
|
-
return (totalValue !== null && totalValue !== void 0 ? totalValue : '-').toString();
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS10YWJsZS5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YgKCFjb2x1bW4udG90YWwpIHtcbiAgICAgICAgcmV0dXJuICcnO1xuICAgICAgfVxuXG4gICAgICBjb25zdCB0b3RhbFZhbHVlOiBudW1iZXIgPSBjb2xsZWN0aW9uLml0ZW1zLnJlZHVjZSgoc3VtOiBudW1iZXIsIGl0ZW06IE1vZGVsKSA9PiB7XG4gICAgICAgIC8vIGNoZWNrIGlmIGN1cnJlbnQgY29sbGVjdGlvbiBpdGVtIGhhcyB2YWx1ZS4gSWYgbm90IC0gZG9uJ3QgYWRkIGl0IHRvIHRoZSBzdW1cbiAgICAgICAgcmV0dXJuIGl0ZW1bY29sdW1uLmtleV0gIT09IG51bGwgPyBzdW0gKyBOdW1iZXIoaXRlbVtjb2x1bW4ua2V5XSkgOiBzdW1cbiAgICAgIH0sIG51bGwpO1xuXG4gICAgICByZXR1cm4gKHRvdGFsVmFsdWUgPz8gJy0nKS50b1N0cmluZygpO1xuICAgIH0pO1xuICB9XG59XG4iXX0=
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export var DepreciationLvpRateEnum;
|
|
2
|
-
(function (DepreciationLvpRateEnum) {
|
|
3
|
-
DepreciationLvpRateEnum[DepreciationLvpRateEnum["FIRST_YEAR"] = 0.1875] = "FIRST_YEAR";
|
|
4
|
-
DepreciationLvpRateEnum[DepreciationLvpRateEnum["DEFAULT"] = 0.375] = "DEFAULT";
|
|
5
|
-
})(DepreciationLvpRateEnum || (DepreciationLvpRateEnum = {}));
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwcmVjaWF0aW9uLWx2cC1yYXRlLmVudW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvbW9kZWxzL2RlcHJlY2lhdGlvbi9kZXByZWNpYXRpb24tbHZwLXJhdGUuZW51bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSx1QkFHWDtBQUhELFdBQVksdUJBQXVCO0lBQ2pDLHNGQUFtQixDQUFBO0lBQ25CLCtFQUFlLENBQUE7QUFDakIsQ0FBQyxFQUhXLHVCQUF1QixLQUF2Qix1QkFBdUIsUUFHbEMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBEZXByZWNpYXRpb25MdnBSYXRlRW51bSB7XG4gIEZJUlNUX1lFQVIgPSAwLjE4NzUsXG4gIERFRkFVTFQgPSAwLjM3NSxcbn1cbiJdfQ==
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
export declare class DataTableColumn<Model> {
|
|
3
|
-
/**
|
|
4
|
-
* Human-readable name of the column
|
|
5
|
-
*/
|
|
6
|
-
name: string;
|
|
7
|
-
/**
|
|
8
|
-
* Field that equals to model key
|
|
9
|
-
*/
|
|
10
|
-
key: keyof Model;
|
|
11
|
-
/**
|
|
12
|
-
* Flag that shows should the column be in the total calculation or not
|
|
13
|
-
*/
|
|
14
|
-
total: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Provided pipe, which should be applied to the row data
|
|
17
|
-
*/
|
|
18
|
-
pipe?: PipeTransform;
|
|
19
|
-
constructor(name: string, key: keyof Model, total: boolean, pipe: PipeTransform);
|
|
20
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DataTableColumn } from "./data-table-column";
|
|
2
|
-
import { Collection } from "../../collections/collection";
|
|
3
|
-
/**
|
|
4
|
-
* Class to generate data-table structure based on provided collection.
|
|
5
|
-
* Use to work with HTML/PDF/XLSX tables
|
|
6
|
-
*/
|
|
7
|
-
export declare class DataTable<Model extends object> {
|
|
8
|
-
/**
|
|
9
|
-
* Caption of the table
|
|
10
|
-
*/
|
|
11
|
-
caption?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Array of table columns
|
|
14
|
-
*/
|
|
15
|
-
columns: DataTableColumn<Model>[];
|
|
16
|
-
/**
|
|
17
|
-
* Table rows with data
|
|
18
|
-
*/
|
|
19
|
-
rows: Array<string>[];
|
|
20
|
-
footerRow: string[];
|
|
21
|
-
constructor(collection: Collection<Model>, columns: DataTableColumn<Model>[], caption: string, footerCaption?: string);
|
|
22
|
-
private setRows;
|
|
23
|
-
private setFooterRow;
|
|
24
|
-
}
|