@sachin9822/reports-lib 0.0.211 → 0.0.213
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/karma.conf.js +44 -0
- package/ng-package.json +17 -0
- package/package.json +16 -31
- package/src/assets/images/BreadcrumbArrow.png +0 -0
- package/src/lib/assets/images/Search.svg +10 -0
- package/src/lib/assets/images/XMLogo.png +0 -0
- package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.html +27 -0
- package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.scss +46 -0
- package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.spec.ts +23 -0
- package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.ts +292 -0
- package/src/lib/components/accounting-report/accounting-report.component.html +64 -0
- package/src/lib/components/accounting-report/accounting-report.component.scss +24 -0
- package/src/lib/components/accounting-report/accounting-report.component.spec.ts +23 -0
- package/src/lib/components/accounting-report/accounting-report.component.ts +738 -0
- package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.html +46 -0
- package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.scss +2 -0
- package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.spec.ts +23 -0
- package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.ts +247 -0
- package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.html +46 -0
- package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.scss +3 -0
- package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.spec.ts +23 -0
- package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.ts +276 -0
- package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.html +51 -0
- package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.scss +7 -0
- package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.spec.ts +23 -0
- package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.ts +840 -0
- package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.html +68 -0
- package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.scss +65 -0
- package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.spec.ts +23 -0
- package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.ts +290 -0
- package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.html +25 -0
- package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.scss +1 -0
- package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.spec.ts +23 -0
- package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.ts +213 -0
- package/src/lib/components/funding-report/funding-report.component.html +49 -0
- package/src/lib/components/funding-report/funding-report.component.scss +1 -0
- package/src/lib/components/funding-report/funding-report.component.spec.ts +23 -0
- package/src/lib/components/funding-report/funding-report.component.ts +221 -0
- package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.html +26 -0
- package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.scss +1 -0
- package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.spec.ts +23 -0
- package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.ts +267 -0
- package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.html +95 -0
- package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.scss +54 -0
- package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.spec.ts +23 -0
- package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.ts +904 -0
- package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.html +49 -0
- package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.scss +2 -0
- package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.spec.ts +32 -0
- package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.ts +304 -0
- package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.html +46 -0
- package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.scss +7 -0
- package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.ts +343 -0
- package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.html +25 -0
- package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.scss +23 -0
- package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.spec.ts +23 -0
- package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.ts +745 -0
- package/src/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.ts +10 -0
- package/src/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.ts +20 -0
- package/src/lib/models/accounting-report/accounting-report-branch-group.ts +7 -0
- package/src/lib/models/accounting-report/accounting-report-entry-model.ts +25 -0
- package/src/lib/models/accounting-report/accounting-report-model.ts +7 -0
- package/{lib/models/accounting-report/accounting-report-sub-group.d.ts → src/lib/models/accounting-report/accounting-report-sub-group.ts} +3 -2
- package/{lib/models/app-config.model.d.ts → src/lib/models/app-config.model.ts} +8 -7
- package/src/lib/models/branch-activity-receive-report/branch-activity-receive.model.ts +18 -0
- package/src/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.ts +16 -0
- package/src/lib/models/branch-activity-report/branch-activity-send-report.ts +26 -0
- package/src/lib/models/cancellation-transaction-report/cancellation-transaction.model.ts +65 -0
- package/src/lib/models/component-loading-states.ts +5 -0
- package/src/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.ts +28 -0
- package/{lib/models/revenue-per-transaction-report/revenue-per-transaction.model.d.ts → src/lib/models/revenue-per-transaction-report/revenue-per-transaction.model.ts} +1 -1
- package/src/lib/models/statement-of-account-report/statement-of-accounts.model.ts +21 -0
- package/src/lib/models/transaction-enquiry-report/transaction-enquiry.model.ts +127 -0
- package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.ts +16 -0
- package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report.ts +29 -0
- package/src/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.ts +46 -0
- package/src/lib/reports-lib-routing.module.ts +20 -0
- package/src/lib/reports-lib.component.spec.ts +23 -0
- package/src/lib/reports-lib.component.ts +20 -0
- package/src/lib/reports-lib.module.ts +102 -0
- package/src/lib/reports-lib.service.spec.ts +16 -0
- package/src/lib/reports-lib.service.ts +9 -0
- package/src/lib/services/config.service.ts +43 -0
- package/src/lib/services/report.service.spec.ts +16 -0
- package/src/lib/services/report.service.ts +463 -0
- package/src/lib/shared/export-generic.service.ts +557 -0
- package/src/lib/shared/export.service.spec.ts +16 -0
- package/src/lib/shared/export.service.ts +457 -0
- package/src/lib/shared/loader/loader.component.html +8 -0
- package/src/lib/shared/loader/loader.component.scss +52 -0
- package/src/lib/shared/loader/loader.component.ts +10 -0
- package/src/lib/shared/metadata/metadata.component.html +42 -0
- package/src/lib/shared/metadata/metadata.component.scss +95 -0
- package/src/lib/shared/metadata/metadata.component.spec.ts +23 -0
- package/src/lib/shared/metadata/metadata.component.ts +38 -0
- package/src/lib/shared/page-size-selector/page-size-selector.component.html +7 -0
- package/src/lib/shared/page-size-selector/page-size-selector.component.scss +42 -0
- package/src/lib/shared/page-size-selector/page-size-selector.component.spec.ts +23 -0
- package/src/lib/shared/page-size-selector/page-size-selector.component.ts +38 -0
- package/src/lib/shared/search-filter/search-filter.component.html +601 -0
- package/src/lib/shared/search-filter/search-filter.component.scss +203 -0
- package/src/lib/shared/search-filter/search-filter.component.spec.ts +23 -0
- package/src/lib/shared/search-filter/search-filter.component.ts +2387 -0
- package/src/lib/shared/shared.module.ts +13 -0
- package/{public-api.d.ts → src/public-api.ts} +17 -7
- package/src/styles/ag-grid-report-style.scss +71 -0
- package/src/styles/common-ag-grid-style.scss +146 -0
- package/src/styles/common-report-style.scss +395 -0
- package/src/styles/common-style.scss +615 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.mjs +0 -240
- package/esm2020/lib/components/accounting-report/accounting-report.component.mjs +0 -596
- package/esm2020/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.mjs +0 -218
- package/esm2020/lib/components/branch-activity-send-report/branch-activity-send-report.component.mjs +0 -243
- package/esm2020/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.mjs +0 -700
- package/esm2020/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.mjs +0 -255
- package/esm2020/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.mjs +0 -192
- package/esm2020/lib/components/funding-report/funding-report.component.mjs +0 -198
- package/esm2020/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.mjs +0 -244
- package/esm2020/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.mjs +0 -776
- package/esm2020/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.mjs +0 -266
- package/esm2020/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.mjs +0 -311
- package/esm2020/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.mjs +0 -631
- package/esm2020/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.mjs +0 -2
- package/esm2020/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.mjs +0 -2
- package/esm2020/lib/models/accounting-report/accounting-report-branch-group.mjs +0 -2
- package/esm2020/lib/models/accounting-report/accounting-report-entry-model.mjs +0 -2
- package/esm2020/lib/models/accounting-report/accounting-report-model.mjs +0 -2
- package/esm2020/lib/models/accounting-report/accounting-report-sub-group.mjs +0 -2
- package/esm2020/lib/models/app-config.model.mjs +0 -2
- package/esm2020/lib/models/branch-activity-receive-report/branch-activity-receive.model.mjs +0 -2
- package/esm2020/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.mjs +0 -6
- package/esm2020/lib/models/branch-activity-report/branch-activity-send-report.mjs +0 -3
- package/esm2020/lib/models/cancellation-transaction-report/cancellation-transaction.model.mjs +0 -10
- package/esm2020/lib/models/component-loading-states.mjs +0 -7
- package/esm2020/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.mjs +0 -5
- package/esm2020/lib/models/revenue-per-transaction-report/revenue-per-transaction.model.mjs +0 -2
- package/esm2020/lib/models/statement-of-account-report/statement-of-accounts.model.mjs +0 -2
- package/esm2020/lib/models/transaction-enquiry-report/transaction-enquiry.model.mjs +0 -8
- package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.mjs +0 -6
- package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report.mjs +0 -5
- package/esm2020/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.mjs +0 -3
- package/esm2020/lib/reports-lib-routing.module.mjs +0 -24
- package/esm2020/lib/reports-lib.component.mjs +0 -22
- package/esm2020/lib/reports-lib.module.mjs +0 -172
- package/esm2020/lib/reports-lib.service.mjs +0 -14
- package/esm2020/lib/services/config.service.mjs +0 -39
- package/esm2020/lib/services/report.service.mjs +0 -374
- package/esm2020/lib/shared/export-generic.service.mjs +0 -443
- package/esm2020/lib/shared/export.service.mjs +0 -379
- package/esm2020/lib/shared/loader/loader.component.mjs +0 -11
- package/esm2020/lib/shared/metadata/metadata.component.mjs +0 -51
- package/esm2020/lib/shared/page-size-selector/page-size-selector.component.mjs +0 -44
- package/esm2020/lib/shared/search-filter/search-filter.component.mjs +0 -2134
- package/esm2020/lib/shared/shared.module.mjs +0 -21
- package/esm2020/public-api.mjs +0 -41
- package/esm2020/sachin9822-reports-lib.mjs +0 -5
- package/fesm2015/sachin9822-reports-lib.mjs +0 -8402
- package/fesm2015/sachin9822-reports-lib.mjs.map +0 -1
- package/fesm2020/sachin9822-reports-lib.mjs +0 -8384
- package/fesm2020/sachin9822-reports-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.d.ts +0 -70
- package/lib/components/accounting-report/accounting-report.component.d.ts +0 -76
- package/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.d.ts +0 -58
- package/lib/components/branch-activity-send-report/branch-activity-send-report.component.d.ts +0 -69
- package/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.d.ts +0 -78
- package/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.d.ts +0 -95
- package/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.d.ts +0 -55
- package/lib/components/funding-report/funding-report.component.d.ts +0 -55
- package/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.d.ts +0 -57
- package/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.d.ts +0 -109
- package/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.d.ts +0 -76
- package/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.d.ts +0 -68
- package/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.d.ts +0 -71
- package/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.d.ts +0 -8
- package/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.d.ts +0 -18
- package/lib/models/accounting-report/accounting-report-branch-group.d.ts +0 -6
- package/lib/models/accounting-report/accounting-report-entry-model.d.ts +0 -24
- package/lib/models/accounting-report/accounting-report-model.d.ts +0 -6
- package/lib/models/branch-activity-receive-report/branch-activity-receive.model.d.ts +0 -18
- package/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.d.ts +0 -13
- package/lib/models/branch-activity-report/branch-activity-send-report.d.ts +0 -24
- package/lib/models/cancellation-transaction-report/cancellation-transaction.model.d.ts +0 -44
- package/lib/models/component-loading-states.d.ts +0 -5
- package/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.d.ts +0 -26
- package/lib/models/statement-of-account-report/statement-of-accounts.model.d.ts +0 -18
- package/lib/models/transaction-enquiry-report/transaction-enquiry.model.d.ts +0 -113
- package/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.d.ts +0 -13
- package/lib/models/transaction-monitoring-report/transaction-monitoring-report.d.ts +0 -23
- package/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.d.ts +0 -38
- package/lib/reports-lib-routing.module.d.ts +0 -7
- package/lib/reports-lib.component.d.ts +0 -8
- package/lib/reports-lib.module.d.ts +0 -33
- package/lib/reports-lib.service.d.ts +0 -6
- package/lib/services/config.service.d.ts +0 -20
- package/lib/services/report.service.d.ts +0 -80
- package/lib/shared/export-generic.service.d.ts +0 -50
- package/lib/shared/export.service.d.ts +0 -32
- package/lib/shared/loader/loader.component.d.ts +0 -5
- package/lib/shared/metadata/metadata.component.d.ts +0 -24
- package/lib/shared/page-size-selector/page-size-selector.component.d.ts +0 -15
- package/lib/shared/search-filter/search-filter.component.d.ts +0 -127
- package/lib/shared/shared.module.d.ts +0 -11
- /package/{lib → src}/assets/images/Search.svg +0 -0
- /package/{lib/assets/images/XMLogo.png → src/assets/images/XMCoral.png} +0 -0
- /package/{lib → src/lib}/assets/config/app-config.json +0 -0
- /package/{lib → src/lib}/assets/svg-loaders/blue-tail-spin.svg +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { Component, inject, OnInit } from '@angular/core';
|
|
2
|
+
import { CreditLimitStatusEnquiryReportModel } from '../../models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model';
|
|
3
|
+
import { ReportService } from '../../services/report.service';
|
|
4
|
+
import { ExportService } from '../../shared/export.service';
|
|
5
|
+
import { ComponentLoadingStates } from '../../models/component-loading-states';
|
|
6
|
+
import { ColDef, ColumnApi, GridApi, GridReadyEvent } from 'ag-grid-community';
|
|
7
|
+
import { formatDate } from '@angular/common';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'lib-credit-limit-status-enquiry-report',
|
|
11
|
+
templateUrl: './credit-limit-status-enquiry-report.component.html',
|
|
12
|
+
styleUrls: ['./credit-limit-status-enquiry-report.component.scss']
|
|
13
|
+
})
|
|
14
|
+
export class CreditLimitStatusEnquiryReportComponent implements OnInit {
|
|
15
|
+
data: CreditLimitStatusEnquiryReportModel[] = [];
|
|
16
|
+
filteredData: CreditLimitStatusEnquiryReportModel[] = [];
|
|
17
|
+
user: string = "";
|
|
18
|
+
ReportName = "Credit Limit Status Enquiry";
|
|
19
|
+
reportService: ReportService = inject(ReportService);
|
|
20
|
+
exportService: ExportService = inject(ExportService);
|
|
21
|
+
reportDate: string;
|
|
22
|
+
fromDate: string;
|
|
23
|
+
toDate: string;
|
|
24
|
+
metaDataOne: Record<string, string>;
|
|
25
|
+
metaDataTwo: Record<string, string>;
|
|
26
|
+
ComponentLoadingState = ComponentLoadingStates;
|
|
27
|
+
loadingState: ComponentLoadingStates = ComponentLoadingStates.Complete;
|
|
28
|
+
selectedExportOption: string;
|
|
29
|
+
searchText: string = '';
|
|
30
|
+
pageSize: number = 15;
|
|
31
|
+
searchCriteria: [string, string][];
|
|
32
|
+
|
|
33
|
+
gridApi: GridApi;
|
|
34
|
+
gridColumnApi: ColumnApi;
|
|
35
|
+
showReport: boolean = false;
|
|
36
|
+
noDataFound: boolean = false;
|
|
37
|
+
isFormValid: boolean = false;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
columnDefs: ColDef<CreditLimitStatusEnquiryReportModel>[] = [
|
|
41
|
+
{ field: 'agentCode', headerName: 'Client Code', flex: 1, headerClass: 'ag-header-cell', minWidth: 100, tooltipField: 'agentCode', wrapText: true, autoHeight: true },
|
|
42
|
+
{ field: 'agentName', headerName: 'Client', flex: 1, headerClass: 'ag-header-cell', minWidth: 150, tooltipField: 'agentName', wrapText: true, autoHeight: true },
|
|
43
|
+
{ field: 'creditLimit', headerName: 'Credit Limit', flex: 1, headerClass: 'ag-header-cell', cellClass: 'ag-right-aligned-cell compact-cell', minWidth: 100, tooltipField: 'creditLimit', wrapText: true, autoHeight: true },
|
|
44
|
+
{ field: 'currencyCode', headerName: 'Settlement Currency', flex: 1, headerClass: 'ag-header-cell', minWidth: 80, tooltipField: 'currencyCode', wrapText: true, autoHeight: true },
|
|
45
|
+
{ field: 'requestTCLAmount', headerName: 'Requested TCL Amount', flex: 1, headerClass: 'ag-header-cell', cellClass: 'ag-right-aligned-cell compact-cell', minWidth: 100, tooltipField: 'requestTCLAmount', wrapText: true, autoHeight: true },
|
|
46
|
+
{ field: 'requestStatus', headerName: 'Transaction Status', flex: 1, headerClass: 'ag-header-cell', minWidth: 120, tooltipField: 'requestStatus', wrapText: true, autoHeight: true },
|
|
47
|
+
{ field: 'requestDescription', headerName: 'Request Description', flex: 1, headerClass: 'ag-header-cell', minWidth: 150, tooltipField: 'requestDescription', wrapText: true, autoHeight: true },
|
|
48
|
+
{ field: 'requestingUserId', headerName: 'Requesting User ID', flex: 1, headerClass: 'ag-header-cell', minWidth: 170, tooltipField: 'requestingUserId', wrapText: true, autoHeight: true },
|
|
49
|
+
{ field: 'requestingUser', headerName: 'Requesting User', flex: 1, headerClass: 'ag-header-cell', minWidth: 130, tooltipField: 'requestingUser', wrapText: true, autoHeight: true },
|
|
50
|
+
{ field: 'authorisingUserId', headerName: 'Authorising User ID', flex: 1, headerClass: 'ag-header-cell', minWidth: 170, tooltipField: 'authorisingUserId', wrapText: true, autoHeight: true },
|
|
51
|
+
{ field: 'authorisingUser', headerName: 'Authorising User', flex: 1, headerClass: 'ag-header-cell', minWidth: 130, tooltipField: 'authorisingUser', wrapText: true, autoHeight: true },
|
|
52
|
+
{ field: 'requestCreatedDate', headerName: 'Request Date', flex: 1, headerClass: 'ag-header-cell', minWidth: 130, tooltipField: 'requestCreatedDate', wrapText: true, autoHeight: true },
|
|
53
|
+
{ field: 'authorisedDate', headerName: 'Authorise Date', flex: 1, headerClass: 'ag-header-cell', minWidth: 150, tooltipField: 'authorisationDate', wrapText: true, autoHeight: true },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
defaultColDef = {
|
|
57
|
+
sortable: true,
|
|
58
|
+
filter: true,
|
|
59
|
+
resizable: true,
|
|
60
|
+
minwidth: 40,
|
|
61
|
+
wrapHeaderText: true,
|
|
62
|
+
autoHeaderHeight: true,
|
|
63
|
+
suppressSizeToFit: false,
|
|
64
|
+
wrapText: true
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
constructor() { }
|
|
68
|
+
|
|
69
|
+
ngOnInit(): void {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onGridReady(params: GridReadyEvent) {
|
|
73
|
+
this.gridApi = params.api;
|
|
74
|
+
this.gridColumnApi = params.columnApi;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
formatAmount(params: any): string {
|
|
78
|
+
if (params.value == null) return '0.000';
|
|
79
|
+
const num = Number(params.value);
|
|
80
|
+
return num.toFixed(3);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
onSearch(text: string) {
|
|
84
|
+
this.searchText = text.trim();
|
|
85
|
+
if (this.searchText === "") {
|
|
86
|
+
this.filteredData = JSON.parse(JSON.stringify(this.data));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const data = JSON.parse(JSON.stringify(this.data));
|
|
90
|
+
this.filteredData = data.filter((row) =>
|
|
91
|
+
Object.values(row).some(val => String(val).toLowerCase().includes(this.searchText.toLowerCase()))
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
handleExport(option: string) {
|
|
96
|
+
this.selectedExportOption = option;
|
|
97
|
+
if (this.selectedExportOption === 'pdf') {
|
|
98
|
+
this.exportToPDF();
|
|
99
|
+
} else if (this.selectedExportOption === 'excel') {
|
|
100
|
+
this.exportToExcel();
|
|
101
|
+
} else if (this.selectedExportOption === 'csv') {
|
|
102
|
+
this.exportToCSV();
|
|
103
|
+
} else {
|
|
104
|
+
alert('Please select a valid export format.');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
exportToExcel() {
|
|
109
|
+
if (!this.data?.length) return;
|
|
110
|
+
const title = this.ReportName;
|
|
111
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
112
|
+
['Report Period:', this.fromDate + " - " + this.toDate],
|
|
113
|
+
['Report User & Time:', this.user?this.user+" @ "+this.reportDate:''+" @ "+this.reportDate],
|
|
114
|
+
]);
|
|
115
|
+
// --- search criteria ---
|
|
116
|
+
const searchCriteria: [string, string][] = this.searchCriteria;
|
|
117
|
+
|
|
118
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.data, this.columnDefs, {
|
|
119
|
+
currencyFields: ['creditLimit', 'requestTCLAmount'],
|
|
120
|
+
rateFields: []
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
this.exportService.exportToExcelUniversal(title, metadata, searchCriteria, headers, rows, 'Credit_Limit_Status_Enquiry.xlsx');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
exportToPDF() {
|
|
127
|
+
if (!this.data?.length) return;
|
|
128
|
+
const title = this.ReportName;
|
|
129
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
130
|
+
['Report Period:', this.fromDate + " - " + this.toDate],
|
|
131
|
+
['Report User & Time:', this.user?this.user+" @ "+this.reportDate:''+" @ "+this.reportDate],
|
|
132
|
+
]);
|
|
133
|
+
|
|
134
|
+
// --- search criteria ---
|
|
135
|
+
const searchCriteria: [string, string][] = this.searchCriteria;
|
|
136
|
+
|
|
137
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.data, this.columnDefs, {
|
|
138
|
+
currencyFields: ['creditLimit', 'requestTCLAmount'],
|
|
139
|
+
rateFields: []
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
this.exportService.exportToPdfUniversal(title, metadata, searchCriteria, headers, rows, 'Credit_Limit_Status_Enquiry.pdf')
|
|
143
|
+
.then(() => {
|
|
144
|
+
console.log('PDF export completed.');
|
|
145
|
+
})
|
|
146
|
+
.catch(err => {
|
|
147
|
+
console.error('PDF export failed:', err);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
exportToCSV() {
|
|
152
|
+
if (!this.data?.length) return;
|
|
153
|
+
const title = this.ReportName;
|
|
154
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
155
|
+
['Report Period:', this.fromDate + " - " + this.toDate],
|
|
156
|
+
['Report User & Time:', this.user?this.user+" @ "+this.reportDate:''+" @ "+this.reportDate],
|
|
157
|
+
]);
|
|
158
|
+
// --- search criteria ---
|
|
159
|
+
const searchCriteria: [string, string][] = this.searchCriteria;
|
|
160
|
+
|
|
161
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.data, this.columnDefs, {
|
|
162
|
+
currencyFields: ['creditLimit', 'requestTCLAmount'],
|
|
163
|
+
rateFields: []
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
this.exportService.exportToCsvUniversal(title, metadata, searchCriteria, headers, rows, 'Credit_Limit_Status_Enquiry.csv');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
handleSearch(criteria: any) {
|
|
170
|
+
this.searchCriteria = criteria.searchCriteria;
|
|
171
|
+
this.reportDate = new Date().toISOString();
|
|
172
|
+
this.reportDate = formatDate(this.reportDate, 'dd/MM/yyyy hh:mm a', 'en-US');
|
|
173
|
+
const modal = criteria.modal;
|
|
174
|
+
this.user = criteria.sysUserID;
|
|
175
|
+
this.fromDate = formatDate(modal.fromDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
|
|
176
|
+
this.toDate = formatDate(modal.toDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
|
|
177
|
+
console.log(modal);
|
|
178
|
+
// Code For Meta Data
|
|
179
|
+
this.metaDataOne = {
|
|
180
|
+
'Report Period': this.fromDate + " - " + this.toDate,
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
this.metaDataTwo = {
|
|
184
|
+
'Report User & Time': this.user+" @ "+this.reportDate,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const searchData = {
|
|
188
|
+
"FromDate": modal.fromDate,
|
|
189
|
+
"ToDate": modal.toDate,
|
|
190
|
+
"AgentName": modal.client,
|
|
191
|
+
"Status": modal.transactionStatus
|
|
192
|
+
}
|
|
193
|
+
this.loadingState = ComponentLoadingStates.Loading;
|
|
194
|
+
this.reportService.getCreditLimitStatusEnquiryReport(searchData).subscribe({
|
|
195
|
+
next: (response) => {
|
|
196
|
+
this.data = response;
|
|
197
|
+
this.filteredData = JSON.parse(JSON.stringify(this.data));
|
|
198
|
+
this.noDataFound = this.data?.length === 0 ? true : false;
|
|
199
|
+
},
|
|
200
|
+
error: (err) => {
|
|
201
|
+
this.loadingState = ComponentLoadingStates.Complete;
|
|
202
|
+
},
|
|
203
|
+
complete: () => {
|
|
204
|
+
this.showReport = true;
|
|
205
|
+
this.loadingState = ComponentLoadingStates.Complete;
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
handleFormValid(isValid: boolean): void {
|
|
211
|
+
this.isFormValid = isValid;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<lib-search-filter
|
|
2
|
+
[ReportName]="ReportName"
|
|
3
|
+
(searchClicked)="handleSearch($event)"
|
|
4
|
+
(formValid)="handleFormValid($event)"
|
|
5
|
+
>
|
|
6
|
+
</lib-search-filter>
|
|
7
|
+
|
|
8
|
+
<app-loader *ngIf="loadingState === ComponentLoadingState.Loading"></app-loader>
|
|
9
|
+
|
|
10
|
+
<div *ngIf="errorMessage" class="error alert alert-danger mt-3">{{ errorMessage }}</div>
|
|
11
|
+
|
|
12
|
+
<div class="alert alert-warning mt-3" *ngIf="hasSearched && transactionData.length === 0 && !errorMessage">
|
|
13
|
+
No Data found matching your search criteria.
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<section *ngIf="showReport && isFormValid && transactionData.length > 0">
|
|
17
|
+
|
|
18
|
+
<lib-metadata
|
|
19
|
+
[reportName]="ReportName"
|
|
20
|
+
[showmetaDataOne]="true"
|
|
21
|
+
[showmetaDataTwo]="true"
|
|
22
|
+
[metaDataOne]="metaDataOne"
|
|
23
|
+
[metaDataTwo]="metaDataTwo"
|
|
24
|
+
(exportEvent)="handleExport($event)"
|
|
25
|
+
(searchEvent)="filter($event)">
|
|
26
|
+
</lib-metadata>
|
|
27
|
+
|
|
28
|
+
<div style="position: relative;" *ngIf="filteredData.length > 0">
|
|
29
|
+
|
|
30
|
+
<lib-page-size-selector
|
|
31
|
+
[totalEntries]="filteredData.length"
|
|
32
|
+
[defaultSize]="'15'"
|
|
33
|
+
[gridApi]="gridApi">
|
|
34
|
+
</lib-page-size-selector>
|
|
35
|
+
|
|
36
|
+
<ag-grid-angular class="ag-theme-alpine transaction-grid"
|
|
37
|
+
[rowData]="filteredData"
|
|
38
|
+
[columnDefs]="columnDefs"
|
|
39
|
+
[defaultColDef]="defaultColDef"
|
|
40
|
+
[rowHeight]="22"
|
|
41
|
+
[pagination]="true"
|
|
42
|
+
[headerHeight]="35"
|
|
43
|
+
[paginationPageSize]="paginationPageSize"
|
|
44
|
+
(gridReady)="onGridReady($event)"
|
|
45
|
+
style="width: 100%; height: 375px;">
|
|
46
|
+
</ag-grid-angular>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
</section>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'src/styles/ag-grid-report-style';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { FundingReportComponent } from './funding-report.component';
|
|
4
|
+
|
|
5
|
+
describe('FundingReportComponent', () => {
|
|
6
|
+
let component: FundingReportComponent;
|
|
7
|
+
let fixture: ComponentFixture<FundingReportComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ FundingReportComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(FundingReportComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { ReportService } from '../../services/report.service';
|
|
3
|
+
import { ComponentLoadingStates } from '../../models/component-loading-states';
|
|
4
|
+
import { finalize } from 'rxjs/operators';
|
|
5
|
+
import { ColDef, GridReadyEvent, GridApi, ColumnApi } from 'ag-grid-community';
|
|
6
|
+
import { formatDate } from '@angular/common';
|
|
7
|
+
import { ExportService } from '../../shared/export.service';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'lib-funding-report',
|
|
11
|
+
templateUrl: './funding-report.component.html',
|
|
12
|
+
styleUrls: ['./funding-report.component.scss']
|
|
13
|
+
})
|
|
14
|
+
export class FundingReportComponent implements OnInit {
|
|
15
|
+
ReportName = "Funding";
|
|
16
|
+
ComponentLoadingState = ComponentLoadingStates;
|
|
17
|
+
loadingState: ComponentLoadingStates = ComponentLoadingStates.Complete;
|
|
18
|
+
showReport: boolean = false;
|
|
19
|
+
metaDataOne: Record<string, string>;
|
|
20
|
+
metaDataTwo: Record<string, string>;
|
|
21
|
+
currentDateTime: Date = new Date();
|
|
22
|
+
searchText: string = '';
|
|
23
|
+
gridColumnApi: ColumnApi;
|
|
24
|
+
paginationPageSize: number = 15;
|
|
25
|
+
gridApi!: GridApi;
|
|
26
|
+
errorMessage: string;
|
|
27
|
+
hasSearched: boolean = false;
|
|
28
|
+
selectedExportOption: string;
|
|
29
|
+
reportUserandTime: string = '';
|
|
30
|
+
reportPeriod: string = '';
|
|
31
|
+
filteredData: any[] = [];
|
|
32
|
+
transactionData: any[] = [];
|
|
33
|
+
searchCriteria: [string, string][];
|
|
34
|
+
isFormValid: boolean = false;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
columnDefs: ColDef[] = [
|
|
38
|
+
{ headerName: 'Requested Date', field: 'requestedDate', flex: 1, minWidth: 73, tooltipField: 'requestedDate' },
|
|
39
|
+
{ headerName: 'Requested By Username', field: 'requestedByUsername', flex: 1, minWidth: 100, tooltipField: 'requestedByUsername' },
|
|
40
|
+
{ headerName: 'Requested By UserID', field: 'requestedByUserID', flex: 1, minWidth: 120, tooltipField: 'requestedByUserID' },
|
|
41
|
+
{ headerName: 'Client Code', field: 'clientCode', flex: 1, minWidth: 65, tooltipField: 'clientCode' },
|
|
42
|
+
{ headerName: 'Client', field: 'companyName', flex: 1, minWidth: 120, tooltipField: 'companyName' },
|
|
43
|
+
{ headerName: 'Country', field: 'country', flex: 1, minWidth: 60, tooltipField: 'country' },
|
|
44
|
+
{ headerName: 'Movement', field: 'movement', flex: 1, minWidth: 75, tooltipField: 'Movement' },
|
|
45
|
+
{ headerName: 'Funding Amount', field: 'fundingAmount', flex: 1, minWidth: 80, cellClass: 'ag-right-aligned-cell', tooltipField: 'fundingAmount' },
|
|
46
|
+
{ headerName: 'Funding Currency', field: 'fCcyCode', flex: 1, minWidth: 65, tooltipField: 'fCcyCode' },
|
|
47
|
+
{ headerName: 'Exchange Rate', field: 'exchangeRate', flex: 1, minWidth: 80, cellClass: 'ag-right-aligned-cell', tooltipField: 'exchangeRate' },
|
|
48
|
+
{ headerName: 'Amount in LC', field: 'amountInLC', flex: 1, minWidth: 80, cellClass: 'ag-right-aligned-cell', tooltipField: 'amountInLC' },
|
|
49
|
+
{ headerName: 'Local Currency', field: 'lCcyCode', flex: 1, minWidth: 65, tooltipField: 'lCcyCode' },
|
|
50
|
+
{ headerName: 'Authorized By UserID', field: 'authorizedByUserID', flex: 1, minWidth: 120, tooltipField: 'authorizedByUserID' },
|
|
51
|
+
{ headerName: 'Authorized By Username', field: 'authorizedByUsername', flex: 1, minWidth: 100, tooltipField: 'authorizedByUsername' },
|
|
52
|
+
{ headerName: 'Authorized Date', field: 'authorizedDate', flex: 1, minWidth: 75, tooltipField: 'authorizedDate' },
|
|
53
|
+
{ headerName: 'Transaction Status', field: 'transactionStatus', flex: 1, minWidth: 80, tooltipField: 'transactionStatus' },
|
|
54
|
+
{ headerName: 'Requester Comments', field: 'requesterComments', flex: 1, minWidth: 100, tooltipField: 'requesterComments' },
|
|
55
|
+
{ headerName: 'Authorizer Comments', field: 'authorizerComments', flex: 1, minWidth: 100, tooltipField: 'authorizerComments' }
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
defaultColDef = {
|
|
59
|
+
sortable: true,
|
|
60
|
+
filter: true,
|
|
61
|
+
resizable: true,
|
|
62
|
+
minwidth: 40,
|
|
63
|
+
wrapHeaderText: true,
|
|
64
|
+
autoHeaderHeight: true,
|
|
65
|
+
suppressSizeToFit: false,
|
|
66
|
+
wrapText: true,
|
|
67
|
+
autoHeight: true
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
constructor(private reportService: ReportService,
|
|
72
|
+
private exportService: ExportService,) { }
|
|
73
|
+
|
|
74
|
+
ngOnInit(): void {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
handleSearch(criteria: any): void {
|
|
78
|
+
this.searchCriteria = criteria.searchCriteria;
|
|
79
|
+
this.loadingState = ComponentLoadingStates.Loading;
|
|
80
|
+
this.showReport = false;
|
|
81
|
+
this.errorMessage = '';
|
|
82
|
+
this.selectedExportOption = 'excel';
|
|
83
|
+
const payload = criteria.modal;
|
|
84
|
+
this.reportUserandTime = `${criteria.sysUserID} @ ${formatDate(this.currentDateTime, 'dd/MM/yyyy hh:mm a', 'en-US')}`;
|
|
85
|
+
this.reportPeriod = criteria.reportPeriod;
|
|
86
|
+
this.metaDataOne = {
|
|
87
|
+
'Report Period': this.reportPeriod
|
|
88
|
+
}
|
|
89
|
+
this.metaDataTwo = {
|
|
90
|
+
'Report User & Time': this.reportUserandTime
|
|
91
|
+
}
|
|
92
|
+
this.searchCriteria = criteria.searchCriteria;
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const sdate = new Date(payload?.fromDate);
|
|
96
|
+
const edate = new Date(payload?.toDate);
|
|
97
|
+
payload.fromDate = sdate.toISOString().split("T")[0];
|
|
98
|
+
payload.toDate = edate.toISOString().split("T")[0];
|
|
99
|
+
} catch (err) {
|
|
100
|
+
throw new Error("Invalid Date");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.reportService.getFundingReport(payload)
|
|
104
|
+
.pipe(
|
|
105
|
+
finalize(() => {
|
|
106
|
+
this.loadingState = ComponentLoadingStates.Complete;
|
|
107
|
+
})
|
|
108
|
+
)
|
|
109
|
+
.subscribe({
|
|
110
|
+
next: (data) => {
|
|
111
|
+
this.transactionData = Array.isArray(data) ? data : [];
|
|
112
|
+
this.filteredData = JSON.parse(JSON.stringify(data));
|
|
113
|
+
this.showReport = true;
|
|
114
|
+
this.hasSearched = true;
|
|
115
|
+
},
|
|
116
|
+
error: (error) => {
|
|
117
|
+
console.error('Error fetching Funding Report:', error);
|
|
118
|
+
this.errorMessage = 'An error occurred while fetching the report. Please try again later.';
|
|
119
|
+
this.showReport = false;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
filter(text: string): void {
|
|
125
|
+
this.searchText = text.trim();
|
|
126
|
+
if (this.searchText?.length === 0) {
|
|
127
|
+
this.filteredData = [...this.transactionData];
|
|
128
|
+
} else {
|
|
129
|
+
this.filteredData = this.transactionData.filter(row =>
|
|
130
|
+
Object.values(row).some(val =>
|
|
131
|
+
String(val).toLowerCase().includes(this.searchText.toLowerCase())
|
|
132
|
+
)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onGridReady(params: GridReadyEvent): void {
|
|
138
|
+
this.gridApi = params.api;
|
|
139
|
+
this.gridColumnApi = params.columnApi;
|
|
140
|
+
this.gridApi.sizeColumnsToFit();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
handleExport(option: string) {
|
|
144
|
+
this.selectedExportOption = option;
|
|
145
|
+
if (this.selectedExportOption === 'pdf') {
|
|
146
|
+
this.exportToPDF();
|
|
147
|
+
} else if (this.selectedExportOption === 'excel') {
|
|
148
|
+
this.exportToExcel();
|
|
149
|
+
} else if (this.selectedExportOption === 'csv') {
|
|
150
|
+
this.exportToCSV();
|
|
151
|
+
} else {
|
|
152
|
+
alert('Please select a valid export format.');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
onExportChange(value: string): void {
|
|
157
|
+
this.selectedExportOption = value;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
exportToPDF(): void {
|
|
161
|
+
if (!this.transactionData?.length) return;
|
|
162
|
+
|
|
163
|
+
const title = 'Funding';
|
|
164
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
165
|
+
['Report Period :', this.reportPeriod],
|
|
166
|
+
['Report User and Time :', this.reportUserandTime]
|
|
167
|
+
]);
|
|
168
|
+
|
|
169
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.transactionData, this.columnDefs, {
|
|
170
|
+
currencyFields: [],
|
|
171
|
+
rateFields: []
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
this.exportService.exportToPdfUniversal(title, metadata, this.searchCriteria, headers, rows, 'Funding.pdf')
|
|
175
|
+
.then(() => {
|
|
176
|
+
console.log('PDF export completed.');
|
|
177
|
+
})
|
|
178
|
+
.catch(err => {
|
|
179
|
+
console.error('PDF export failed:', err);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
exportToExcel(): void {
|
|
184
|
+
if (!this.transactionData?.length) return;
|
|
185
|
+
|
|
186
|
+
const title = 'Funding';
|
|
187
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
188
|
+
['Report Period ', this.reportPeriod],
|
|
189
|
+
['Report User and Time ', this.reportUserandTime]
|
|
190
|
+
]);
|
|
191
|
+
|
|
192
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.transactionData, this.columnDefs, {
|
|
193
|
+
currencyFields: [],
|
|
194
|
+
rateFields: []
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
this.exportService.exportToExcelUniversal(title, metadata, this.searchCriteria, headers, rows, 'Funding.xlsx');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
exportToCSV(): void {
|
|
201
|
+
if (!this.transactionData?.length) return;
|
|
202
|
+
|
|
203
|
+
const title = 'Funding';
|
|
204
|
+
const metadata = this.exportService.generateReportMetadata([
|
|
205
|
+
['Report Period: ', this.reportPeriod],
|
|
206
|
+
['Report User and Time: ', this.reportUserandTime]
|
|
207
|
+
]);
|
|
208
|
+
|
|
209
|
+
const { headers, rows } = this.exportService.prepareExportTable(this.transactionData, this.columnDefs, {
|
|
210
|
+
currencyFields: ['fundingAmount', 'amountInLC'],
|
|
211
|
+
rateFields: ['exchangeRate']
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
this.exportService.exportToCsvUniversal(title, metadata, this.searchCriteria, headers, rows, 'Funding.csv');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
handleFormValid(isValid: boolean): void {
|
|
218
|
+
this.isFormValid = isValid;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<lib-search-filter [ReportName]="ReportName" (searchClicked)="handleSearch($event)" (formValid)="handleFormValid($event)">
|
|
2
|
+
</lib-search-filter>
|
|
3
|
+
<app-loader class="" *ngIf="loadingState == ComponentLoadingState.Loading"></app-loader>
|
|
4
|
+
<section *ngIf="showReport && isFormValid" class="my-2 mx-1">
|
|
5
|
+
|
|
6
|
+
<ng-container *ngIf="!noDataFound">
|
|
7
|
+
<lib-metadata [reportName]="ReportName" [showmetaDataOne]="true" [showmetaDataTwo]="true"
|
|
8
|
+
[metaDataOne]="metaDataOne" [metaDataTwo]="metaDataTwo" (exportEvent)="handleExport($event)"
|
|
9
|
+
(searchEvent)="onSearch($event)"></lib-metadata>
|
|
10
|
+
<div style="position: relative;" *ngIf="filteredData?.length>0">
|
|
11
|
+
<lib-page-size-selector [totalEntries]="data?.length" [defaultSize]="'15'" [gridApi]="gridApi">
|
|
12
|
+
></lib-page-size-selector>
|
|
13
|
+
|
|
14
|
+
<ag-grid-angular class="ag-theme-alpine transaction-grid" style="width: 100%;height: 407px;"
|
|
15
|
+
[columnDefs]="columnDefs" [defaultColDef]="defaultColDef" [rowData]="filteredData" [rowHeight]="20"
|
|
16
|
+
[headerHeight]="22" [pagination]="true" [paginationPageSize]="pageSize"
|
|
17
|
+
(gridReady)="onGridReady($event)">
|
|
18
|
+
</ag-grid-angular>
|
|
19
|
+
</div>
|
|
20
|
+
</ng-container>
|
|
21
|
+
|
|
22
|
+
<div class="alert alert-warning mt-3" *ngIf="noDataFound">
|
|
23
|
+
No Data found matching your search criteria.
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
</section>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'src/styles/ag-grid-report-style.scss';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RevenuePerTransactionReportComponent } from './revenue-per-transaction-report.component';
|
|
4
|
+
|
|
5
|
+
describe('RevenuePerTransactionReportComponent', () => {
|
|
6
|
+
let component: RevenuePerTransactionReportComponent;
|
|
7
|
+
let fixture: ComponentFixture<RevenuePerTransactionReportComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ RevenuePerTransactionReportComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RevenuePerTransactionReportComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|