taxtank-core 0.9.1 → 0.9.4

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.
Files changed (62) hide show
  1. package/bundles/taxtank-core.umd.js +3236 -3171
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +3 -4
  4. package/esm2015/lib/collections/depreciation.collection.js +7 -10
  5. package/esm2015/lib/collections/report/depreciation/depreciation-lvp-report-item.collection.js +12 -0
  6. package/esm2015/lib/collections/report/depreciation/depreciation-report-item.collection.js +14 -0
  7. package/esm2015/lib/collections/transaction.collection.js +2 -9
  8. package/esm2015/lib/db/Models/depreciation-forecast.js +1 -1
  9. package/esm2015/lib/db/Models/transaction-base.js +12 -8
  10. package/esm2015/lib/interfaces/exportable.interface.js +2 -0
  11. package/esm2015/lib/interfaces/updatable.interface.js +2 -0
  12. package/esm2015/lib/models/chart-accounts/chart-accounts-categories.const.js +24 -3
  13. package/esm2015/lib/models/chart-accounts/chart-accounts.js +5 -1
  14. package/esm2015/lib/models/depreciation/depreciation-forecast.js +13 -1
  15. package/esm2015/lib/models/depreciation/depreciation-group-item.js +2 -2
  16. package/esm2015/lib/models/depreciation/depreciation.js +7 -32
  17. package/esm2015/lib/models/export/export-format.enum.js +6 -0
  18. package/esm2015/lib/models/pdf/pdf-config.js +12 -1
  19. package/esm2015/lib/models/report/depreciation/depreciation-lvp-asset-type.enum.js +10 -0
  20. package/esm2015/lib/models/report/depreciation/depreciation-lvp-report-item.js +21 -0
  21. package/esm2015/lib/models/report/depreciation/depreciation-report-item.js +25 -0
  22. package/esm2015/lib/models/transaction/transaction.js +6 -4
  23. package/esm2015/lib/services/http/depreciation/depreciation.service.js +2 -2
  24. package/esm2015/lib/services/http/transaction/messages.enum.js +7 -0
  25. package/esm2015/lib/services/http/transaction/transaction.service.js +10 -4
  26. package/esm2015/lib/services/pdf/pdf.service.js +4 -49
  27. package/esm2015/lib/services/toast/toast.service.js +32 -1
  28. package/esm2015/lib/services/xlsx/xlsx.service.js +13 -20
  29. package/esm2015/public-api.js +9 -4
  30. package/fesm2015/taxtank-core.js +2561 -2540
  31. package/fesm2015/taxtank-core.js.map +1 -1
  32. package/lib/collections/collection.d.ts +1 -2
  33. package/lib/collections/depreciation.collection.d.ts +3 -3
  34. package/lib/collections/report/depreciation/depreciation-lvp-report-item.collection.d.ts +8 -0
  35. package/lib/collections/report/depreciation/depreciation-report-item.collection.d.ts +8 -0
  36. package/lib/collections/transaction.collection.d.ts +1 -7
  37. package/lib/db/Models/depreciation-forecast.d.ts +0 -1
  38. package/lib/db/Models/transaction-base.d.ts +4 -2
  39. package/lib/interfaces/exportable.interface.d.ts +9 -0
  40. package/lib/interfaces/updatable.interface.d.ts +8 -0
  41. package/lib/models/chart-accounts/chart-accounts-categories.const.d.ts +4 -0
  42. package/lib/models/chart-accounts/chart-accounts.d.ts +1 -0
  43. package/lib/models/depreciation/depreciation-forecast.d.ts +4 -0
  44. package/lib/models/depreciation/depreciation.d.ts +1 -11
  45. package/lib/models/export/export-format.enum.d.ts +4 -0
  46. package/lib/models/report/depreciation/depreciation-lvp-asset-type.enum.d.ts +8 -0
  47. package/lib/models/report/depreciation/depreciation-lvp-report-item.d.ts +8 -0
  48. package/lib/models/report/depreciation/depreciation-report-item.d.ts +9 -0
  49. package/lib/services/http/depreciation/depreciation.service.d.ts +1 -1
  50. package/lib/services/http/transaction/messages.enum.d.ts +5 -0
  51. package/lib/services/http/transaction/transaction.service.d.ts +3 -1
  52. package/lib/services/pdf/pdf.service.d.ts +1 -14
  53. package/lib/services/toast/toast.service.d.ts +4 -0
  54. package/lib/services/xlsx/xlsx.service.d.ts +4 -5
  55. package/package.json +1 -1
  56. package/public-api.d.ts +8 -3
  57. package/esm2015/lib/models/data-table/data-table-column.js +0 -13
  58. package/esm2015/lib/models/data-table/data-table.js +0 -42
  59. package/esm2015/lib/models/depreciation/depreciation-lvp-rate.enum.js +0 -6
  60. package/lib/models/data-table/data-table-column.d.ts +0 -20
  61. package/lib/models/data-table/data-table.d.ts +0 -24
  62. 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(field: string): number;
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 assetValue(): number;
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
- getWorkDepreciations(): DepreciationCollection;
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
+ }
@@ -1,7 +1,6 @@
1
1
  import { Collection } from './collection';
2
2
  import { Transaction } from '../models/transaction/transaction';
3
3
  import { TransactionAllocationCollection } from './transaction-allocation.collection';
4
- import { TankTypeEnum } from '../db/Enums/tank-type.enum';
5
4
  import { ChartAccountsCategoryEnum } from '../db/Enums/chart-accounts-category.enum';
6
5
  /**
7
6
  * Collection of transactions
@@ -21,11 +20,6 @@ export declare class TransactionCollection extends Collection<Transaction> {
21
20
  * Cash position is equal to Total Amount because income is positive and expense is negative,
22
21
  */
23
22
  get cashPosition(): number;
24
- /**
25
- * Get new collection of transactions filtered by tank type
26
- * @param tankType
27
- */
28
- getByTankType(tankType: TankTypeEnum): TransactionCollection;
29
23
  /**
30
24
  * get date of the last transaction
31
25
  */
@@ -35,7 +29,7 @@ export declare class TransactionCollection extends Collection<Transaction> {
35
29
  */
36
30
  get claimAmount(): number;
37
31
  get grossAmount(): number;
38
- getByCategories(categories: ChartAccountsCategoryEnum[]): TransactionCollection;
32
+ getByChartAccountsCategories(categories: ChartAccountsCategoryEnum[]): TransactionCollection;
39
33
  /**
40
34
  * Get transactions by month
41
35
  * @param monthIndex by which desired month should be taken
@@ -7,7 +7,6 @@ export declare class DepreciationForecast {
7
7
  openBalance?: number;
8
8
  closeBalance?: number;
9
9
  amount?: number;
10
- claimAmount?: number;
11
10
  id?: number;
12
11
  claimPercent?: number;
13
12
  createdAt?: Date;
@@ -1,6 +1,5 @@
1
1
  import { Property } from './property/property';
2
2
  import { ChartAccounts } from './chart-accounts';
3
- import { TankTypeEnum } from '../Enums/tank-type.enum';
4
3
  export declare class TransactionBase {
5
4
  id?: number;
6
5
  amount?: number;
@@ -10,7 +9,6 @@ export declare class TransactionBase {
10
9
  description?: string;
11
10
  file?: File;
12
11
  claimPercent?: number;
13
- tankType: TankTypeEnum;
14
12
  /**
15
13
  * Check if current tank is Property
16
14
  */
@@ -19,4 +17,8 @@ export declare class TransactionBase {
19
17
  * Check if current tank is Work
20
18
  */
21
19
  isWorkTank(): boolean;
20
+ /**
21
+ * Check if current tank is Sole
22
+ */
23
+ isSoleTank(): boolean;
22
24
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Interface for components that contains data to export (download, print, e.t.c.)
3
+ */
4
+ export interface Exportable {
5
+ /**
6
+ * Title of the exportable file
7
+ */
8
+ exportFileTitle: string;
9
+ }
@@ -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
+ }
@@ -1,4 +1,8 @@
1
1
  import { ChartAccountsCategoryEnum } from '../../db/Enums/chart-accounts-category.enum';
2
+ /**
3
+ * Grouped chart accounts categories for fast work
4
+ * @TODO Alex: Clean up and/or remove some groups
5
+ */
2
6
  export declare const CHART_ACCOUNTS_CATEGORIES: {
3
7
  [key: string]: ChartAccountsCategoryEnum[];
4
8
  };
@@ -48,6 +48,7 @@ export declare class ChartAccounts extends ChartAccountsBase {
48
48
  isIncome(): boolean;
49
49
  isProperty(): boolean;
50
50
  isWorkExpense(): boolean;
51
+ isSoleExpense(): boolean;
51
52
  /**
52
53
  * Check if chart accounts is property expense
53
54
  */
@@ -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,4 @@
1
+ export declare enum ExportFormatEnum {
2
+ PDF = "PDF",
3
+ XLSX = "XLSX"
4
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Enum with symbols based on depreciation LVP asset type
3
+ */
4
+ export declare enum DepreciationLvpAssetTypeEnum {
5
+ PRIOR_YEARS = "A",
6
+ FIRST_YEAR = "L",
7
+ WRITTEN_OFF = "W"
8
+ }
@@ -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
- getCloseBalance(depreciation: Depreciation): Observable<number>;
33
+ getOpenBalance(depreciation: Depreciation): Observable<number>;
34
34
  /**
35
35
  * @TODO wrong place, move to collection model
36
36
  */
@@ -0,0 +1,5 @@
1
+ export declare enum MessagesEnum {
2
+ DELETED_MESSAGE = "Transaction deleted",
3
+ UPDATED_MESSAGE = "Transaction updated",
4
+ CREATED_MESSAGE = "Transaction(s) created"
5
+ }
@@ -7,6 +7,7 @@ import { RestService } from '../rest/rest.service';
7
7
  import { Transaction } from '../../../models/transaction/transaction';
8
8
  import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
9
9
  import { ChartAccountsTaxLabelsEnum } from '../../../models/chart-accounts/chart-accounts-tax-labels.enum';
10
+ import { ToastService } from '../../toast/toast.service';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
13
  * Service for transactions business logic
@@ -15,10 +16,11 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
15
16
  protected http: HttpClient;
16
17
  protected eventDispatcherService: EventDispatcherService;
17
18
  protected environment: any;
19
+ protected toastService: ToastService;
18
20
  url: string;
19
21
  modelClass: typeof Transaction;
20
22
  transactionDeleted: EventEmitter<Transaction>;
21
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
23
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
22
24
  /**
23
25
  * Listen events from Event Dispatcher services
24
26
  */
@@ -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
- * Download generated PDF file
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
  }
@@ -8,6 +8,10 @@ export declare class ToastService {
8
8
  toast$: ReplaySubject<Toast>;
9
9
  get(): Observable<Toast>;
10
10
  add(toast: Toast): void;
11
+ success(message: string): void;
12
+ warning(message: string): void;
13
+ error(message: string): void;
14
+ info(message: string): void;
11
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
12
16
  static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
13
17
  }
@@ -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
- /**s
5
- * Download generated Excel file
3
+ /**
4
+ * Export file form provided HTML tables
6
5
  */
7
- download(tables: DataTable<any>[], title: string, fileName: string): void;
8
- private generateFile;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.9.1",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
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';
@@ -336,8 +339,10 @@ export * from './lib/interfaces/event-listener.interface';
336
339
  export * from './lib/interfaces/income-source-forecast.interface';
337
340
  export * from './lib/interfaces/option.interface';
338
341
  export * from './lib/interfaces/photoable';
342
+ export * from './lib/interfaces/exportable.interface';
339
343
  export * from './lib/interfaces/receipt.interface';
340
344
  export * from './lib/interfaces/tank.interface';
345
+ export * from './lib/interfaces/updatable.interface';
341
346
  /**
342
347
  * Functions
343
348
  */
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS10YWJsZS1jb2x1bW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvbW9kZWxzL2RhdGEtdGFibGUvZGF0YS10YWJsZS1jb2x1bW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLGVBQWU7SUFrQjFCLFlBQ0UsSUFBWSxFQUNaLEdBQWdCLEVBQ2hCLEtBQWMsRUFDZCxJQUFtQjtRQWJyQjs7V0FFRztRQUNILFVBQUssR0FBWSxLQUFLLENBQUM7UUFZckIsSUF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tcbiAgfVxufVxuIl19
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS10YWJsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi9tb2RlbHMvZGF0YS10YWJsZS9kYXRhLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBOzs7R0FHRztBQUNILE1BQU0sT0FBTyxTQUFTO0lBaUJwQixZQUNFLFVBQTZCLEVBQzdCLE9BQWlDLEVBQ2pDLE9BQWUsRUFDZixhQUFzQjtRQUV0QixJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQztRQUN2QixJQUFJLEN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wgPyBzdW0gKyBOdW1iZXIoaXRlbVtjb2x1bW4ua2V5XSkgOiBzdW1cbiAgICAgIH0sIG51bGwpO1xuXG4gICAgICByZXR1cm4gKHRvdGFsVmFsdWUgPz8gJy0nKS50b1N0cmluZygpO1xuICAgIH0pO1xuICB9XG59XG4iXX0=
@@ -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
- }
@@ -1,4 +0,0 @@
1
- export declare enum DepreciationLvpRateEnum {
2
- FIRST_YEAR = 0.1875,
3
- DEFAULT = 0.375
4
- }