@sachin9822/reports-lib 0.0.211 → 0.0.212

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 (211) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +17 -0
  3. package/package.json +16 -31
  4. package/src/assets/images/BreadcrumbArrow.png +0 -0
  5. package/src/lib/assets/images/Search.svg +10 -0
  6. package/src/lib/assets/images/XMLogo.png +0 -0
  7. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.html +27 -0
  8. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.scss +46 -0
  9. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.spec.ts +23 -0
  10. package/src/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.ts +292 -0
  11. package/src/lib/components/accounting-report/accounting-report.component.html +64 -0
  12. package/src/lib/components/accounting-report/accounting-report.component.scss +24 -0
  13. package/src/lib/components/accounting-report/accounting-report.component.spec.ts +23 -0
  14. package/src/lib/components/accounting-report/accounting-report.component.ts +738 -0
  15. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.html +46 -0
  16. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.scss +2 -0
  17. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.spec.ts +23 -0
  18. package/src/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.ts +247 -0
  19. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.html +46 -0
  20. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.scss +3 -0
  21. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.spec.ts +23 -0
  22. package/src/lib/components/branch-activity-send-report/branch-activity-send-report.component.ts +276 -0
  23. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.html +51 -0
  24. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.scss +7 -0
  25. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.spec.ts +23 -0
  26. package/src/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.ts +840 -0
  27. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.html +68 -0
  28. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.scss +65 -0
  29. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.spec.ts +23 -0
  30. package/src/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.ts +290 -0
  31. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.html +25 -0
  32. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.scss +1 -0
  33. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.spec.ts +23 -0
  34. package/src/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.ts +213 -0
  35. package/src/lib/components/funding-report/funding-report.component.html +49 -0
  36. package/src/lib/components/funding-report/funding-report.component.scss +1 -0
  37. package/src/lib/components/funding-report/funding-report.component.spec.ts +23 -0
  38. package/src/lib/components/funding-report/funding-report.component.ts +221 -0
  39. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.html +26 -0
  40. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.scss +1 -0
  41. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.spec.ts +23 -0
  42. package/src/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.ts +267 -0
  43. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.html +95 -0
  44. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.scss +54 -0
  45. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.spec.ts +23 -0
  46. package/src/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.ts +904 -0
  47. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.html +49 -0
  48. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.scss +2 -0
  49. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.spec.ts +32 -0
  50. package/src/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.ts +304 -0
  51. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.html +46 -0
  52. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.scss +7 -0
  53. package/src/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.ts +343 -0
  54. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.html +25 -0
  55. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.scss +23 -0
  56. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.spec.ts +23 -0
  57. package/src/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.ts +745 -0
  58. package/src/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.ts +10 -0
  59. package/src/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.ts +20 -0
  60. package/src/lib/models/accounting-report/accounting-report-branch-group.ts +7 -0
  61. package/src/lib/models/accounting-report/accounting-report-entry-model.ts +25 -0
  62. package/src/lib/models/accounting-report/accounting-report-model.ts +7 -0
  63. package/{lib/models/accounting-report/accounting-report-sub-group.d.ts → src/lib/models/accounting-report/accounting-report-sub-group.ts} +3 -2
  64. package/{lib/models/app-config.model.d.ts → src/lib/models/app-config.model.ts} +8 -7
  65. package/src/lib/models/branch-activity-receive-report/branch-activity-receive.model.ts +18 -0
  66. package/src/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.ts +16 -0
  67. package/src/lib/models/branch-activity-report/branch-activity-send-report.ts +26 -0
  68. package/src/lib/models/cancellation-transaction-report/cancellation-transaction.model.ts +65 -0
  69. package/src/lib/models/component-loading-states.ts +5 -0
  70. package/src/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.ts +28 -0
  71. 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
  72. package/src/lib/models/statement-of-account-report/statement-of-accounts.model.ts +21 -0
  73. package/src/lib/models/transaction-enquiry-report/transaction-enquiry.model.ts +127 -0
  74. package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.ts +16 -0
  75. package/src/lib/models/transaction-monitoring-report/transaction-monitoring-report.ts +29 -0
  76. package/src/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.ts +46 -0
  77. package/src/lib/reports-lib-routing.module.ts +20 -0
  78. package/src/lib/reports-lib.component.spec.ts +23 -0
  79. package/src/lib/reports-lib.component.ts +20 -0
  80. package/src/lib/reports-lib.module.ts +102 -0
  81. package/src/lib/reports-lib.service.spec.ts +16 -0
  82. package/src/lib/reports-lib.service.ts +9 -0
  83. package/src/lib/services/config.service.ts +43 -0
  84. package/src/lib/services/report.service.spec.ts +16 -0
  85. package/src/lib/services/report.service.ts +463 -0
  86. package/src/lib/shared/export-generic.service.ts +557 -0
  87. package/src/lib/shared/export.service.spec.ts +16 -0
  88. package/src/lib/shared/export.service.ts +457 -0
  89. package/src/lib/shared/loader/loader.component.html +8 -0
  90. package/src/lib/shared/loader/loader.component.scss +52 -0
  91. package/src/lib/shared/loader/loader.component.ts +10 -0
  92. package/src/lib/shared/metadata/metadata.component.html +42 -0
  93. package/src/lib/shared/metadata/metadata.component.scss +95 -0
  94. package/src/lib/shared/metadata/metadata.component.spec.ts +23 -0
  95. package/src/lib/shared/metadata/metadata.component.ts +38 -0
  96. package/src/lib/shared/page-size-selector/page-size-selector.component.html +7 -0
  97. package/src/lib/shared/page-size-selector/page-size-selector.component.scss +42 -0
  98. package/src/lib/shared/page-size-selector/page-size-selector.component.spec.ts +23 -0
  99. package/src/lib/shared/page-size-selector/page-size-selector.component.ts +38 -0
  100. package/src/lib/shared/search-filter/search-filter.component.html +601 -0
  101. package/src/lib/shared/search-filter/search-filter.component.scss +203 -0
  102. package/src/lib/shared/search-filter/search-filter.component.spec.ts +23 -0
  103. package/src/lib/shared/search-filter/search-filter.component.ts +2387 -0
  104. package/src/lib/shared/shared.module.ts +13 -0
  105. package/{public-api.d.ts → src/public-api.ts} +17 -7
  106. package/src/styles/ag-grid-report-style.scss +71 -0
  107. package/src/styles/common-ag-grid-style.scss +146 -0
  108. package/src/styles/common-report-style.scss +395 -0
  109. package/src/styles/common-style.scss +615 -0
  110. package/src/test.ts +27 -0
  111. package/tsconfig.lib.json +15 -0
  112. package/tsconfig.lib.prod.json +10 -0
  113. package/tsconfig.spec.json +17 -0
  114. package/esm2020/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.mjs +0 -240
  115. package/esm2020/lib/components/accounting-report/accounting-report.component.mjs +0 -596
  116. package/esm2020/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.mjs +0 -218
  117. package/esm2020/lib/components/branch-activity-send-report/branch-activity-send-report.component.mjs +0 -243
  118. package/esm2020/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.mjs +0 -700
  119. package/esm2020/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.mjs +0 -255
  120. package/esm2020/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.mjs +0 -192
  121. package/esm2020/lib/components/funding-report/funding-report.component.mjs +0 -198
  122. package/esm2020/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.mjs +0 -244
  123. package/esm2020/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.mjs +0 -776
  124. package/esm2020/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.mjs +0 -266
  125. package/esm2020/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.mjs +0 -311
  126. package/esm2020/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.mjs +0 -631
  127. package/esm2020/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.mjs +0 -2
  128. package/esm2020/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.mjs +0 -2
  129. package/esm2020/lib/models/accounting-report/accounting-report-branch-group.mjs +0 -2
  130. package/esm2020/lib/models/accounting-report/accounting-report-entry-model.mjs +0 -2
  131. package/esm2020/lib/models/accounting-report/accounting-report-model.mjs +0 -2
  132. package/esm2020/lib/models/accounting-report/accounting-report-sub-group.mjs +0 -2
  133. package/esm2020/lib/models/app-config.model.mjs +0 -2
  134. package/esm2020/lib/models/branch-activity-receive-report/branch-activity-receive.model.mjs +0 -2
  135. package/esm2020/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.mjs +0 -6
  136. package/esm2020/lib/models/branch-activity-report/branch-activity-send-report.mjs +0 -3
  137. package/esm2020/lib/models/cancellation-transaction-report/cancellation-transaction.model.mjs +0 -10
  138. package/esm2020/lib/models/component-loading-states.mjs +0 -7
  139. package/esm2020/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.mjs +0 -5
  140. package/esm2020/lib/models/revenue-per-transaction-report/revenue-per-transaction.model.mjs +0 -2
  141. package/esm2020/lib/models/statement-of-account-report/statement-of-accounts.model.mjs +0 -2
  142. package/esm2020/lib/models/transaction-enquiry-report/transaction-enquiry.model.mjs +0 -8
  143. package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.mjs +0 -6
  144. package/esm2020/lib/models/transaction-monitoring-report/transaction-monitoring-report.mjs +0 -5
  145. package/esm2020/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.mjs +0 -3
  146. package/esm2020/lib/reports-lib-routing.module.mjs +0 -24
  147. package/esm2020/lib/reports-lib.component.mjs +0 -22
  148. package/esm2020/lib/reports-lib.module.mjs +0 -172
  149. package/esm2020/lib/reports-lib.service.mjs +0 -14
  150. package/esm2020/lib/services/config.service.mjs +0 -39
  151. package/esm2020/lib/services/report.service.mjs +0 -374
  152. package/esm2020/lib/shared/export-generic.service.mjs +0 -443
  153. package/esm2020/lib/shared/export.service.mjs +0 -379
  154. package/esm2020/lib/shared/loader/loader.component.mjs +0 -11
  155. package/esm2020/lib/shared/metadata/metadata.component.mjs +0 -51
  156. package/esm2020/lib/shared/page-size-selector/page-size-selector.component.mjs +0 -44
  157. package/esm2020/lib/shared/search-filter/search-filter.component.mjs +0 -2134
  158. package/esm2020/lib/shared/shared.module.mjs +0 -21
  159. package/esm2020/public-api.mjs +0 -41
  160. package/esm2020/sachin9822-reports-lib.mjs +0 -5
  161. package/fesm2015/sachin9822-reports-lib.mjs +0 -8402
  162. package/fesm2015/sachin9822-reports-lib.mjs.map +0 -1
  163. package/fesm2020/sachin9822-reports-lib.mjs +0 -8384
  164. package/fesm2020/sachin9822-reports-lib.mjs.map +0 -1
  165. package/index.d.ts +0 -5
  166. package/lib/components/acc-gl-details-enquiry-report/acc-gl-details-enquiry-report.component.d.ts +0 -70
  167. package/lib/components/accounting-report/accounting-report.component.d.ts +0 -76
  168. package/lib/components/branch-activity-receive-report/branch-activity-receive-report.component.d.ts +0 -58
  169. package/lib/components/branch-activity-send-report/branch-activity-send-report.component.d.ts +0 -69
  170. package/lib/components/branch-activity-send-summary-report/branch-activity-send-summary-report.component.d.ts +0 -78
  171. package/lib/components/cancellation-transaction-report/cancellation-transaction-report.component.d.ts +0 -95
  172. package/lib/components/credit-limit-status-enquiry-report/credit-limit-status-enquiry-report.component.d.ts +0 -55
  173. package/lib/components/funding-report/funding-report.component.d.ts +0 -55
  174. package/lib/components/revenue-per-transaction-report/revenue-per-transaction-report.component.d.ts +0 -57
  175. package/lib/components/statement-of-accounts-report/statement-of-accounts-report.component.d.ts +0 -109
  176. package/lib/components/transaction-enquiry-report/transaction-enquiry-report.component.d.ts +0 -76
  177. package/lib/components/transaction-monitoring-report/transaction-monitoring-report.component.d.ts +0 -68
  178. package/lib/components/trial-balance-accounts-report/trial-balance-accounts-report.component.d.ts +0 -71
  179. package/lib/models/acc-gl-details-enquiry-report/accgl-details-enquiry-reportmodel.d.ts +0 -8
  180. package/lib/models/acc-gl-details-enquiry-report/journal-voucher-entry-model.d.ts +0 -18
  181. package/lib/models/accounting-report/accounting-report-branch-group.d.ts +0 -6
  182. package/lib/models/accounting-report/accounting-report-entry-model.d.ts +0 -24
  183. package/lib/models/accounting-report/accounting-report-model.d.ts +0 -6
  184. package/lib/models/branch-activity-receive-report/branch-activity-receive.model.d.ts +0 -18
  185. package/lib/models/branch-activity-report/branch-activity-send-report-request-domain-model.d.ts +0 -13
  186. package/lib/models/branch-activity-report/branch-activity-send-report.d.ts +0 -24
  187. package/lib/models/cancellation-transaction-report/cancellation-transaction.model.d.ts +0 -44
  188. package/lib/models/component-loading-states.d.ts +0 -5
  189. package/lib/models/credit-limit-status-enquiry-report/credit-limit-status-enquiry.model.d.ts +0 -26
  190. package/lib/models/statement-of-account-report/statement-of-accounts.model.d.ts +0 -18
  191. package/lib/models/transaction-enquiry-report/transaction-enquiry.model.d.ts +0 -113
  192. package/lib/models/transaction-monitoring-report/transaction-monitoring-report-request-domain-model.d.ts +0 -13
  193. package/lib/models/transaction-monitoring-report/transaction-monitoring-report.d.ts +0 -23
  194. package/lib/models/trial-balance-accounts-report/trial-balance-accounts.models.d.ts +0 -38
  195. package/lib/reports-lib-routing.module.d.ts +0 -7
  196. package/lib/reports-lib.component.d.ts +0 -8
  197. package/lib/reports-lib.module.d.ts +0 -33
  198. package/lib/reports-lib.service.d.ts +0 -6
  199. package/lib/services/config.service.d.ts +0 -20
  200. package/lib/services/report.service.d.ts +0 -80
  201. package/lib/shared/export-generic.service.d.ts +0 -50
  202. package/lib/shared/export.service.d.ts +0 -32
  203. package/lib/shared/loader/loader.component.d.ts +0 -5
  204. package/lib/shared/metadata/metadata.component.d.ts +0 -24
  205. package/lib/shared/page-size-selector/page-size-selector.component.d.ts +0 -15
  206. package/lib/shared/search-filter/search-filter.component.d.ts +0 -127
  207. package/lib/shared/shared.module.d.ts +0 -11
  208. /package/{lib → src}/assets/images/Search.svg +0 -0
  209. /package/{lib/assets/images/XMLogo.png → src/assets/images/XMCoral.png} +0 -0
  210. /package/{lib → src/lib}/assets/config/app-config.json +0 -0
  211. /package/{lib → src/lib}/assets/svg-loaders/blue-tail-spin.svg +0 -0
@@ -0,0 +1,46 @@
1
+ <lib-search-filter
2
+ [ReportName]="ReportName"
3
+ (searchClicked)="handleSearch($event)"
4
+ (formValid)="handleFormValid($event)">
5
+ </lib-search-filter>
6
+
7
+ <app-loader class="" *ngIf="loadingState == ComponentLoadingState.Loading"></app-loader>
8
+
9
+ <section *ngIf="showReport && isFormValid" class="my-2 mx-1">
10
+ <ng-container *ngIf="!noDataFound">
11
+ <lib-metadata [reportName]="ReportName" [showmetaDataOne]="true" [showmetaDataTwo]="true" [metaDataOne]="metaDataOne" [metaDataTwo]="metaDataTwo" (exportEvent)="handleExport($event)" (searchEvent)="filter($event)"></lib-metadata>
12
+
13
+ <ngb-accordion #acc="ngbAccordion" [closeOthers]="false">
14
+ <ng-container *ngFor="let item of filteredData | keyvalue; let i = index">
15
+ <ngb-panel *ngIf="item.value.length > 0" [id]="'panel-' + i">
16
+
17
+ <ng-template ngbPanelTitle style="height: 10%;">
18
+ <label class="panel-cls">{{
19
+ item.key
20
+ }}</label>
21
+ </ng-template>
22
+
23
+ <ng-template ngbPanelContent>
24
+
25
+ <div style="position: relative;">
26
+ <lib-page-size-selector [totalEntries]="item?.value?.length"
27
+ [defaultSize]="'15'" [gridApi]="gridApis[i]">
28
+ ></lib-page-size-selector>
29
+
30
+ <ag-grid-angular class="ag-theme-alpine transaction-grid" style="width: 100%;height: 407px;"
31
+ [columnDefs]="columnDefs" [defaultColDef]="defaultColDef" [rowData]="item.value" [rowHeight]="20"
32
+ [headerHeight]="22"[pagination]="true" [paginationPageSize]="paginationArray[i]" (gridReady)="onGridReady($event,i)"
33
+ >
34
+ </ag-grid-angular>
35
+ </div>
36
+ </ng-template>
37
+
38
+ </ngb-panel>
39
+ </ng-container>
40
+ </ngb-accordion>
41
+ </ng-container>
42
+ <div class="alert alert-warning mt-3" *ngIf="noDataFound">
43
+ No Data found matching your search criteria.
44
+ </div>
45
+
46
+ </section>
@@ -0,0 +1,2 @@
1
+ @import 'src/styles/common-report-style.scss';
2
+ @import 'src/styles/ag-grid-report-style.scss';
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { BranchActivityReceiveReportComponent } from './branch-activity-receive-report.component';
4
+
5
+ describe('BranchActivityReceiveReportComponent', () => {
6
+ let component: BranchActivityReceiveReportComponent;
7
+ let fixture: ComponentFixture<BranchActivityReceiveReportComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ BranchActivityReceiveReportComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(BranchActivityReceiveReportComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,247 @@
1
+ import { Component, inject, OnInit } from '@angular/core';
2
+ import { ColDef, GridApi, GridOptions, GridReadyEvent } from 'ag-grid-community';
3
+ import { ReportService } from '../../services/report.service';
4
+ import { formatDate } from '@angular/common';
5
+ import { ComponentLoadingStates } from '../../models/component-loading-states';
6
+ import { BranchActivityReceiveReportModel } from '../../models/branch-activity-receive-report/branch-activity-receive.model';
7
+ import 'jspdf-autotable';
8
+ import { GenericExportService } from '../../shared/export-generic.service';
9
+
10
+ @Component({
11
+ selector: 'lib-branch-activity-receive-report',
12
+ templateUrl: './branch-activity-receive-report.component.html',
13
+ styleUrls: ['./branch-activity-receive-report.component.scss']
14
+ })
15
+ export class BranchActivityReceiveReportComponent implements OnInit {
16
+ data: any = [];
17
+ dataMap: Record<string, BranchActivityReceiveReportModel[]> = {}
18
+ filteredData: Record<string, BranchActivityReceiveReportModel[]> = {}
19
+ user: string = "";
20
+ ReportName = "Branch Activity Receive"
21
+ reportService: ReportService = inject(ReportService);
22
+ reportDate: string;
23
+ fromDate: string;
24
+ toDate: string;
25
+ metaDataOne: Record<string, string>;
26
+ metaDataTwo: Record<string, string>;
27
+ ComponentLoadingState = ComponentLoadingStates;
28
+ loadingState: ComponentLoadingStates = ComponentLoadingStates.Complete;
29
+ paginationArray: any[];
30
+ selectedExportOption: string;
31
+ private logoBase64: string | undefined;
32
+ searchText: string = '';
33
+ exportService: GenericExportService = inject(GenericExportService);
34
+
35
+ gridApis: GridApi[] = [];
36
+ searchCriteria: [string, string][];
37
+
38
+ showReport: boolean = false;
39
+ noDataFound: boolean = false;
40
+ isFormValid: boolean = false;
41
+
42
+
43
+ columnDefs: ColDef<BranchActivityReceiveReportModel>[] = [
44
+ { field: 'businessDateTime', headerName: 'Business Date', flex: 1, wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90, width: 70, tooltipField: 'businessDateTime' },
45
+ { field: 'transactionDateAndTime', headerName: 'Receive Date', minWidth: 100, flex: 2, headerClass: 'ag-header-cell', wrapText: true, autoHeight: true, tooltipField: 'transactionDateAndTime' },
46
+ { field: 'transactionNumber', headerName: 'Transaction Number', minWidth: 90, flex: 1.8,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', width: 130, cellClass: 'ag-left-cols-cell compact-cell-transaction', tooltipField: 'transactionNumber' },
47
+ { field: 'product', headerName: 'Product', minWidth: 80, flex: 0.5,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', width: 120, tooltipField: 'product' },
48
+ { field: 'senderName', headerName: 'Sender Name', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90,width: 130, tooltipField: 'senderName' },
49
+ { field: 'sendAgentCode', headerName: 'Send ClientCode', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90, width: 70, tooltipField: 'sendAgentCode' },
50
+ { field: 'receiverName', headerName: 'Receiver Name', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90, width: 130, tooltipField: 'receiverName' },
51
+ { field: 'receiveAgentBranchCode', headerName: 'ReceiveClient BranchCode', headerClass: 'ag-header-cell', flex: 1,wrapText: true, autoHeight: true, minWidth: 100, maxWidth: 120, tooltipField: 'receiveAgentBranchCode' },
52
+ { field: 'payOutCurrency', headerName: 'Receive CcyCode', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90, maxWidth: 100, tooltipField: 'payOutCurrency' },
53
+ { field: 'amountPaid', headerName: 'Amount Paid', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', minWidth: 90,width: 100, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'amountPaid' },
54
+ { field: 'status', headerName: 'Transaction Status', minWidth: 90, flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-header-cell', tooltipField: 'status' }
55
+ ];
56
+
57
+ defaultColDef = {
58
+ sortable: true,
59
+ filter: true,
60
+ resizable: true,
61
+ minwidth: 40,
62
+ wrapHeaderText: true,
63
+ autoHeaderHeight: true,
64
+ suppressSizeToFit: false,
65
+ wrapText: true
66
+ };
67
+
68
+ constructor() { }
69
+
70
+ ngOnInit(): void {
71
+
72
+ }
73
+
74
+ onGridReady(params: GridReadyEvent, id: number) {
75
+ params.api.sizeColumnsToFit();
76
+ this.gridApis[id] = params.api;
77
+ }
78
+
79
+ // Currency Formatter
80
+
81
+ formatAmount(params: any): string {
82
+ if (params.value == null) return '0.000';
83
+ const num = Number(params.value);
84
+ return num.toFixed(3);
85
+ }
86
+
87
+ handleExport(option: string): void {
88
+ this.selectedExportOption = option;
89
+ if (!this.hasAnyGroups()) {
90
+ alert("There is no data to export based on your current filter.");
91
+ return;
92
+ }
93
+ // If no data, do nothing.
94
+ if (!this.filteredData || Object.keys(this.filteredData).length === 0) {
95
+ alert("No data to export");
96
+ return;
97
+ }
98
+ const title = "Branch Activity Receive";
99
+ const reportTimeFormatter = this.dateValueFormatter('dd/MM/yyyy hh:mm a');
100
+ const metadata: [string, string][] = [
101
+ ['Report Period ', this.fromDate + " - " + this.toDate],
102
+ ['Report User & Time', this.user?this.user+" @ "+this.reportDate:''+" @ "+this.reportDate],
103
+ ];
104
+ // --- search criteria ---
105
+ const searchCriteria: [string, string][] = this.searchCriteria;
106
+
107
+ const columns = this.columnDefs;
108
+ const data = this.dataMap;
109
+ // const data = this.filteredData;
110
+ const options = {
111
+ currencyFields: [
112
+ 'amountPaid'
113
+ ],
114
+ // specify all date fields expected
115
+ dateFields: [],
116
+
117
+ dateFieldFormats: {
118
+ txnDateAndTime: 'dd/MM/yyyy hh:mm a',
119
+ cancellationBranchDateTime: 'dd/MM/yyyy HH:mm',
120
+ cancellationBusinessDate: 'dd/MM/yyyy'
121
+ },
122
+
123
+ specialDecimalFields: {
124
+ rate: 8 // future field with 8 decimal places
125
+ },
126
+
127
+ groupByKey: true
128
+ };
129
+
130
+ switch (this.selectedExportOption) {
131
+ case 'excel':
132
+ this.exportService.exportToExcel({ title, metadata, searchCriteria, columns, data, options });
133
+ break;
134
+ case 'pdf':
135
+ this.exportService.exportToPdf({ title, metadata, searchCriteria, columns, data, options });
136
+ break;
137
+ case 'csv':
138
+ this.exportService.exportToCsv({ title, metadata, searchCriteria, columns, data, options });
139
+ break;
140
+ default:
141
+ alert("Please select an export format.");
142
+ }
143
+ }
144
+
145
+ dateValueFormatter(format: string) {
146
+ return (params: any) => {
147
+ if (!params.value) return '';
148
+ try {
149
+ return formatDate(params.value, format, 'en-US');
150
+ } catch {
151
+ return '';
152
+ }
153
+ }
154
+ }
155
+
156
+ getKeys(obj: Record<string, unknown>): string[] {
157
+ return obj ? Object.keys(obj) : [];
158
+ }
159
+
160
+ hasAnyGroups(): boolean {
161
+ return this.filteredData && this.getKeys(this.filteredData).length > 0;
162
+ }
163
+
164
+
165
+ public formatDate(params: any): string {
166
+ return formatDate(new Date(params.value), 'dd/MM/yyyy', 'en-US');
167
+ }
168
+
169
+ filter(text: string) {
170
+ this.searchText = text;
171
+ if (this.searchText == null) {
172
+ return;
173
+ }
174
+ if (this.searchText?.length === 0) {
175
+ this.filteredData = structuredClone(this.dataMap);
176
+ return;
177
+ }
178
+ this.searchText = this.searchText?.trim()?.toLowerCase();
179
+ for (const [key, entries] of Object.entries(this.dataMap)) {
180
+ const filteredData = entries.filter(entry => Object.values(entry)
181
+ .some(val => {
182
+ let a: string = val.toString().toLowerCase();
183
+ return a.search(this.searchText) == -1 ? false : true;
184
+ }))
185
+
186
+ this.filteredData[key] = filteredData;
187
+ }
188
+ this.filteredData;
189
+ }
190
+
191
+ //event handler for filter component
192
+ handleSearch(criteria: any) {
193
+ this.searchCriteria = criteria.searchCriteria;
194
+ this.reportDate = new Date().toISOString();
195
+ this.reportDate = formatDate(this.reportDate, 'dd/MM/yyyy hh:mm a', 'en-US');
196
+ const modal = criteria.modal;
197
+ this.user = criteria.sysUserID;
198
+ this.fromDate = formatDate(modal.fromDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
199
+ this.toDate = formatDate(modal.toDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
200
+ console.log(modal);
201
+ // Code For Meta Data
202
+ this.metaDataOne = {
203
+ 'Report Period': this.fromDate + " - " + this.toDate,
204
+ }
205
+
206
+ this.metaDataTwo = {
207
+ 'Report User & Time': this.user+" @ "+this.reportDate,
208
+ }
209
+
210
+ const searchData = {
211
+ "StartDate": modal.fromDate,
212
+ "EndDate": modal.toDate,
213
+ "SendCountryCode": modal.sendCountry,
214
+ "RecvCountryCode": modal.receiveCountry,
215
+ "BusinessPartnerCode": modal.client,
216
+ "TransactionStatus": modal.transactionStatus.join(","),
217
+ "PayoutCurrency": modal.receiveCurrency,
218
+ "TransactionType": modal.product,
219
+ "BranchCode": modal.branch
220
+ };
221
+
222
+ this.loadingState = ComponentLoadingStates.Loading;
223
+ this.reportService.getBranchActivityReceiveReport(searchData).subscribe({
224
+ next: (data) => {
225
+ console.log(data);
226
+ this.filteredData = data;
227
+ this.dataMap = JSON.parse(JSON.stringify(data));;
228
+ this.noDataFound = Object.keys(data).length == 0 ? true : false;
229
+ this.paginationArray = new Array(Object.keys(this.filteredData).length).fill(15);
230
+ },
231
+
232
+ error: (err) => {
233
+ this.loadingState = ComponentLoadingStates.Complete;
234
+ },
235
+
236
+ complete: () => {
237
+ this.loadingState = ComponentLoadingStates.Complete;
238
+ this.showReport = true;
239
+ }
240
+ })
241
+ }
242
+
243
+ handleFormValid(isValid: boolean): void {
244
+ this.isFormValid = isValid;
245
+ }
246
+
247
+ }
@@ -0,0 +1,46 @@
1
+ <lib-search-filter
2
+ [ReportName]="ReportName"
3
+ (searchClicked)="handleSearch($event)"
4
+ (formValid)="handleFormValid($event)"
5
+ >
6
+ </lib-search-filter>
7
+
8
+ <app-loader class="" *ngIf="loadingState == ComponentLoadingState.Loading"></app-loader>
9
+
10
+ <section *ngIf="showReport && isFormValid" class="my-2">
11
+ <ng-container *ngIf="!noDataFound">
12
+ <lib-metadata [reportName]="ReportName" [showmetaDataOne]="true" [showmetaDataTwo]="true" [metaDataOne]="leftData" [metaDataTwo]="metaDataTwo"(exportEvent)="handleExport($event)" (searchEvent)="filter($event)"></lib-metadata>
13
+
14
+ <ngb-accordion #acc="ngbAccordion" [closeOthers]="false">
15
+ <ng-container *ngFor="let item of filteredData | keyvalue; let i = index">
16
+ <ngb-panel *ngIf="item.value.length > 0" [id]="'panel-' + i">
17
+
18
+ <ng-template ngbPanelTitle style="height: 10%;">
19
+ <label
20
+ class="panel-cls">{{
21
+ item.key
22
+ }}</label>
23
+ </ng-template>
24
+
25
+ <ng-template ngbPanelContent>
26
+ <div style="position: relative;">
27
+ <lib-page-size-selector [totalEntries]="item?.value?.length"
28
+ [defaultSize]="'15'" [gridApi]="gridApis[i]">
29
+ ></lib-page-size-selector>
30
+
31
+ <ag-grid-angular class="ag-theme-alpine transaction-grid" style="width: 100%;height: 380px;"
32
+ [columnDefs]="columnDefs" [defaultColDef]="defaultColDef" [rowData]="item.value" [rowHeight]="20"
33
+ [headerHeight]="22"[pagination]="true" [paginationPageSize]="paginationArray[i]" (gridReady)="onGridReady($event,i)"
34
+ >
35
+ </ag-grid-angular>
36
+ </div>
37
+ </ng-template>
38
+
39
+ </ngb-panel>
40
+ </ng-container>
41
+ </ngb-accordion>
42
+ </ng-container>
43
+ <div class="alert alert-warning mt-3" *ngIf="noDataFound">
44
+ No Data found matching your search criteria.
45
+ </div>
46
+ </section>
@@ -0,0 +1,3 @@
1
+ @import 'src/styles/common-report-style.scss';
2
+ @import 'src/styles/ag-grid-report-style.scss';
3
+
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { BranchActivitySendReportComponent } from './branch-activity-send-report.component';
4
+
5
+ describe('BranchActivitySendReportComponent', () => {
6
+ let component: BranchActivitySendReportComponent;
7
+ let fixture: ComponentFixture<BranchActivitySendReportComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ BranchActivitySendReportComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(BranchActivitySendReportComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,276 @@
1
+ import { Component, NgZone, OnInit, inject } from '@angular/core';
2
+ import { ReportService } from '../../services/report.service';
3
+ import { BranchActivityReport } from '../../models/branch-activity-report/branch-activity-send-report';
4
+ import { ColDef, GridApi, GridOptions, GridReadyEvent, RowGroupingDisplayType } from 'ag-grid-community';
5
+ import { themeAlpine } from '@ag-grid-community/theming';
6
+ import 'jspdf-autotable';
7
+ import { formatDate, DatePipe } from '@angular/common';
8
+ import { ComponentLoadingStates } from '../../models/component-loading-states';
9
+ import { GenericExportService } from '../../shared/export-generic.service';
10
+
11
+ declare module 'jspdf' {
12
+ interface jsPDF {
13
+ autoTable: (options: any) => jsPDF;
14
+ }
15
+ }
16
+
17
+ @Component({
18
+ selector: 'lib-branch-activity-send-report',
19
+ templateUrl: './branch-activity-send-report.component.html',
20
+ styleUrls: ['./branch-activity-send-report.component.scss']
21
+ })
22
+ export class BranchActivitySendReportComponent implements OnInit {
23
+ dataMap: Record<string, BranchActivityReport[]> = {}
24
+ filteredData: Record<string, BranchActivityReport[]> = {}
25
+ proxyData: Record<string, BranchActivityReport[]> = {}
26
+ showReport: boolean;
27
+ paginationArray: any[];
28
+ selectedExportOption = 'excel';
29
+ gridApis: GridApi[] = [];
30
+ gridColumnApi;
31
+ user: string = "";
32
+ reportDate: string;
33
+ fromDate: string;
34
+ toDate: string;
35
+ searchText: string;
36
+ buffer: any;
37
+ sysUserId: string;
38
+ private logoBase64: string | undefined;
39
+ ComponentLoadingState = ComponentLoadingStates;
40
+ loadingState: ComponentLoadingStates = ComponentLoadingStates.Loading;
41
+ ReportName: string = "Branch Activity Send";
42
+ leftData: Record<string, string>;
43
+ metaDataTwo: Record<string, string>;
44
+ exportService: GenericExportService = inject(GenericExportService);
45
+ searchCriteria: [string,string][] = [];
46
+
47
+ // flags
48
+ showMessage: boolean = false;
49
+ noDataFound: boolean = false;
50
+ isFormValid: boolean = false;
51
+
52
+ columnDefs: ColDef<BranchActivityReport>[] = [
53
+ { field: 'businessDateTime', headerName: 'Business Date', flex: 1,wrapText: true, autoHeight: true, headerClass: 'ag-left-aligned-header', minWidth: 70, width: 70, tooltipField: 'businessDateTime' },
54
+ { field: 'transactionDateTime', headerName: 'Transaction Date', minWidth:100,flex: 2, wrapText: true, autoHeight: true, tooltipField: 'transactionDateTime' },
55
+ { field: 'transactionNumber', headerName: 'Transaction Number', flex: 1.8,wrapText: true, autoHeight: true, minWidth:90, width: 130, cellClass: 'ag-left-cols-cell compact-cell-transaction', tooltipField: 'transactionNumber' },
56
+ { field: 'product', headerName: 'Product', flex: 0.5,wrapText: true, autoHeight: true, minWidth:80, width: 120, tooltipField: 'product' },
57
+ { field: 'sendAgentBranchCode', headerName: 'SendClient BranchCode', flex: 1,wrapText: true, autoHeight: true, minWidth:90, width: 120, tooltipField: 'sendAgentBranchCode' },
58
+ { field: 'receiveAgentCode', headerName: 'Receive ClientCode', flex: 1,wrapText: true, autoHeight: true, minWidth: 90, width: 70, tooltipField: 'receiveAgentCode' },
59
+ { field: 'payoutCCcode', headerName: 'ReceiveCcy Code', flex: 1,wrapText: true, autoHeight: true,minWidth:90, width: 110, tooltipField: 'payoutCCcode' },
60
+ { field: 'payoutAmount', headerName: 'Receive Amount', flex: 1,wrapText: true, autoHeight: true,minWidth:90, maxWidth: 120, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'payoutAmount' },
61
+ { field: 'payinCCcode', headerName: 'SendCcy Code', flex: 1,wrapText: true, autoHeight: true, minWidth:90,maxWidth: 90, tooltipField: 'payinCCcode' },
62
+ { field: 'payinAmount', headerName: 'Send Amount', flex: 1,wrapText: true, autoHeight: true, minWidth:80, maxWidth: 120, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'payinAmount' },
63
+ { field: 'transactionCommissionAmount', headerName: 'Service Fee', flex: 1, wrapText: true, autoHeight: true, minWidth:90, maxWidth: 100, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'transactionCommissionAmount' },
64
+ { field: 'tax', headerName: 'Tax', flex: 1,wrapText: true, autoHeight: true, minWidth: 80, maxWidth: 100, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'tax' },
65
+ { field: 'totalPayinAmount', headerName: 'Total Send Amount',minWidth:100, flex: 1,wrapText: true, autoHeight: true, cellClass: 'ag-right-aligned-cell compact-cell', tooltipField: 'totalPayinAmount' },
66
+ { field: 'status', headerName: 'Transaction Status',minWidth:100, flex: 1,wrapText: true, autoHeight: true, tooltipField: 'status' }
67
+ ];
68
+
69
+
70
+ defaultColDef = {
71
+ sortable: true,
72
+ filter: true,
73
+ resizable: true,
74
+ minwidth: 40,
75
+ wrapHeaderText: true,
76
+ autoHeaderHeight: true,
77
+ suppressSizeToFit: false,
78
+ wrapText: true
79
+ };
80
+ rowData: BranchActivityReport[] = [];
81
+
82
+ constructor(private reportService: ReportService, private ngZone: NgZone) { }
83
+
84
+ reportTheme = themeAlpine.withParams({
85
+ headerFontSize: '10px',
86
+ fontFamily: ['Arial', 'sans-serif'],
87
+ fontSize: '9px'
88
+ });
89
+
90
+ ngOnInit(): void {
91
+ this.loadingState = ComponentLoadingStates.Complete;
92
+ // Check if User is falcon user or fossilUser
93
+ if (sessionStorage.getItem('fossilusername')) {
94
+ this.sysUserId = sessionStorage.getItem('fossilusername')
95
+ }
96
+ else {
97
+ this.sysUserId = sessionStorage.getItem('ezremitusername');
98
+ }
99
+ this.sysUserId = this.sysUserId.replace(/^["'](.*)["']$/, '$1');
100
+ this.user = this.sysUserId;
101
+ console.log("System User Id : " + this.sysUserId);
102
+ }
103
+
104
+ filter(text: string) {
105
+ this.searchText = text;
106
+ if (this.searchText == null) {
107
+ return;
108
+ }
109
+ if (this.searchText?.length === 0) {
110
+ this.filteredData = structuredClone(this.dataMap);
111
+ return;
112
+ }
113
+ this.searchText = this.searchText?.trim()?.toLowerCase();
114
+ for (const [key, entries] of Object.entries(this.proxyData)) {
115
+ const filteredData = entries.filter(entry => Object.values(entry)
116
+ .some(val => {
117
+ let a: string = val.toString().toLowerCase();
118
+ return a.search(this.searchText) == -1 ? false : true;
119
+ }))
120
+
121
+ this.filteredData[key] = filteredData;
122
+ }
123
+ this.filteredData;
124
+ }
125
+
126
+ onGridReady(params: GridReadyEvent, id: number) {
127
+ params.api.sizeColumnsToFit();
128
+ this.gridColumnApi = params.columnApi;
129
+ this.gridApis[id] = params.api;
130
+ }
131
+
132
+ handleExport(option: string): void {
133
+ this.selectedExportOption = option;
134
+ if (!this.hasAnyGroups()) {
135
+ alert("There is no data to export based on your current filter.");
136
+ return;
137
+ }
138
+ // If no data, do nothing.
139
+ if (!this.filteredData || Object.keys(this.filteredData).length === 0) {
140
+ alert("No data to export");
141
+ return;
142
+ }
143
+ const title = "Branch Activity Send";
144
+ const reportTimeFormatter = this.dateValueFormatter('dd/MM/yyyy hh:mm a');
145
+ const metadata: [string, string][] = [
146
+ ['Report Period ', this.fromDate + " - " + this.toDate],
147
+ ['Report User & Time', this.user?this.user+" @ "+this.reportDate:''+" @ "+this.reportDate],
148
+ ];
149
+ // --- search criteria ---
150
+ const searchCriteria: [string, string][] = this.searchCriteria;
151
+ const columns = this.columnDefs;
152
+ const data = this.dataMap;
153
+ // const data = this.filteredData;
154
+ const options = {
155
+ currencyFields: [
156
+ 'payoutAmount', 'payinAmount', 'transactionCommissionAmount', 'tax', 'totalPayinAmount'
157
+ ],
158
+ // specify all date fields expected
159
+ dateFields: [],
160
+
161
+ dateFieldFormats: {
162
+ txnDateAndTime: 'dd/MM/yyyy hh:mm a',
163
+ cancellationBranchDateTime: 'dd/MM/yyyy HH:mm',
164
+ cancellationBusinessDate: 'dd/MM/yyyy'
165
+ },
166
+
167
+ specialDecimalFields: {
168
+ rate: 8 // future field with 8 decimal places
169
+ },
170
+
171
+ groupByKey: true
172
+ };
173
+
174
+ switch (this.selectedExportOption) {
175
+ case 'excel':
176
+ this.exportService.exportToExcel({ title, metadata, searchCriteria, columns, data, options });
177
+ break;
178
+ case 'pdf':
179
+ this.exportService.exportToPdf({ title, metadata, searchCriteria, columns, data, options });
180
+ break;
181
+ case 'csv':
182
+ this.exportService.exportToCsv({ title, metadata, searchCriteria, columns, data, options });
183
+ break;
184
+ default:
185
+ alert("Please select an export format.");
186
+ }
187
+ }
188
+
189
+ dateValueFormatter(format: string) {
190
+ return (params: any) => {
191
+ if (!params.value) return '';
192
+ try {
193
+ return formatDate(params.value, format, 'en-US');
194
+ } catch {
195
+ return '';
196
+ }
197
+ }
198
+ }
199
+
200
+ getKeys(obj: Record<string, unknown>): string[] {
201
+ return obj ? Object.keys(obj) : [];
202
+ }
203
+
204
+ hasAnyGroups(): boolean {
205
+ return this.filteredData && this.getKeys(this.filteredData).length > 0;
206
+ }
207
+
208
+ formatAmount(params: any): string {
209
+ const value = params?.value;
210
+ if (value !== null && value !== undefined && value !== '') {
211
+ const num = Number(value);
212
+ return (Math.trunc(num * 1000) / 1000).toFixed(3);
213
+ }
214
+ return '';
215
+ }
216
+
217
+ handleSearch(criteria: any): void {
218
+ this.searchCriteria = criteria.searchCriteria;
219
+ this.reportDate = new Date().toISOString();
220
+ this.reportDate = formatDate(this.reportDate, 'dd/MM/yyyy hh:mm a', 'en-US');
221
+ const modal = criteria.modal;
222
+ this.user = criteria.sysUserID;
223
+ this.fromDate = formatDate(modal.fromDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
224
+ this.toDate = formatDate(modal.toDate, 'dd/MM/yyyy hh:mm a', 'en-US').slice(0,10);
225
+ console.log(modal);
226
+ // Code For Meta Data
227
+ this.leftData = {
228
+ 'Report Period': this.fromDate + " - " + this.toDate,
229
+ }
230
+
231
+ this.metaDataTwo = {
232
+ 'Report User & Time': this.user+" @ "+this.reportDate,
233
+ }
234
+
235
+ const searchData = {
236
+ "StartDate": modal.fromDate,
237
+ "EndDate": modal.toDate,
238
+ "SendCountryCode": modal.sendCountry,
239
+ "RecvCountryCode": modal.receiveCountry,
240
+ "BusinessPartnerCode": modal.client,
241
+ "TransactionStatus": modal.transactionStatus.join(","),
242
+ "PayoutCurrency": modal.receiveCurrency,
243
+ "TransactionType": modal.product,
244
+ "BranchCode": modal.branch
245
+ };
246
+ this.showMessage = true;
247
+ this.loadingState = ComponentLoadingStates.Loading;
248
+ this.reportService.getBranchActivityReport(searchData).subscribe({
249
+ next: (data) => {
250
+ console.log(data);
251
+ this.dataMap = JSON.parse(JSON.stringify(data));
252
+ this.filteredData = data;
253
+ this.noDataFound = Object.keys(this.filteredData).length == 0 ? true : false;
254
+ this.proxyData = structuredClone(data);
255
+ this.paginationArray = new Array(Object.keys(this.filteredData).length).fill(15);
256
+ this.showMessage = Object.keys(this.filteredData).length == 0 ? true : false;
257
+ this.showReport = true;
258
+ },
259
+
260
+ error: (err) => {
261
+ this.loadingState = ComponentLoadingStates.Complete;
262
+ },
263
+
264
+ complete: () => {
265
+ this.loadingState = ComponentLoadingStates.Complete;
266
+ this.showReport = true;
267
+ }
268
+ })
269
+ }
270
+
271
+ handleFormValid(isValid: boolean): void {
272
+ this.isFormValid = isValid;
273
+ }
274
+
275
+ }
276
+