@hmcts/ccpay-web-component 3.0.27 → 3.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/hmcts-ccpay-web-component.umd.js +109 -57
- package/bundles/hmcts-ccpay-web-component.umd.js.map +1 -1
- package/bundles/hmcts-ccpay-web-component.umd.min.js +1 -1
- package/bundles/hmcts-ccpay-web-component.umd.min.js.map +1 -1
- package/esm2015/lib/components/add-remission/add-remission.component.js +8 -6
- package/esm2015/lib/components/allocate-payments/allocate-payments.component.js +25 -24
- package/esm2015/lib/components/case-transactions/case-transactions.component.js +20 -15
- package/esm2015/lib/components/fee-summary/fee-summary.component.js +40 -46
- package/esm2015/lib/components/mark-unidentified-payment/mark-unidentified-payment.component.js +9 -4
- package/esm2015/lib/components/mark-unsolicited-payment/mark-unsolicited-payment.component.js +9 -4
- package/esm2015/lib/components/reports/reports.component.js +11 -5
- package/esm2015/lib/components/unprocessed-payments/unprocessed-payments.component.js +2 -1
- package/esm2015/lib/interfaces/AddRemissionRequest.js +5 -5
- package/esm2015/lib/interfaces/AllocatePaymentRequest.js +5 -8
- package/esm2015/lib/interfaces/PayhubAntennaRequest.js +29 -0
- package/esm2015/lib/interfaces/PaymentToPayhubRequest.js +5 -9
- package/esm2015/lib/payment-lib.component.js +19 -7
- package/esm2015/lib/services/payment-view/payment-view.service.js +9 -1
- package/esm2015/lib/services/xl-file/xl-file.service.js +2 -2
- package/esm5/lib/components/add-remission/add-remission.component.js +6 -4
- package/esm5/lib/components/allocate-payments/allocate-payments.component.js +26 -14
- package/esm5/lib/components/case-transactions/case-transactions.component.js +13 -3
- package/esm5/lib/components/fee-summary/fee-summary.component.js +27 -19
- package/esm5/lib/components/mark-unidentified-payment/mark-unidentified-payment.component.js +9 -4
- package/esm5/lib/components/mark-unsolicited-payment/mark-unsolicited-payment.component.js +9 -4
- package/esm5/lib/components/reports/reports.component.js +8 -3
- package/esm5/lib/components/unprocessed-payments/unprocessed-payments.component.js +2 -1
- package/esm5/lib/interfaces/AddRemissionRequest.js +4 -4
- package/esm5/lib/interfaces/AllocatePaymentRequest.js +4 -7
- package/esm5/lib/interfaces/PayhubAntennaRequest.js +26 -0
- package/esm5/lib/interfaces/PaymentToPayhubRequest.js +4 -7
- package/esm5/lib/payment-lib.component.js +8 -3
- package/esm5/lib/services/payment-view/payment-view.service.js +14 -1
- package/esm5/lib/services/xl-file/xl-file.service.js +2 -2
- package/fesm2015/hmcts-ccpay-web-component.js +143 -114
- package/fesm2015/hmcts-ccpay-web-component.js.map +1 -1
- package/fesm5/hmcts-ccpay-web-component.js +106 -53
- package/fesm5/hmcts-ccpay-web-component.js.map +1 -1
- package/hmcts-ccpay-web-component.metadata.json +1 -1
- package/lib/components/add-remission/add-remission.component.d.ts +1 -1
- package/lib/components/allocate-payments/allocate-payments.component.d.ts +4 -0
- package/lib/components/case-transactions/case-transactions.component.d.ts +2 -0
- package/lib/components/fee-summary/fee-summary.component.d.ts +2 -0
- package/lib/components/mark-unidentified-payment/mark-unidentified-payment.component.d.ts +1 -0
- package/lib/components/mark-unsolicited-payment/mark-unsolicited-payment.component.d.ts +1 -0
- package/lib/interfaces/AddRemissionRequest.d.ts +2 -2
- package/lib/interfaces/AllocatePaymentRequest.d.ts +3 -3
- package/lib/interfaces/PayhubAntennaRequest.d.ts +7 -0
- package/lib/interfaces/PaymentToPayhubRequest.d.ts +2 -3
- package/lib/payment-lib.component.d.ts +2 -0
- package/lib/services/payment-view/payment-view.service.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ng://@hmcts/ccpay-web-component/lib/payment-lib.service.ts","ng://@hmcts/ccpay-web-component/lib/payment-lib.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/error-handler.service.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/logger/logger.service.ts","ng://@hmcts/ccpay-web-component/lib/services/payment-list/payment-list.service.ts","ng://@hmcts/ccpay-web-component/lib/components/payment-list/payment-list.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/httpclient/webcomponent.http.client.ts","ng://@hmcts/ccpay-web-component/lib/services/payment-view/payment-view.service.ts","ng://@hmcts/ccpay-web-component/lib/components/payment-view/payment-view.component.ts","ng://@hmcts/ccpay-web-component/lib/services/card-details/card-details.service.ts","ng://@hmcts/ccpay-web-component/lib/components/card-details/card-details.component.ts","ng://@hmcts/ccpay-web-component/lib/components/page-not-found.component.ts","ng://@hmcts/ccpay-web-component/lib/services/status-history/status-history.service.ts","ng://@hmcts/ccpay-web-component/lib/components/status-history/status-history.component.ts","ng://@hmcts/ccpay-web-component/lib/components/pba-details/pba-details.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/logger/console-logger.service.ts","ng://@hmcts/ccpay-web-component/lib/services/case-transactions/case-transactions.service.ts","ng://@hmcts/ccpay-web-component/lib/services/bulk-scaning-payment/bulk-scaning-payment.service.ts","ng://@hmcts/ccpay-web-component/lib/components/case-transactions/case-transactions.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/PaymentToPayhubRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/fee-summary/fee-summary.component.ts","null","ng://@hmcts/ccpay-web-component/lib/components/error-banner/error-banner.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/UnidentifiedPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/AllocatePaymentRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/mark-unidentified-payment/mark-unidentified-payment.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/UnsolicitedPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/mark-unsolicited-payment/mark-unsolicited-payment.component.ts","ng://@hmcts/ccpay-web-component/lib/components/unprocessed-payments/unprocessed-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/components/processed-payments/processed-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/IAllocationPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/allocate-payments/allocate-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/AddRemissionRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/add-remission/add-remission.component.ts","ng://@hmcts/ccpay-web-component/lib/pipes/ccd-hyphens.pipe.ts","ng://@hmcts/ccpay-web-component/lib/pipes/key-value.pipe.ts","ng://@hmcts/ccpay-web-component/lib/pipes/sanitize-html.pipe.ts","ng://@hmcts/ccpay-web-component/lib/services/xl-file/xl-file.service.ts","ng://@hmcts/ccpay-web-component/lib/components/reports/reports.component.ts","ng://@hmcts/ccpay-web-component/lib/payment-lib.module.ts"],"names":["PaymentLibService","prototype","setApiRootUrl","apiRoot","this","API_ROOT","getApiRootUrl","setBulkScanApiRootUrl","bulkscanapiRoot","BULKSCAN_API_ROOT","getBulkScanApiRootUrl","Injectable","args","providedIn","PaymentLibComponent","paymentLibService","ngOnInit","PAYMENT_GROUP_REF","paymentGroupReference","DCN_NUMBER","bspaymentdcn","VIEW","viewName","Component","selector","template","Input","ErrorHandlerService","handleError","err","errorMessage","error","Error","message","status","messsage","undefined","_throw","getServerErrorMessage","isErrorExist","title","body","showError","LoggerService","invokeConsoleMethod","type","PaymentListService","http","logger","errorHandlerService","getPaymentByCcdCaseNumber","ccdCaseNumber","paymentMethod","info","get","withCredentials","pipe","catchError","HttpClient","PaymentListComponent","paymentListService","paymentLibComponent","_this","CCD_CASE_NUMBER","PAYMENT_METHOD","subscribe","payments","loadPaymentViewComponent","paymentReference","styles","WebComponentHttpClient","meta","post","url","options","opts","addHeaders","put","delete","patch","csrfToken","getTag","headers","forEach","element","content","HttpHeaders","responseType","Meta","PaymentViewService","https","getPaymentDetails","getPaymentGroupDetails","getApportionPaymentDetails","postBSPayments","postBSUnidentifiedPayments","postBSUnsolicitedPayments","postBSAllocationPayments","postPaymentGroupWithRemissions","feeId","deleteFeeFromPaymentGroup","postPaymentToPayHub","paymentGroupRef","downloadSelectedReport","reportName","startDate","endDate","getBSfeature","getSiteID","PaymentViewComponent","paymentViewService","selectedOption","SELECTED_OPTION","dcnNumber","isTurnOff","ISTURNOFF","paymentGroup","fees","fee","isRemissionsMatch","remissions","rem","fee_code","code","push","filter","paymentGroupObj","includes","paymentAllocation","payment_allocation","isStatusAllocated","length","allocation_status","Object","defineProperty","method","channel","goToPaymentList","goToCaseTransationPage","event","preventDefault","features","result","JSON","parse","feature","uid","ISBSENABLE","enable","CardDetailsService","getCardDetails","CardDetailsComponent","cardDetailsService","cardDetails","PageNotFoundComponent","StatusHistoryService","getPaymentStatusesByReference","StatusHistoryComponent","statusHistoryService","statuses","PbaDetailsComponent","noop","ConsoleLoggerService","console","log","apply","CaseTransactionsService","getPaymentGroups","BulkScaningPaymentService","getBSPaymentsByCCD","getBSPaymentsByDCN","dcn","postBSAllocatePayment","paymentRef","postBSPaymentStrategic","postBSWoPGStrategic","patchBSChangeStatus","calculateOutStandingAmount","feesTotal","paymentsTotal","remissionsTotal","calculated_amount","payment","toUpperCase","amount","remission","hwf_amount","removeUnwantedString","input","replaceText","replace","CaseTransactionsComponent","router","bulkScaningPaymentService","caseTransactionsService","isGrpOutstandingAmtPositive","EXC_REFERENCE","excReference","takePayment","TAKEPAYMENT","isBulkScanEnable","toLocaleLowerCase","isStrategicFixEnable","ISSFENABLE","paymentGroups","calculateAmounts","totalRefundAmount","calculateRefundAmount","setDefaults","isAnyFeeGroupAvilable","checkForExceptionRecord","totalPayments","totalRemissions","totalNonOffPayments","totalFees","getAllocationStatus","recordData","exception_record_reference","ccd_reference","isExceptionRecord","isAddFeeBtnEnabled","case_reference","ccd_case_number","nonOffLinePayment","date_created","a","amount_due","b","clAmountDue","net_amount","payment_group_reference","allPayments","allocationLen","nonPayments","remisison","totalRefundAmount_1","isFeeAmountZero_1","grpOutstandingAmount","isFeeRecordsExist","isNewPaymentGroup_1","index","isHistoricGroupAvailable","getGroupOutstandingAmount","redirectToFeeSearchPage","navigateByUrl","redirectToReportsPage","loadFeeSummaryPage","goToPaymentViewComponent","goToPayementView","selectedUnprocessedFeeEvent","unprocessedRecordId","isUnprocessedRecordSelected","getUnprocessedFeeCount","unProcessedRecordCount","unprocessedRecordCount","calculateAmountDue","confirmRemoveFee","isRemoveBtnDisabled","viewStatus","cancelRemoval","removeFee","success","window","location","reload","isCheckAmountdueExist","amountDue","Router","PaymentToPayhubRequest","service","serviceName","toFixed","site_id","BS_ENABLE_FLAG","FeeSummaryComponent","bsPaymentDcnNumber","getUnassignedPaymentlist","getPaymentGroup","unassignedPayments","responsible_service_id","upPaymentErrorMessage","getRemissionByFeeCode","feeCode","_a","o","m","Symbol","iterator","i","call","next","value","done","tslib_1.__values","_b","addRemission","currentFee","isPaymentExist","isRemissionsExist","totalAfterRemission","isFeeAmountZero","outStandingAmount","loadCaseTransactionPage","partUrl","cancelRemission","page","isConfirmationBtnDisabled","seriveName","requestBody","response","go","payhubHtml","isBackButtonEnable","goToAllocatePage","Location","ErrorBannerComponent","UnidentifiedPaymentsRequest","payment_reference","unidentified_reason","payment_allocation_status","description","name","AllocatePaymentRequest","unAllocatedPayment","siteID","exceptionRecord","allocatedRequest","banked_date","date_banked","exception_record","currency","document_control_number","dcn_reference","external_provider","giro_slip_no","bgc_reference","payer_name","payment_channel","payment_status","payment_method","requestor","payment_allocation_dto","MarkUnidentifiedPaymentComponent","formBuilder","getErrorMessage","getUnassignedPayment","markPaymentUnidentifiedForm","group","investicationDetail","FormControl","Validators","compose","required","minLength","maxLength","pattern","unassignedRecord","beCcdNumber","beExceptionNumber","exceptionReference","ccdReference","trimUnderscore","saveAndContinue","resetForm","investicationField","controls","formerror","errors","dirty","valid","investigationComment","invalid","actualLength","val","isInvesticationDetailEmpty","investicationDetailHasError","investicationDetailMinHasError","investicationDetailMaxHasError","confirmPayments","isConfirmButtondisabled","reason","res1","res2","response2","reqBody","reference","res3","gotoCasetransationPage","user_id","postStrategicBody","res","cancelMarkUnidentifiedPayments","FormBuilder","UnsolicitedPaymentsRequest","responsible_office","responsible_person","email_id","receiving_office","receiving_email_address","sending_email_address","MarkUnsolicitedPaymentComponent","siteids","isContinueButtondisabled","siteIDList","scrollTo","markPaymentUnsolicitedForm","responsibleOffice","responsiblePerson","emailId","selectedSiteId","reasonField","officeIdField","field","isReasonEmpty","reasonHasError","reasonMinHasError","reasonMaxHasError","isResponsibleOfficeEmpty","responsibleOfficeHasError","cancelMarkUnsolicitedPayments","checkingFormValue","setValue","formFields","valueExists","hasOwnProperty","selectchange","target","selectedSiteName","selectedIndex","text","UnprocessedPaymentsComponent","EventEmitter","isStFixEnable","setValuesForUnassignedRecord","emit","unassignedRecordList","serviceId","isExceptionCase","isRecordExist","formatUnassignedRecordId","ID","recordId","loadUnsolicitedPage","unprocessedPaymentSelectEvent","selectedRecordReference","validateButtons","unProcessedPaymentServiceId","PAYMENTREF","isMarkAsUnidentifiedbtnEnabled","FEE_RECORDS_EXISTS","isAllocateToExistingFeebtnEnabled","IS_OS_AMT_AVAILABLE","isAllocatedToNewFeebtnEnabled","unprocessedPaymentUnSelectEvent","Output","ProcessedPaymentsComponent","redirectToPaymentViewPage","IAllocationPaymentsRequest","explanation","userName","user_name","AllocatePaymentsComponent","overPayment","hwfReward","wrongFee","notIssueCase","otherDeduction","shortFall","helpWithFee","other","referRefund","noRefund","noCase","holdCase","heldCase","overUnderPaymentForm","moreDetails","fstCon","scndCn","selectedPaymentGroup","gotoSummaryPage","cancelAllocatePayment","confirmAllocatePayement","paymentDetailsField","paymentFormError","userNameField","isEmptyCondtion","paymentReason","paymentExplanation","isOtherOptionSelected","isRemainingAmountGtZero","isRemainingAmountLtZero","otherPaymentExplanation","finalServiceCall","vals","paymentReasonHasError","paymentExplanationHasError","isPaymentDetailsEmpty","isPaymentDetailsInvalid","paymentDetailsMinHasError","paymentDetailsMaxHasError","isUserNameEmpty","isUserNameInvalid","isMoreDetailsBoxHide","reset","GroupOutstandingAmount","remainingToBeAssigned","paymentSectionLabel","feedbackUrlLabel","remainingAmount","afterFeeAllocateOutstanding","amountForAllocation","selectRadioButton","key","AddRemissionRequest","hwf_reference","AddRemissionComponent","option","remissionForm","remissionCode","resetRemissionForm","remissionctrls","isRemissionLessThanFee","isRemissionCodeEmpty","remissionCodeHasError","isAmountEmpty","amountHasError","isRemissionLessThanFeeError","confirmRemission","newNetAmount","remissionAmount","decodeURIComponent","trim","id","LDUrl","routeReuseStrategy","shouldReuseRoute","onSameUrlNavigation","CcdHyphensPipe","transform","match","Pipe","keyValuePipe","keys","SanitizeHtmlPipe","sanitizer","bypassSecurityTrustHtml","DomSanitizer","XlFileService","exportAsExcelFile","json","excelFileName","worksheet","workbook","XLSX.utils","json_to_sheet","header","setDataLossReportHeaders","setUnprocessedReportHeaders","setProcessedUnallocatedReportHeaders","setShortFallReportHeaders","Sheets","data","autoFitColumns","SheetNames","excelBuffer","XLSX.write","bookType","saveAsExcelFile","objectMaxLength","ColWidth","obj","values","j","width","v","buffer","fileName","Blob","FileSaver.saveAs","ReportsComponent","xlFileService","fromValidation","getToday","Date","toISOString","split","getSelectedFromDate","validateDates","reportsForm","selectedStartDate","tranformDate","selectedEndDate","isDateRangeMoreThanWeek","isDateRangeBetnWeek","isStartDateLesthanEndDate","selectedreport","downloadReport","isDownLoadButtondisabled","dataLossRptDefault","loss_resp","payment_asset_dcn","env_ref","env_item","resp_service_id","resp_service_name","bgc_batch","unProcessedRptDefault","exception_ref","ccd_ref","processedUnallocated","allocation_reason","ccd_exception_ref","ccd_case_ref","updated_by","shortFallsRptDefault","surplus_shortfall","balance","payment_amount","ccd_case_reference","ccd_exception_reference","processed_date","selectedReportName","applyDateFormat","substr","convertToFloatValue","getFileName","loc","stDt","formatDate","enDt","now","timestamp","getTwodigit","getHours","getMinutes","getSeconds","getCamelCaseString","strDate","parts","slice","map","amt","Number","parseFloat","PaymentLibModule","NgModule","imports","CommonModule","HttpClientModule","FormsModule","ReactiveFormsModule","declarations","exports","providers","provide","useClass"],"mappings":"m2BAAA,IAAAA,EAAA,WAUE,SAAAA,YAEAA,EAAAC,UAAAC,cA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,UAAA4nB,mBAAA,SAAmB9gB,GACjB,IAAI+B,EACJ,OAAO/B,GACL,IAAK,cACH+B,EAAS,cACT,MAEF,IAAK,YACHA,EAAS,YACT,MAEF,IAAK,wBACHA,EAAS,wBACT,MAEF,IAAK,wBACHA,EAAS,oBACT,MAEF,QACEA,EAAS/B,EAId,OAAO+B,GAERsb,EAAAnkB,UAAA8mB,gBAAA,SAAgBzO,GAGd,OAAOA,EAAU,KAAE2P,IAAI,SAAA9V,GAIrB,OAHIA,EAAmB,cACrBA,EAAmB,YAAIkV,EAAAA,WAAWlV,EAAmB,YAJ7C,aACN,UAKGA,KAIXiS,EAAAnkB,UAAAgnB,oBAAA,SAAoBiB,GAClB,OAAOA,EAAMC,OAAOC,WAAWF,GAAKnX,QAAQ,GAAI,4BAjSnDxP,EAAAA,UAASX,KAAA,CAAC,CACTY,SAAU,gBACVC,SAAU,2hJA0FV4C,OAAQ,CAAC,8ZA9FH+d,SAFCzgB,SAJA6W,EAAAA,mBAGAhO,SAEA/E,OANT,GCAA4iB,EAAA,oDA+BCC,EAAAA,SAAQ1nB,KAAA,CAAC,CACR2nB,QAAS,CACPC,EAAAA,aACAC,EAAAA,iBACAC,EAAAA,YACAC,EAAAA,qBAEFC,aAAc,CACZ9nB,EACA6C,EACAkD,EACA0C,EACAG,EACAG,EACAyL,EACA0D,EACA8B,EACAyB,EACAM,EACA7S,EACA+B,EACAmF,EACAkP,EACAsB,EACAI,EACAE,EACAoC,EACAzQ,GAEFkV,QAAS,CAAE/nB,GACXgoB,UAAW,CACT,CAAEC,QAASpmB,EAAeqmB,SAAU9e,GACpCkY,EACA9d,SAhEJ","sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class PaymentLibService {\n API_ROOT: string;\n BULKSCAN_API_ROOT: string;\n\n constructor() { }\n\n setApiRootUrl(apiRoot: string): void {\n this.API_ROOT = apiRoot;\n }\n\n getApiRootUrl(): string {\n return this.API_ROOT;\n }\n\n setBulkScanApiRootUrl(bulkscanapiRoot: string): void {\n this.BULKSCAN_API_ROOT = bulkscanapiRoot;\n }\n\n getBulkScanApiRootUrl(): string {\n return this.BULKSCAN_API_ROOT;\n }\n}\n","import {Component, Input, OnInit} from '@angular/core';\nimport {PaymentLibService} from './payment-lib.service';\nimport { IBSPayments } from './interfaces/IBSPayments';\n\n@Component({\n selector: 'ccpay-payment-lib',\n template: `\n <ccpay-payment-list *ngIf=\"viewName === 'payment-list'\"></ccpay-payment-list>\n <ccpay-payment-view *ngIf=\"viewName === 'payment-view'\"\n [isTurnOff]=\"ISTURNOFF\"></ccpay-payment-view>\n <ccpay-case-transactions *ngIf=\"viewName === 'case-transactions'\"></ccpay-case-transactions>\n <app-mark-unidentified-payment *ngIf=\"viewName === 'unidentifiedPage'\"></app-mark-unidentified-payment>\n <app-mark-unsolicited-payment *ngIf=\"viewName === 'unsolicitedPage'\"></app-mark-unsolicited-payment>\n <app-allocate-payments *ngIf=\"viewName === 'allocate-payments'\"\n [isTurnOff]=\"ISTURNOFF\"></app-allocate-payments>\n <ccpay-fee-summary *ngIf=\"viewName === 'fee-summary'\"\n [ccdCaseNumber]=\"CCD_CASE_NUMBER\" [paymentGroupRef]=\"paymentGroupReference\"\n [isTurnOff]=\"ISTURNOFF\"></ccpay-fee-summary>\n <ccpay-reports *ngIf=\"viewName === 'reports'\"></ccpay-reports>\n `\n})\n\nexport class PaymentLibComponent implements OnInit {\n @Input('API_ROOT') API_ROOT: string;\n @Input('BULKSCAN_API_ROOT') BULKSCAN_API_ROOT: string;\n @Input('CCD_CASE_NUMBER') CCD_CASE_NUMBER: string;\n @Input('EXC_REFERENCE') EXC_REFERENCE: string;\n @Input('PAYMENT_METHOD') PAYMENT_METHOD: string;\n @Input('VIEW') VIEW: string;\n @Input('PAYMENT_GROUP_REF') PAYMENT_GROUP_REF?: string;\n @Input('TAKEPAYMENT') TAKEPAYMENT: boolean;\n @Input('DCN_NUMBER') DCN_NUMBER: string;\n @Input('SELECTED_OPTION') SELECTED_OPTION: string;\n @Input('ISBSENABLE') ISBSENABLE: Boolean;\n @Input('ISSFENABLE') ISSFENABLE: boolean;\n @Input('ISTURNOFF') ISTURNOFF: boolean;\n\n paymentMethod: string;\n bspaymentdcn: string;\n unProcessedPaymentServiceId: string = null;\n paymentGroupReference: string;\n paymentReference: string;\n viewName: string;\n isTurnOff: boolean;\n unProcessedPayment: IBSPayments = null;\n\n constructor(private paymentLibService: PaymentLibService) { }\n\n ngOnInit() {\n this.paymentLibService.setApiRootUrl(this.API_ROOT);\n this.paymentLibService.setBulkScanApiRootUrl(this.BULKSCAN_API_ROOT);\n if (this.PAYMENT_GROUP_REF) {\n this.paymentGroupReference = this.PAYMENT_GROUP_REF;\n }\n if (this.DCN_NUMBER) {\n this.bspaymentdcn = this.DCN_NUMBER;\n }\n\n if (this.VIEW === 'fee-summary') {\n this.viewName = 'fee-summary';\n } else if (this.VIEW !== 'reports') {\n this.viewName = 'case-transactions';\n } else {\n this.viewName = this.VIEW;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { _throw } from 'rxjs/observable/throw';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\n\n\nexport class ErrorHandlerService {\n\n constructor() { }\n\n\n handleError(err: HttpErrorResponse): Observable<any> {\n let errorMessage: string;\n if (err.error instanceof Error) {\n // A client-side or network error occurred.\n errorMessage = `An error occurred: ${err.error.message}`;\n } else {\n // The backend returned an unsuccessful response code.\n if (err.status === 404) {\n if (!err.error) {\n errorMessage = 'Not found';\n } else {\n errorMessage = err.error;\n }\n } else if (err.error.messsage === undefined) {\n errorMessage = 'Server error';\n } else {\n errorMessage = `${err.error.message}`;\n }\n }\n return _throw(errorMessage);\n }\n\n getServerErrorMessage(isErrorExist) {\n return {\n title: \"There is a problem with the service\",\n body: \"Try again later\",\n showError: isErrorExist\n };\n }\n}\n","import { Injectable } from '@angular/core';\n\nconst noop = (): any => undefined;\n\nexport abstract class Logger {\n\n info: any;\n warn: any;\n error: any;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggerService implements Logger {\n\n info: any;\n warn: any;\n error: any;\n\n invokeConsoleMethod(type: string, args?: any): void {}\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs/internal/Observable';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { IPayments } from '../../interfaces/IPayments';\nimport { catchError } from 'rxjs/operators';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PaymentListService {\n payments: IPayments;\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n\n getPaymentByCcdCaseNumber(ccdCaseNumber: string, paymentMethod: string): Observable<IPayments> {\n this.logger.info('Payment-list-service getPaymentByCcdCaseNumber for: ', ccdCaseNumber);\n\n return this.http.get<IPayments>(`${this.paymentLibService.API_ROOT}/cases/${ccdCaseNumber}/payments`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import {Component, OnInit} from '@angular/core';\n\nimport {PaymentListService} from '../../services/payment-list/payment-list.service';\nimport {IPayments} from '../../interfaces/IPayments';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IStatusHistory} from '../../interfaces/IStatusHistory';\n\n@Component({\n selector: 'ccpay-payment-list',\n template: `<div class=\"govuk-width-container\">\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payments list could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!errorMessage && payments\">\n\n <table class=\"table\">\n <tr>\n <th class=\"bold font-xsmall\">Payment group reference</th>\n <th class=\"bold font-xsmall\">Payment reference</th>\n <th class=\"bold font-xsmall\">Date created</th>\n <th class=\"bold font-xsmall\">Channel</th>\n <th class=\"bold font-xsmall\">Method</th>\n <th class=\"bold font-xsmall\">Amount</th>\n <th class=\"bold font-xsmall\">Status</th>\n </tr>\n <tr *ngFor=\"let payment of payments.payments\">\n <td class=\"font-xsmall\">\n <a href=\"javascript:void(0)\" (click)=\"loadPaymentViewComponent(payment.payment_group_reference, payment.payment_reference, payment.method)\">{{ payment.payment_group_reference }}</a>\n <td class=\"font-xsmall\">{{ payment.payment_reference }}</td>\n <td class=\"font-xsmall\">{{ payment.date_created | date:'dd MMM yyyy hh:mm:ss' }}</td>\n <td class=\"font-xsmall\">{{ payment.channel | titlecase }}</td>\n <td class=\"font-xsmall\">{{ payment.method | titlecase }}</td>\n <td class=\"font-xsmall\">£{{ payment.amount | number:'.2' }}</td>\n <td *ngIf=\"payment.method === 'card' && payment.channel === 'online'\">\n <details>\n <summary><span class=\"summary font-xsmall\">{{ payment.status }}</span></summary>\n <div class=\"panel panel-border-narrow\" *ngIf=\"payment.status === 'Failed'\">\n <div *ngFor=\"let statusHistory of payment.status_histories\">\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0010'\">\n Payment rejected due to payment method selected or payment information entered, for example, failed fraud check, a 3D Secure authentication failure, or the user does not have enough money in account\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0020'\">\n Payment was not confirmed and completed within 90 minutes of being created\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0030'\">\n User clicked on the âCancel paymentâ button during the payment journey\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0050'\">\n Multiple possible causes, for example a configuration problem with the payment provider, or incorrect login credentials\n </p>\n </div>\n </div>\n </details>\n </td>\n <td *ngIf=\"payment.method === 'card' && payment.channel === 'telephony'\" class=\"font-xsmall\">\n {{ payment.status}}\n </td>\n <td *ngIf=\"payment.method === 'payment by account'\">\n <details>\n <summary><span class=\"summary font-xsmall\">{{ payment.status }}</span></summary>\n <div class=\"panel panel-border-narrow\" *ngIf=\"payment.status === 'Pending'\">\n <p class=\"font-xsmall\">This means the transaction is being processed by Liberata.</p>\n </div>\n </details>\n </td>\n </tr>\n </table>\n\n </div>\n\n</div>\n`,\n styles: [``]\n})\nexport class PaymentListComponent implements OnInit {\n payments: IPayments;\n errorMessage: string;\n code: string;\n\n constructor(private paymentListService: PaymentListService,\n private paymentLibComponent: PaymentLibComponent) {\n }\n\n ngOnInit() {\n this.paymentListService.getPaymentByCcdCaseNumber(this.paymentLibComponent.CCD_CASE_NUMBER, this.paymentLibComponent.PAYMENT_METHOD)\n .subscribe(\n payments => this.payments = payments,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n loadPaymentViewComponent(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.paymentLibComponent.paymentMethod = paymentMethod;\n this.paymentLibComponent.paymentGroupReference = paymentGroupReference;\n this.paymentLibComponent.paymentReference = paymentReference;\n this.paymentLibComponent.viewName = 'payment-view';\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Meta } from '@angular/platform-browser';\nimport { Observable } from 'rxjs';\n\n@Injectable()\nexport class WebComponentHttpClient {\n constructor(\n private http: HttpClient,\n private meta: Meta\n ) { }\n\n post(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.post(url, body, opts);\n }\n\n put(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.put(url, body, opts);\n }\n\n get(url: string, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.get(url, opts);\n }\n\n delete(url: string, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.delete(url, opts);\n }\n \n patch(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.patch(url, body, opts);\n }\n\n addHeaders(options: any): any {\n const csrfToken = this.meta.getTag('name=csrf-token');\n const headers = {};\n if (options.headers) {\n options.headers.forEach(element => {\n headers[element] = options.headers.get(element);\n });\n }\n headers['X-Requested-With'] = 'XMLHttpRequest';\n headers['CSRF-Token'] = csrfToken.content;\n options.headers = new HttpHeaders(headers);\n options.responseType = 'text';\n return options;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Observable } from 'rxjs/internal/Observable';\n\nimport {IPayment} from '../../interfaces/IPayment';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { WebComponentHttpClient } from '../shared/httpclient/webcomponent.http.client';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { catchError } from 'rxjs/operators';\nimport { LoggerService } from '../shared/logger/logger.service';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport { AddRemissionRequest } from '../../interfaces/AddRemissionRequest';\nimport { PaymentToPayhubRequest } from '../../interfaces/PaymentToPayhubRequest';\nimport { UnidentifiedPaymentsRequest } from '../../interfaces/UnidentifiedPaymentsRequest';\nimport { UnsolicitedPaymentsRequest } from '../../interfaces/UnsolicitedPaymentsRequest';\nimport { Meta } from '@angular/platform-browser';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { IAllocationPaymentsRequest } from '../../interfaces/IAllocationPaymentsRequest';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PaymentViewService {\n\n private meta: Meta;\n\n constructor(private http: HttpClient,\n private https: WebComponentHttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getPaymentDetails(paymentReference: string, paymentMethod: string): Observable<IPayment> {\n this.logger.info('Payment-view-service getPaymentDetails for: ', paymentReference);\n\n return this.http.get<IPayment>(paymentMethod === 'card' || paymentMethod === 'cash' || paymentMethod === 'cheque' || paymentMethod === 'postal order' ?\n `${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}` :\n `${this.paymentLibService.API_ROOT}/credit-account-payments/${paymentReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n\n getPaymentGroupDetails(paymentGroupReference: string): Observable<IPaymentGroup> {\n this.logger.info('Payment-view-service getPaymentGroupDetails for: ', paymentGroupReference);\n\n return this.http.get<IPayment>(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n getApportionPaymentDetails(paymentReference: string): Observable<IPaymentGroup> {\n this.logger.info('Payment-view-service getPaymentGroupDetails for: ', paymentReference);\n\n return this.http.get<IPayment>(`${this.paymentLibService.API_ROOT}/payment-groups/fee-pay-apportion/${paymentReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSPayments(body: AllocatePaymentRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/bulk-scan-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSUnidentifiedPayments(body: UnidentifiedPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSUnsolicitedPayments(body: UnsolicitedPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSAllocationPayments(body: IAllocationPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n\n postPaymentGroupWithRemissions(paymentGroupReference: string, feeId: number, body: AddRemissionRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupReference}/fees/${feeId}/remissions`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n deleteFeeFromPaymentGroup(feeId: number): Observable<any> {\n this.logger.info('Payment-view-service deleteFeeFromPaymentGroup for: ', feeId);\n return this.https.delete(`${this.paymentLibService.API_ROOT}/fees/${feeId}`).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postPaymentToPayHub(body: PaymentToPayhubRequest, paymentGroupRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupRef}/card-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n downloadSelectedReport(reportName: string, startDate: string, endDate:string): Observable<any> {\n const url = `${this.paymentLibService.API_ROOT}/report/data?date_from=${startDate}&date_to=${endDate}&report_type=${reportName}`;\n return this.https.get(url, { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n getBSfeature(): Observable<any> {\n return this.https.get('api/payment-history/bulk-scan-feature', { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n getSiteID(): Observable<any> {\n return this.https.get('api/payment-history/refdata/legacy-sites', { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n}\n","import {Component, OnInit, Input} from '@angular/core';\nimport {PaymentViewService} from '../../services/payment-view/payment-view.service';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-payment-view',\n template: `<div class=\"govuk-width-container\">\n\n <div class=\"govuk-breadcrumbs\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a href=\"#\" (click)=\"goToCaseTransationPage($event)\" class=\"govuk-back-link\">Back</a>\n </li>\n </ol>\n </div>\n\n <main class=\"govuk-main-wrapper govuk-!-padding-top-0\" id=\"main-content\" role=\"main\">\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment details could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <div class=\"payment-view-alignment\" *ngIf=\"!errorMessage && paymentGroup\">\n\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='PAYMENTDETAILS'>\n <div class=\"govuk-grid-row\">\n <div class=\"column\">\n <h1 class=\"heading-large govuk-!-margin-top-0\">Payment details</h1>\n </div>\n </div>\n <table>\n <tbody>\n <tr class=\"section\" *ngIf=\"isTurnOff\">\n <td class=\"bold tb-col-w\">Payment group reference</td>\n <td>{{ paymentGroup.payment_group_reference }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Payment reference</td>\n <td>{{ paymentGroup.payments[0].reference }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Payment amount</td>\n <td>£{{ paymentGroup.payments[0].amount | number:'.2' }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">GovPay Transaction ID</td>\n <td>{{ paymentGroup.payments[0].external_reference }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].document_control_number && !paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">Payment asset number(DCN)</td>\n <td>{{ paymentGroup.payments[0].document_control_number }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].document_control_number && !paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">Banked date</td>\n <td>{{ paymentGroup.payments[0].banked_date | date:'dd MMM yyyy' }}</td>\n </tr>\n </tbody>\n </table>\n\n <div class=\"govuk-grid-row\" *ngIf=\"paymentGroup.fees.length > 0\">\n <div class=\"column\">\n <h2 class=\"heading-large\">Fee and remission details</h2>\n </div>\n </div>\n\n <div *ngFor=\"let fee of paymentGroup.fees\">\n <table class=\"table\">\n <tbody>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Description</td>\n <td>Application for {{ fee.description }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Fee code</td>\n <td>{{ fee.code }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\" [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions && !isTurnOff }\">Fee amount</td>\n <td [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions && !isTurnOff }\">£{{ fee.calculated_amount | number:'.2' }}</td>\n </tr>\n <tr *ngIf=\"fee.net_amount && isTurnOff\">\n <td class=\"bold tb-col-w\" [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions}\" >Net amount</td>\n <td [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions}\">£{{ fee.net_amount | number:'.2' }}</td>\n </tr>\n <tr *ngIf=\"fee.apportion_amount\">\n <td class=\"bold tb-col-w tr-border\" [ngClass]=\"{'tr-border': !fee.remissions}\">Allocated amount</td>\n <td [ngClass]=\"{'tr-border': !fee.remissions}\">£{{ fee.apportion_amount | number:'.2' }}</td>\n </tr>\n\n <tr *ngIf=\"fee.remissions\">\n <td class=\"bold tb-col-w\">Remission code</td>\n <td>{{fee.remissions.hwf_reference}}</td>\n </tr>\n <tr *ngIf=\"fee.remissions\">\n <td class=\"bold tb-col-w tr-border\">Remission amount</td>\n <td class=\"tr-border\">£{{ fee.remissions.hwf_amount | number:'.2'}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n\n <!-- card details -->\n <ccpay-card-details *ngIf=\"isCardPayment && !isTelephonyPayment\"></ccpay-card-details>\n\n <!-- pba details -->\n <ccpay-pba-details *ngIf=\"!isCardPayment\" [payment]=\"paymentGroup.payments[0]\"></ccpay-pba-details>\n\n <!-- Status histories -->\n <ccpay-payment-statuses *ngIf=\"isStatusAllocated\"></ccpay-payment-statuses>\n\n </div>\n\n </main>\n</div>\n`,\n styles: [`.tb-col-w{width:330px}.tr-border{border-bottom:2px solid}.payment-view-alignment{margin-left:30px}`]\n})\nexport class PaymentViewComponent implements OnInit {\n @Input() isTurnOff: boolean;\n paymentGroup: IPaymentGroup;\n errorMessage: string;\n ccdCaseNumber: string;\n selectedOption: string;\n dcnNumber: string;\n isStatusAllocated: boolean;\n isRemissionsMatch: boolean;\n\n constructor(private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent) {\n }\n\n ngOnInit() {\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION;\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n\n this.paymentViewService.getApportionPaymentDetails(this.paymentLibComponent.paymentReference).subscribe(\n paymentGroup => {\n let fees = [];\n paymentGroup.fees.forEach(fee => {\n this.isRemissionsMatch = false;\n\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n });\n paymentGroup.fees = fees\n this.paymentGroup = paymentGroup;\n\n this.paymentGroup.payments = this.paymentGroup.payments.filter\n (paymentGroupObj => paymentGroupObj['reference'].includes(this.paymentLibComponent.paymentReference));\n const paymentAllocation = this.paymentGroup.payments[0].payment_allocation;\n this.isStatusAllocated = paymentAllocation.length > 0 && paymentAllocation[0].allocation_status === 'Allocated' || paymentAllocation.length === 0;\n }, \n (error: any) => this.errorMessage = error\n );\n \n }\n\n get isCardPayment(): boolean {\n return this.paymentGroup.payments[0].method === 'card';\n }\n\n get isTelephonyPayment(): boolean {\n return this.paymentGroup.payments[0].channel === 'telephony';\n }\n\n public goToPaymentList(): void {\n this.paymentLibComponent.viewName = 'payment-list';\n }\n\n goToCaseTransationPage(event: any) {\n event.preventDefault()\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {Observable} from 'rxjs/internal/Observable';\n\nimport {ICardDetails} from '../../interfaces/ICardDetails';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { catchError } from 'rxjs/operators';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CardDetailsService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getCardDetails(paymentReference: string): Observable<ICardDetails> {\n this.logger.info('Card-detail-service getCardDetails for: ', paymentReference);\n\n return this.http.get<ICardDetails>(`${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}/details`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { CardDetailsService } from '../../services/card-details/card-details.service';\nimport {ICardDetails} from '../../interfaces/ICardDetails';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\n@Component({\n selector: 'ccpay-card-details',\n template: `\n<div class=\"column\">\n <h2 class=\"heading-medium\">Payment method</h2>\n</div>\n\n<div role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\" *ngIf=\"errorMessage\">\n Payment method unavailable, The payment has either expired or unsuccessful.\n</div>\n\n<div *ngIf=\"!errorMessage && cardDetails\">\n\n<table>\n <tbody>\n <tr>\n <td class=\"bold tb-col-w\">Method</td>\n <td>Card</td>\n </tr>\n <tr>\n <td class=\"bold tb-col-w\">Type</td>\n <td>{{ cardDetails.card_brand }}</td>\n </tr>\n </tbody>\n</table>\n</div>\n\n`,\n styles: [`.tb-col-w{width:330px}`]\n})\nexport class CardDetailsComponent implements OnInit {\n pageTitle: string = 'Card details';\n cardDetails: ICardDetails;\n paymentReference: string;\n errorMessage: string;\n\n constructor(private cardDetailsService: CardDetailsService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.cardDetailsService.getCardDetails(this.paymentLibComponent.paymentReference).subscribe(\n cardDetails => this.cardDetails = cardDetails,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n get getPaymentReference(): string {\n return this.paymentReference;\n }\n\n}\n","import { Component } from '@angular/core';\n\n@Component({\n template: `\n <h1>This is not the page you were looking for!</h1>\n `\n})\nexport class PageNotFoundComponent { }\n","import { Injectable } from '@angular/core';\nimport { PaymentLibService } from '../../payment-lib.service';\nimport { HttpClient } from '@angular/common/http';\nimport { IStatusHistories } from '../../interfaces/IStatusHistories';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { catchError } from 'rxjs/operators';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class StatusHistoryService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getPaymentStatusesByReference(paymentReference: string, paymentMethod: string): Observable<IStatusHistories> {\n this.logger.info('Status-history-service getPaymentStatusesByReference for: ', paymentReference);\n\n return this.http.get<IStatusHistories>(paymentMethod === 'card' || paymentMethod === 'cash' || paymentMethod === 'cheque' || paymentMethod === 'postal order' ?\n `${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}/statuses` :\n `${this.paymentLibService.API_ROOT}/credit-account-payments/${paymentReference}/statuses`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { IStatusHistories } from '../../interfaces/IStatusHistories';\nimport { StatusHistoryService } from '../../services/status-history/status-history.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\n@Component({\n selector: 'ccpay-payment-statuses',\n template: `<div class=\"column\">\n <h2 class=\"heading-medium\">{{ pageTitle }}</h2>\n</div>\n\n\n<div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\" *ngIf=\"errorMessage\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment status history could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n</div>\n\n<div *ngIf=\"!errorMessage && statuses\">\n <table>\n <thead>\n <tr>\n <th>Status</th>\n <th>Amount</th>\n <th>Date</th>\n </tr>\n </thead> \n <tbody>\n <tr *ngFor=\"let status of statuses.status_histories\">\n <td>{{ status.status }}</td>\n <td>£{{ statuses.amount | number:'.2' }}</td>\n <td>{{ status.date_created | date:'dd MMM yyyy hh:mm:ss'}}</td>\n </tr>\n </tbody>\n </table>\n</div>\n`,\n styles: [``]\n})\nexport class StatusHistoryComponent implements OnInit {\n pageTitle: string = 'Payment status history';\n statuses: IStatusHistories;\n errorMessage: string;\n\n constructor(private statusHistoryService: StatusHistoryService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.statusHistoryService.getPaymentStatusesByReference(this.paymentLibComponent.paymentReference, this.paymentLibComponent.paymentMethod).subscribe(\n statuses => this.statuses = statuses,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { IPayment } from '../../interfaces/IPayment';\n\n@Component({\n selector: 'ccpay-pba-details',\n template: `\n <h2 class=\"heading-large\">Payment method</h2>\n <table>\n <tbody>\n <tr>\n <td class=\"bold tb-col-w\">Method</td>\n <td class=\"capitalize\">{{ payment.method | lowercase}}</td>\n </tr>\n <tr>\n <td class=\"bold tb-col-w\">Type</td>\n <td>Credit</td>\n </tr>\n <tr *ngIf=\"payment.organisation_name\">\n <td class=\"bold tb-col-w\">PBA account name</td>\n <td>{{ payment.organisation_name }}</td>\n </tr>\n <tr *ngIf=\"payment.account_number\">\n <td class=\"bold tb-col-w\">PBA number</td>\n <td>{{ payment.account_number }}</td>\n </tr>\n <tr *ngIf=\"payment.customer_reference\">\n <td class=\"bold tb-col-w\">Customer internal reference</td>\n <td>{{ payment.customer_reference }}</td>\n </tr>\n </tbody>\n </table>\n`,\n styles: [`.capitalize::first-letter{text-transform:uppercase}.tb-col-w{width:330px}`]\n})\nexport class PbaDetailsComponent implements OnInit {\n @Input() payment: IPayment;\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { Logger } from './logger.service';\n\nexport let isDebugMode = false;\n\nconst noop = (): any => undefined;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleLoggerService implements Logger {\n\n get info() {\n if (isDebugMode) {\n return console.info.bind(console);\n } else {\n return noop;\n }\n }\n\n get warn() {\n if (isDebugMode) {\n return console.warn.bind(console);\n } else {\n return noop;\n }\n }\n\n get error() {\n if (isDebugMode) {\n return console.error.bind(console);\n } else {\n return noop;\n }\n }\n\n invokeConsoleMethod(type: string, args?: any): void {\n const logFn: Function = (console)[type] || console.log || noop;\n logFn.apply(console, [args]);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {LoggerService} from '../shared/logger/logger.service';\nimport {ErrorHandlerService} from '../shared/error-handler.service';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport {Observable} from 'rxjs/Observable';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {catchError} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CaseTransactionsService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService\n ) { }\n\n getPaymentGroups(ccdCaseNumber: string): Observable<IPaymentGroup[]> {\n this.logger.info('Case-transactions-service getPaymentGroups for: ', ccdCaseNumber);\n\n return this.http.get<IPaymentGroup[]>(`${this.paymentLibService.API_ROOT}/cases/${ccdCaseNumber}/paymentgroups`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ErrorHandlerService} from '../shared/error-handler.service';\nimport { WebComponentHttpClient } from '../shared/httpclient/webcomponent.http.client';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport {Observable} from 'rxjs/Observable';\nimport {catchError} from 'rxjs/operators';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { IPaymentGroup } from '../../interfaces/IPaymentGroup';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BulkScaningPaymentService {\n\n constructor(private http: HttpClient,\n private https: WebComponentHttpClient,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService\n ) { }\n\n getBSPaymentsByCCD(ccdCaseNumber: string): Observable<IBSPayments> {\n return this.http.get<IBSPayments>(`${this.paymentLibService.BULKSCAN_API_ROOT}/cases/${ccdCaseNumber}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n getBSPaymentsByDCN(dcn: string): Observable<IBSPayments> {\n return this.http.get<IBSPayments>(`${this.paymentLibService.BULKSCAN_API_ROOT}/cases?document_control_number=${dcn}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSAllocatePayment(body: AllocatePaymentRequest, paymentRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentRef}/bulk-scan-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSPaymentStrategic(body: AllocatePaymentRequest, paymentGroupRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupRef}/bulk-scan-payments-strategic`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSWoPGStrategic(body: AllocatePaymentRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/bulk-scan-payments-strategic`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n patchBSChangeStatus(dcnNumber: string, status: string): Observable<any> {\n return this.https.patch(`${this.paymentLibService.API_ROOT}/bulk-scan-payments/${dcnNumber}/status/${status}`, status).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n calculateOutStandingAmount(paymentGroup: IPaymentGroup): number {\n let feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00;\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n });\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n } \n return (feesTotal - remissionsTotal) - paymentsTotal;\n }\n\n removeUnwantedString(input: string, replaceText: string) {\n const pattern = /[\\_]/gi;\n return input.replace(pattern, replaceText);\n }\n\n downloadSelectedReport(reportName: string, startDate: string, endDate:string): Observable<any> {\n return this.https.get(`${this.paymentLibService.BULKSCAN_API_ROOT}/report/data?date_from=${startDate}&date_to=${endDate}&report_type=${reportName}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n}\n}\n","import { Component, OnInit } from '@angular/core';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {CaseTransactionsService} from '../../services/case-transactions/case-transactions.service';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {IFee} from '../../interfaces/IFee';\nimport {IPayment} from '../../interfaces/IPayment';\nimport {IRemission} from '../../interfaces/IRemission';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'ccpay-case-transactions',\n template: `<div class=\"govuk-width-container\">\n\n <main class=\"govuk-main-wrapper\">\n <div *ngIf=\"viewStatus === 'main'&& !isTurnOff && takePayment\">\n\n\n <div *ngIf=\"takePayment\" class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Case transactions</h1>\n </div>\n </div>\n\n <div *ngIf=\"takePayment\" class=\"govuk-grid-row\">\n <div *ngIf='!isExceptionRecord' class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6 govuk-!-padding-top-6\">\n <h3 class=\"heading-medium\">CCD reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div *ngIf='isExceptionRecord' class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6 govuk-!-padding-top-6\">\n <h3 class=\"heading-medium\">Exception reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Total payments</td>\n <td class=\"govuk-table__header\" scope=\"col\">Total remissions</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n <td class=\"govuk-table__header govuk-table__header--custom\" scope=\"col\" *ngIf=\"isBulkScanEnable\">Unallocated payments</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"totalpayments govuk-table__row\">\n <td class=\"govuk-table__cell summary-table-font\">{{ totalPayments | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell summary-table-font\">{{ totalRemissions | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell summary-table-font\">{{ clAmountDue | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"govuk-table__cell case-transaction__color summary-table-font\" *ngIf=\"isBulkScanEnable\">{{unprocessedRecordCount}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class=\"govuk-grid-column-two-thirds\" *ngIf=\"takePayment\">\n <button type=\"submit\" (click)=\"redirectToFeeSearchPage($event)\"\n [disabled]=\"!isAddFeeBtnEnabled\"\n [ngClass]='!isAddFeeBtnEnabled ? \"govuk-button govuk-button--secondary govuk-button--disabled govuk-!-margin-right-1\" : \"govuk-button govuk-button--secondary govuk-!-margin-right-1\"'>\n Take telephony payment\n </button>\n </div>\n\n </div>\n <div class=\"govuk-grid-row\">\n\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [FEE_RECORDS_EXISTS]=\"isAnyFeeGroupAvilable\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [PAYMENTREF]=\"paymentRef\"\n (getUnprocessedFeeCount) = \"getUnprocessedFeeCount($event)\"\n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n </ccpay-app-unprocessed-payments>\n <!-- <hr class=\"govuk-section-records-break\">\n <ccpay-app-processed-payments\n *ngIf=\"takePayment\" [NONPAYMENTS]=\"nonPayments\"\n (goToPaymentViewComponent) = \"goToPaymentViewComponent($event)\"\t>\n </ccpay-app-processed-payments>\n <hr class=\"govuk-section-records-break\"> -->\n </div>\n <div *ngIf=\"takePayment\" class=\" govuk-!-margin-top-9\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h3 class=\"heading-medium\">Fees</h3>\n </div>\n <div class=\"govuk-grid-column-full\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n <td class=\"govuk-table__header\" scope=\"col\">Action</td>\n\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngFor=\"let paymentGroup of paymentGroups;\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell\">\t{{fee.code}} </td>\n <td class=\"govuk-table__cell\">{{fee.description}}</td>\n <td class=\"govuk-table__cell\">{{fee.volume? fee.volume : '-'}}</td>\n <td class=\"govuk-table__cell\">{{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\" [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"paymentGroup.old && i==0\"> {{getGroupOutstandingAmount(paymentGroup)| currency:'GBP':'symbol-narrow':'1.2-2'}}* </td>\n <td class=\"govuk-table__cell\" *ngIf=\"!paymentGroup.old\"> {{calculateAmountDue(fee) | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n <td class=\"govuk-table__cell\" *ngIf=\"!paymentGroup.old\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='!isCheckAmountdueExist(fee.amount_due) || fee.remissions ? \"disable-link\" : \"\"'>Remove</a>\n </td>\n <td class=\"govuk-table__cell\" *ngIf=\"paymentGroup.old\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='paymentGroup.payments?.length > 0 || paymentGroup.remissions?.length > 0 ? \"disable-link\" : \"\"'>Remove</a>\n </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroups?.length === 0\">\n <tr class=\"govuk-table__row\" >\n <td class=\"govuk-table__cell\" colspan=\"7\">No fees recorded</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"hmcts-banner\" *ngIf=\"isHistoricGroupAvailable\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z\"></path>\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">information</span>\n * These fees have already been processed offline. Check the notes in CCD for more information.\n </div>\n </div>\n <div class=\"panel panel-no--style\" *ngIf=\"allPayments?.length > 0 || remissions?.length > 0\">\n <!-- payments -->\n <h3 class=\"heading-medium\">Payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header col-28\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header col-15\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Payment status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of allPayments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(payment.paymentGroupReference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"7\">No payments recorded</td>\n </tbody>\n </table>\n\n <!-- remissions -->\n <h3 class=\"heading-medium\">Remissions</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Remission reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission amount</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"remissions?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let remission of remissions\">\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.remission_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.fee_code }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_amount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"remissions?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">No remissions recorded</td>\n </tbody>\n </table>\n </div>\n </div>\n</div>\n <div *ngIf=\"takePayment && isTurnOff\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Case transactions</h1>\n </div>\n\n <div class=\"govuk-grid-column-one-third\" align=\"right\" >\n <a [ngClass]=\"{ 'disable': !isAddFeeBtnEnabled} \" (click)=\"redirectToFeeSearchPage($event)\" class=\"button\">Add a new fee</a>\n </div>\n </div> \n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6\">\n <h3 class=\"heading-medium\">CCD reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Total payments</td>\n <td class=\"govuk-table__header\" scope=\"col\">Total remissions</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"totalpayments govuk-table__row\">\n <td class=\"govuk-table__cell\">{{ totalPayments | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{ totalRemissions | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{ (totalFees - totalRemissions) - totalPayments | currency :'GBP':'symbol':'1.2-2'}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n\n\n <!-- No fees start -->\n <div *ngIf=\"paymentGroups?.length === 0\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-small\">Existing fees</span>\n </div>\n\n <div class=\"govuk-grid-column-full\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No fees recorded</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n <!-- No fees end -->\n\n <div *ngFor=\"let paymentGroup of paymentGroups\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full govuk-grid-column-full--gr\">\n <span class=\"heading-medium\">Group reference: {{paymentGroup.payment_group_reference}}</span>\n </div>\n </div>\n <div class=\"govuk-grid-row\">\n\n <!--New Code start-->\n\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-small\">Exisiting fees</span>\n </div>\n <div class=feeclass>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"groupamount govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3 align-center\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\"> {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\"> {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6 govuk-table__custom--col6\" [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n {{getGroupOutstandingAmount(paymentGroup) | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length==0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"govuk-inset-text govuk-inset-text__no-border\" *ngIf=\"paymentGroup.payments || paymentGroup.remissions\">\n <details>\n <summary class=\"govuk-hidetext\">\n <span class=\"summary\">Allocated payments and remissions</span>\n </summary>\n\n <div class=\"panel panel-border-narrow\">\n <!-- payments -->\n <span class=\"heading-medium\">Payments</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.payments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of paymentGroup.payments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(paymentGroup.payment_group_reference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.payments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n\n <!-- remissions -->\n <span class=\"heading-medium\">Remissions</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Remission reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee applied against</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission amount</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.remissions?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let remission of paymentGroup.remissions\">\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.remission_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.fee_code }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_amount }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.remissions?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">No remissions recorded</td>\n </tbody>\n </table>\n </div>\n </details>\n \n\n <div *ngIf=\"takePayment\">\n <button type=\"submit\" (click)=\"loadFeeSummaryPage(paymentGroup)\"\n [disabled]=\"(getGroupOutstandingAmount(paymentGroup) <= 0 || isUnprocessedRecordSelected)\"\n [ngClass]='(getGroupOutstandingAmount(paymentGroup) <= 0 || isUnprocessedRecordSelected) ? \"govuk-button govuk-button--secondary govuk-button--disabled govuk-!-margin-right-1\" : \"govuk-button govuk-button--secondary govuk-!-margin-right-1\"'>\n Add telephone payment\n </button>\n </div>\n </div>\n </div>\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [FEE_RECORDS_EXISTS]=\"isFeeRecordsExist\" \n [IS_OS_AMT_AVAILABLE]=\"isGrpOutstandingAmtPositive\" \n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n </ccpay-app-unprocessed-payments>\n <div class=\"govuk-grid-row govuk-grid__surplus-payments\" *ngIf=\"totalRefundAmount > 0 && takePayment\">\n <div class=\"govuk-grid-column-full govuk-grid__surplus-payments-col1\">\n <h3 class=\"heading-medium\">Surplus payments</h3>\n </div>\n <div class=\"govuk-grid-column-full\">\n Total surplus payments received: {{totalRefundAmount | currency :'GBP':'symbol':'1.2-2'}}\n </div>\n </div>\n </div>\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable && !takePayment\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [FEE_RECORDS_EXISTS]=\"isFeeRecordsExist\" \n [IS_OS_AMT_AVAILABLE]=\"isGrpOutstandingAmtPositive\" \n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n</ccpay-app-unprocessed-payments>\n\n<div *ngIf=\"!takePayment\" class=\"govuk-grid-row govuk-grid__surplus-payments\">\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-medium\">Processed payments</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date updated</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of allPayments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(payment.paymentGroupReference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_updated | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"8\">No payments recorded</td>\n </tbody>\n </table>\n</div>\n</div>\n\n<input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEEREMOVALCONFIRMATION_2'>\n<ng-container *ngIf=\"viewStatus === 'feeRemovalConfirmation'\">\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to delete this fee?\n </strong>\n </div>\n <div class=\"govuk-button-grb\">\n <form novalidate>\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemoval()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"button\"\n [disabled]=\"isRemoveBtnDisabled\"\n [ngClass]='isRemoveBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"removeFee(feeId)\">\n Remove\n </button>\n </form>\n </div>\n</ng-container>\n </main>\n</div>`,\n styles: [`.govuk-grid-column-full--gr{position:relative;margin-bottom:10px}.disable{text-decoration:none;cursor:default;color:#fff;background-color:grey;pointer-events:none}.govuk-grid__surplus-payments{margin:20px 0}.govuk-grid__surplus-payments>.govuk-grid-column-full{padding:0}.govuk-grid__surplus-payments-col1{margin-bottom:10px}.govuk-inset-text__no-border{border-left:0}.govuk-hidetext{font-size:22px;padding-bottom:10px}.lowercase{text-transform:lowercase}.channel::first-letter{text-transform:uppercase}.govuk-heading-xl{font-size:48px;margin-bottom:1px}.govuk-section-break--visible{border-bottom:2px solid #000}.totalpayments.govuk-table__row{border-bottom:2px solid #000!important}.govuk-inset-text{margin-left:1em}.govuk-button{font-size:19px}.govuk-table__cell.govuk-table__cell--col6.govuk-table__custom--col6,.groupamount.govuk-table__header{text-align:right}.feeclass{padding-left:.7em}.align-center{text-align:center}details summary{display:list-item}.case-transaction__color{color:#a71414;font-weight:700;text-align:center}.capitalize::first-letter{text-transform:uppercase}.govuk-inset-text__no-left-margin{margin-left:0;padding-left:0}.whitespace-inherit{white-space:inherit!important}.govuk-section-records-break{margin:10px;border-bottom:2px solid #000!important}.exisitng-fees{margin-left:12px}.add-telephony-payment{margin-top:-2em;margin-left:-2em}.govuk-table__header--custom{text-align:center}.disable-link{cursor:default;pointer-events:none;color:#8e8c8c}.panel-no--style{border-left-style:none}.col-28{width:28%}.col-15{width:15%}.hmcts-banner>.hmcts-banner__message{font-size:19px;line-height:1.25}.summary-table-font{font-size:36px}`]\n})\nexport class CaseTransactionsComponent implements OnInit {\n takePayment: boolean;\n ccdCaseNumber: string;\n excReference: string;\n paymentGroups: any[] = [];\n payments: IPayment[] = [];\n nonPayments: IPayment[] = [];\n allPayments: IPayment[] = [];\n remissions: IRemission[] = [];\n fees: IFee[] = [];\n errorMessage: string;\n totalFees: number;\n totalPayments: number;\n totalNonOffPayments: number;\n totalRemissions: number;\n selectedOption: string;\n dcnNumber: string;\n paymentRef: string;\n isTurnOff: boolean;\n isStrategicFixEnable: boolean;\n isAddFeeBtnEnabled: boolean = true;\n isExceptionRecord: boolean = false;\n isUnprocessedRecordSelected: boolean = false;\n exceptionRecordReference: string;\n isAnyFeeGroupAvilable: boolean = true;\n isHistoricGroupAvailable: boolean = false;\n isBulkScanEnable;\n isRemissionsMatch: boolean;\n viewStatus = 'main';\n isRemoveBtnDisabled: boolean = false;\n feeId:IFee;\n clAmountDue: number = 0;\n unprocessedRecordCount: number;\n isFeeRecordsExist: boolean = false;\n isGrpOutstandingAmtPositive: boolean = false;\n totalRefundAmount: Number;\n\n constructor(private router: Router,\n private paymentViewService: PaymentViewService,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private caseTransactionsService: CaseTransactionsService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.isGrpOutstandingAmtPositive = false;\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n if(this.paymentLibComponent.CCD_CASE_NUMBER === '') {\n this.ccdCaseNumber = this.paymentLibComponent.EXC_REFERENCE;\n }\n this.excReference = this.paymentLibComponent.EXC_REFERENCE;\n this.takePayment = this.paymentLibComponent.TAKEPAYMENT;\n this.isBulkScanEnable = this.paymentLibComponent.ISBSENABLE;\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n if(!this.isTurnOff) {\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.paymentGroups = paymentGroups['payment_groups'];\n this.calculateAmounts();\n this.calculateRefundAmount();\n },\n (error: any) => {\n this.errorMessage = <any>error;\n this.isAnyFeeGroupAvilable = false;\n this.setDefaults();\n }\n );\n } else {\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.paymentGroups = paymentGroups['payment_groups'];\n this.calculateAmounts();\n this.totalRefundAmount = this.calculateRefundAmount();\n },\n (error: any) => {\n this.errorMessage = <any>error;\n this.setDefaults();\n }\n );\n }\n this.checkForExceptionRecord();\n }\n\n setDefaults(): void {\n this.totalPayments = 0.00;\n this.totalRemissions = 0.00;\n this.totalNonOffPayments = 0.00;\n this.totalFees = 0.00;\n}\n\ngetAllocationStatus(payments: any){\n\n let paymentAllocation = payments.payment_allocation,\n isAllocationStatusExist = paymentAllocation.length >0;\n return isAllocationStatusExist ? paymentAllocation[0].allocation_status : '-';\n //return \"-\";\n\n}\n\ncheckForExceptionRecord(): void {\n if(this.paymentGroups.length === 0 && (this.selectedOption.toLocaleLowerCase() === 'ccdorexception' || this.selectedOption.toLocaleLowerCase() === 'rc')) {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n recordData => {\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length > 0 && recordData['data'].ccd_reference >0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length > 0 && recordData['data'].ccd_reference === undefined) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n }\n\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length === undefined && recordData['data'].ccd_reference >0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n });\n }\n\n if (this.paymentGroups.length === 0 && this.selectedOption.toLocaleLowerCase() === 'dcn') {\n if (this.paymentLibComponent.CCD_CASE_NUMBER.length > 0 && this.paymentLibComponent.EXC_REFERENCE.length > 0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n } else if(this.paymentLibComponent.CCD_CASE_NUMBER.length === 0 && this.paymentLibComponent.EXC_REFERENCE.length > 0) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n } else {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n }\n if (this.paymentGroups.length > 0)\n this.paymentGroups.forEach(paymentGroup => {\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.case_reference !== undefined && payment.ccd_case_number === undefined) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n } else {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n\n });\n }\n });\n}\n\n calculateAmounts(): void {\n let feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00,\n nonOffLinePayment = 0.00;\n \n this.paymentGroups.forEach(paymentGroup => {\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n if(fee.date_created) {\n let a = fee.amount_due === undefined;\n let b = fee.amount_due <= 0;\n this.clAmountDue = a ? this.clAmountDue + fee.net_amount : b ? this.clAmountDue + 0 : this.clAmountDue + fee.amount_due;\n }\n fee['payment_group_reference'] = paymentGroup['payment_group_reference'];\n this.fees.push(fee);\n } else {\n feesTotal = feesTotal + fee.calculated_amount;\n this.fees.push(fee);\n }\n\n });\n }\n if(this.isTurnOff){\n this.totalFees = feesTotal;\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n let allocationLen = payment.payment_allocation;\n\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n if(allocationLen.length === 0 || allocationLen.length > 0 && allocationLen[0].allocation_status ==='Allocated') {\n nonOffLinePayment = nonOffLinePayment + payment.amount;\n }\n if( allocationLen.length > 0 ) {\n this.nonPayments.push(payment);\n }\n }\n if(allocationLen.length === 0) {\n this.payments.push(payment);\n }\n payment.paymentGroupReference = paymentGroup.payment_group_reference\n this.allPayments.push(payment);\n } else {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n this.payments.push(payment);\n }\n payment.paymentGroupReference = paymentGroup.payment_group_reference\n this.allPayments.push(payment);\n }\n });\n }\n this.totalPayments = paymentsTotal;\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n this.totalNonOffPayments = nonOffLinePayment;\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remisison => {\n remissionsTotal = remissionsTotal + remisison.hwf_amount;\n this.remissions.push(remisison);\n });\n }\n this.totalRemissions = remissionsTotal;\n });\n\n }\n calculateRefundAmount() {\n if(!this.isTurnOff){\n let isNewPaymentGroup = false;\n\n this.paymentGroups.forEach((paymentGroup, index) => {\n let grpOutstandingAmount = 0.00,\n feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00,\n fees = [];\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n\n this.isRemissionsMatch = false;\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n\n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n\n if(fee.date_created) {\n isNewPaymentGroup = true;\n }else {\n this.isHistoricGroupAvailable = true;\n this.paymentGroups[index]['old'] = true;\n }\n });\n this.paymentGroups[index].fees = fees;\n }\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n }\n grpOutstandingAmount = (feesTotal - remissionsTotal) - paymentsTotal;\n if(grpOutstandingAmount > 0 && isNewPaymentGroup) {\n this.isAnyFeeGroupAvilable = true;\n this.paymentRef = paymentGroup.payment_group_reference;\n }\n if(paymentGroup.fees && paymentGroup.fees.length > 0 && grpOutstandingAmount <= 0 && isNewPaymentGroup) {\n this.isAnyFeeGroupAvilable = false;\n }\n });\n if((!isNewPaymentGroup && this.isHistoricGroupAvailable) || (!isNewPaymentGroup && !this.isHistoricGroupAvailable)) {\n this.isAnyFeeGroupAvilable = false;\n }\n } else {\n let totalRefundAmount = 0,\n isFeeAmountZero = false;\n this.paymentGroups.forEach(paymentGroup => {\n let grpOutstandingAmount = 0.00,\n feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00;\n if (paymentGroup.fees) {\n this.isFeeRecordsExist = true;\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n if(fee.calculated_amount === 0) {\n isFeeAmountZero = true\n }\n });\n\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n } \n grpOutstandingAmount = (feesTotal - remissionsTotal) - paymentsTotal;\n if (grpOutstandingAmount < 0) {\n if(totalRefundAmount === 0) {\n totalRefundAmount = grpOutstandingAmount;\n } else {\n totalRefundAmount = (totalRefundAmount + grpOutstandingAmount);\n }\n }\n else if(grpOutstandingAmount > 0 || (grpOutstandingAmount === 0 && isFeeAmountZero)) {\n this.isGrpOutstandingAmtPositive = true;\n }\n });\n return totalRefundAmount * -1;\n }\n }\n\n getGroupOutstandingAmount(paymentGroup: IPaymentGroup): number {\n return this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);;\n }\n\n redirectToFeeSearchPage(event: any) {\n event.preventDefault();\n if(!this.isAnyFeeGroupAvilable || this.isTurnOff) {\n let url = this.isBulkScanEnable ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n url += this.isTurnOff ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n url += this.isStrategicFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n this.router.navigateByUrl(`/fee-search?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}${url}`);\n this.router.navigateByUrl(`/fee-search?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}${url}`);\n } else {\n this.paymentLibComponent.bspaymentdcn = null;\n this.paymentLibComponent.paymentGroupReference = this.paymentRef;\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.viewName = 'fee-summary';\n }\n }\n\n redirectToReportsPage(event: any) {\n event.preventDefault();\n this.router.navigateByUrl(`/reports?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}`);\n }\n loadFeeSummaryPage(paymentGroup: IPaymentGroup) {\n this.paymentLibComponent.bspaymentdcn = null;\n this.paymentLibComponent.paymentGroupReference = paymentGroup.payment_group_reference;\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.viewName = 'fee-summary';\n }\n\n goToPaymentViewComponent(paymentGroup: any) {\n this.paymentLibComponent.paymentMethod = paymentGroup.paymentMethod;\n this.paymentLibComponent.paymentGroupReference = paymentGroup.paymentGroupReference;\n this.paymentLibComponent.paymentReference = paymentGroup.paymentReference;\n this.paymentLibComponent.viewName = 'payment-view';\n }\n\n goToPayementView(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.goToPaymentViewComponent({paymentGroupReference, paymentReference, paymentMethod});\n }\n\n selectedUnprocessedFeeEvent(unprocessedRecordId: string) {\n if ( unprocessedRecordId ) {\n if(this.isTurnOff) {\n this.isAddFeeBtnEnabled = false;\n }\n this.isUnprocessedRecordSelected = true;\n } else {\n if(this.isTurnOff) {\n this.isAddFeeBtnEnabled = true;\n } \n this.isUnprocessedRecordSelected = false;\n }\n }\n getUnprocessedFeeCount(unProcessedRecordCount: number) {\n this.unprocessedRecordCount = unProcessedRecordCount;\n }\n\n calculateAmountDue(fee: IFee) {\n\n if(fee.date_created) {\n return fee.amount_due !== undefined? fee.amount_due : fee.net_amount;\n } else {\n return \"0.00\";\n }\n }\n\n confirmRemoveFee(fee: IFee){\n this.isRemoveBtnDisabled = false;\n this.feeId = fee;\n this.viewStatus = 'feeRemovalConfirmation';\n }\n cancelRemoval() {\n this.viewStatus = 'main';\n }\n removeFee(fee: any){\n this.isRemoveBtnDisabled = true;\n this.paymentViewService.deleteFeeFromPaymentGroup(fee).subscribe(\n (success: any) => {\n window.location.reload();\n },\n (error: any) => {\n this.errorMessage = error;\n this.isRemoveBtnDisabled = false;\n }\n );\n }\n\n isCheckAmountdueExist(amountDue: any) {\n return typeof amountDue === 'undefined';\n }\n}\n","import { IFee } from './IFee';\n\nexport class PaymentToPayhubRequest {\n currency = 'GBP';\n site_id: string;\n description = 'PayBubble payment';\n channel = 'telephony';\n provider = 'pci pal';\n service: string;\n\n ccd_case_number: string;\n amount: number;\n\n constructor(ccd_case_number: string, amount: number, service: string, serviceName: string) {\n this.ccd_case_number = ccd_case_number;\n this.amount = <any>amount.toFixed(2);\n this.service= serviceName;\n this.site_id = service;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { IPaymentGroup } from '../../interfaces/IPaymentGroup';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { IRemission } from '../../interfaces/IRemission';\nimport { IFee } from '../../interfaces/IFee';\nimport { PaymentToPayhubRequest } from '../../interfaces/PaymentToPayhubRequest';\nimport { SafeHtml } from '@angular/platform-browser';\nimport {Router} from '@angular/router';\nimport {Location} from '@angular/common';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-fee-summary',\n template: `\n<div class=\"govuk-breadcrumbs\" *ngIf=\"isBackButtonEnable\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\" *ngIf=\"!isTurnOff\">\n <a (click)=\"loadCaseTransactionPage()\" class=\"govuk-back-link govuk-label\">Back</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\" *ngIf=\"isTurnOff\">\n <a (click)=\"redirectToFeeSearchPage($event,'summary')\" class=\"govuk-back-link govuk-label\">Back</a>\n </li>\n </ol>\n</div>\n<div class=\"fee-summary\" *ngIf=\"viewStatus === 'main'\">\n <main class=\"govuk-main-wrapper\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEESUMMARY'>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"heading-xlarge\">Fee Summary</h1>\n </div>\n\n\n  <div class=\"govuk-grid-column-one-third\" align=\"right\">\n       <button *ngIf=\"!isTurnOff\" (click)=\"redirectToFeeSearchPage($event,'summary')\"\n       [disabled]=\"isPaymentExist\"\n       [ngClass]='isPaymentExist ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'>\n Add a new fee\n </button>\n\n <a *ngIf=\"isTurnOff\" (click)=\"redirectToFeeSearchPage($event,'summary')\" class=\"button\">Add a new fee</a>\t\n </div>\n </div>\n\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment Group details could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <table class=\"govuk-table\" *ngIf=\"!errorMessage && paymentGroup\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Fee Code</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Fee description</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Remission code</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell\">{{ fee.code }}</td>\n <td class=\"govuk-table__cell\">{{ fee.description }}</td>\n <td class=\"govuk-table__cell\">{{ getRemissionByFeeCode(fee.code)?.hwf_reference }}</td>\n <td class=\"govuk-table__cell grey-text\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Fee amount:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"!isTurnOff\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='isPaymentExist || fee.remissions ? \"disable-link\" : \"\"'>remove fee</a>\n </td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"isTurnOff\">\n <a (click)=\"confirmRemoveFee(fee.id)\">remove fee</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"fee.volume && fee.volume > 0\">\n <td class=\"no-border grey-text subcolumn-1\">Volume:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.volume }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Fee total:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Remission amount:</td>\n <td class=\"no-border subcolumn-2\">{{ getRemissionByFeeCode(fee.code)?.hwf_amount? ( getRemissionByFeeCode(fee.code)?.hwf_amount | currency:'GBP':'symbol-narrow':'1.2-2') : '-' }}</td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"!isTurnOff\"> \n <a (click)=\"addRemission(fee)\" [ngClass]=\"{'remissionDisable': !service}\" *ngIf=\"(getRemissionByFeeCode(fee.code)?.hwf_amount === 0 || !getRemissionByFeeCode(fee.code)?.hwf_amount) && !isPaymentExist\">\n Deduct remission\n </a>\n </td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"isTurnOff\"> \n <a (click)=\"addRemission(fee)\" [ngClass]=\"{'remissionDisable': !service}\" *ngIf=\"getRemissionByFeeCode(fee.code)?.hwf_amount === 0 || !getRemissionByFeeCode(fee.code)?.hwf_amount\">\n Deduct remission\n </a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Total after remission:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.net_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n </table>\n </td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border govuk-!-font-weight-bold subcolumn-1\">Total payment</td>\n <td class=\"no-border subcolumn-2\">{{ totalAfterRemission - outStandingAmount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border govuk-!-font-weight-bold subcolumn-1\">Total outstanding amount</td>\n <td class=\"no-border subcolumn-2\">{{ outStandingAmount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n </table>\n </td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"!bsPaymentDcnNumber\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n <div class=\"govuk-form-group govuk-form-group--mg\">\n <label class=\"govuk-label custom-govuk-label govuk-fieldset__heading--fz\" for=\"responsibleOffice\">\n <strong>What service is this fee for?</strong>\n </label>\n <select class=\"govuk-select govuk-select--custom\" id=\"responsibleOffice\" [(ngModel)]=\"service\" name=\"responsibleOffice\">\n <option value=\"\" selected='selected'>Please select</option>\n <option value=\"AA07\">Divorce</option>\n <option value=\"AA09\">Financial Remedy</option>\n <option value=\"AA08\">Probate</option>\n </select>\n </div>\n </td>\n </tr>\n </tbody>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border subcolumn-2\"> \n <button *ngIf=\"!bsPaymentDcnNumber\" type=\"submit\" (click)=\"takePayment()\"\n [disabled]=\"totalFee <= 0 || !service || isConfirmationBtnDisabled\"\n [ngClass]='totalFee <= 0 || !service || isConfirmationBtnDisabled? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'>\n Take payment\n </button>\n <button *ngIf=\"bsPaymentDcnNumber\" type=\"button\" (click)=\"goToAllocatePage(outStandingAmount, isFeeAmountZero)\" class=\"button govuk-!-margin-right-1\">\n <span *ngIf=\"outStandingAmount > 0 || (isFeeAmountZero && outStandingAmount === 0)\">\n Allocate payment\n </span>\n <span *ngIf=\"outStandingAmount < 0 || (!isFeeAmountZero && outStandingAmount === 0)\">\n Continue\n </span>\n </button>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n</main>\n</div>\n\n <ng-container *ngIf=\"viewStatus === 'feeRemovalConfirmation'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEEREMOVALCONFIRMATION_1'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to delete this fee?\n </strong>\n </div>\n <div class=\"govuk-button-grb\">\n <form novalidate>\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemission()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"button\" \n [disabled]=\"isRemoveBtnDisabled\"\n [ngClass]='isRemoveBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"removeFee(currentFee)\">\n Remove\n </button>\n </form>\n </div>\n </ng-container>\n\n<ccpay-add-remission *ngIf=\"viewStatus === 'add_remission' && currentFee\"\n [isTurnOff]=\"isTurnOff\"\n [isStrategicFixEnable]=\"isStrategicFixEnable\" \n [fee]=\"currentFee\" \n [service]=\"service\" \n [ccdCaseNumber]=\"ccdCaseNumber\" \n [paymentGroupRef]=\"paymentGroupRef\" \n (cancelRemission)=\"cancelRemission()\"></ccpay-add-remission>\n <input *ngIf=\"viewStatus === 'payhub_view' && payhubHtml\" #myInput type='hidden' id='iFrameDrivenImageValue' value='PCIPAL'>\n<div *ngIf=\"viewStatus === 'payhub_view' && payhubHtml\" [innerHTML]=\"payhubHtml | sanitizeHtml\" id=\"payhub-html-id\"></div>\n`,\n styles: [`.fee-summary .grey-text{color:#6b7376;font-weight:500}.fee-summary .govuk-table{margin-bottom:0}.fee-summary .no-border{border:none;border-bottom:none}.fee-summary table td,.fee-summary table th{font-size:15px;font-weight:500;vertical-align:top;max-width:320px}.fee-summary table td .no-padding,.fee-summary table th .no-padding{padding:0}.fee-summary table td .subcolumn-1,.fee-summary table th .subcolumn-1{width:45%}.fee-summary table td .subcolumn-2,.fee-summary table th .subcolumn-2{width:25%;text-align:right}.fee-summary table td .subcolumn-3,.fee-summary table th .subcolumn-3{width:30%;text-align:center}.govuk-button-grb{padding-bottom:20px}.govuk-button-grb .govuk-button--secondary{background-color:#dee0e2;box-shadow:0 2px 0 #858688;color:#0b0c0c;margin-right:10px}.govuk-form-group--mg{margin-top:10px!important}.govuk-fieldset__heading--fz{font-size:16px}.remissionDisable{color:grey;cursor:default}.heading-xlarge{margin:0 0 14px -20px}.govuk-select--custom{width:50%}.disable-link{cursor:default;pointer-events:none;color:#8e8c8c}`]\n})\n\nexport class FeeSummaryComponent implements OnInit {\n @Input() paymentGroupRef: string;\n @Input() ccdCaseNumber: string;\n @Input() isTurnOff: string;\n\n bsPaymentDcnNumber: string;\n paymentGroup: IPaymentGroup;\n errorMessage: string;\n viewStatus = 'main';\n currentFee: IFee;\n totalFee: number;\n payhubHtml: SafeHtml;\n service: string = \"\";\n upPaymentErrorMessage: string;\n selectedOption:string;\n isBackButtonEnable: boolean = true;\n outStandingAmount: number;\n isFeeAmountZero: boolean = false;;\n totalAfterRemission: number = 0;\n isConfirmationBtnDisabled: boolean = false;\n isRemoveBtnDisabled: boolean = false;\n isPaymentExist: boolean = false;\n isRemissionsExist: Boolean = false;\n isRemissionsMatch = false;\n isStrategicFixEnable: boolean;\n\n constructor(\n private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private location: Location,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent\n ) {}\n\n ngOnInit() {\n this.viewStatus = 'main';\n this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n if (this.bsPaymentDcnNumber) {\n this.getUnassignedPaymentlist();\n }\n this.getPaymentGroup();\n }\n\n getUnassignedPaymentlist() {\n if (this.selectedOption === 'dcn') {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.paymentLibComponent.DCN_NUMBER).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'].payments) {\n this.service = unassignedPayments['data'].responsible_service_id;\n } else {\n this.upPaymentErrorMessage = 'error';\n }\n },\n (error: any) => this.upPaymentErrorMessage = error\n );\n } else {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'].payments) {\n this.service = unassignedPayments['data'].responsible_service_id;\n } else {\n this.upPaymentErrorMessage = 'error'; \n } \n },\n (error: any) => this.upPaymentErrorMessage = error\n );\n }\n\n }\n\n getRemissionByFeeCode(feeCode: string): IRemission {\n if (this.paymentGroup && this.paymentGroup.remissions && this.paymentGroup.remissions.length > 0) {\n for (const remission of this.paymentGroup.remissions) {\n if (remission.fee_code === feeCode) {\n return remission;\n }\n }\n }\n return null;\n }\n\n addRemission(fee: IFee) {\n if (this.service) {\n this.currentFee = fee;\n this.viewStatus = 'add_remission';\n }\n }\n\n getPaymentGroup() {\n let fees = [];\n this.paymentViewService.getPaymentGroupDetails(this.paymentGroupRef).subscribe(\n paymentGroup => {\n this.paymentGroup = paymentGroup;\n this.isPaymentExist = paymentGroup.payments ? paymentGroup.payments.length > 0 : false;\n this.isRemissionsExist = paymentGroup.remissions ? paymentGroup.remissions.length > 0 : false;\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n this.totalAfterRemission = this.totalAfterRemission + fee.net_amount;\n if(fee.calculated_amount === 0) {\n this.isFeeAmountZero = true;\n }\n this.isRemissionsMatch = false;\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n \n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n });\n paymentGroup.fees = fees;\n }\n\n this.outStandingAmount = this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);\n },\n (error: any) => this.errorMessage = error\n );\n }\n\n confirmRemoveFee(fee: IFee){\n this.isRemoveBtnDisabled = false;\n this.currentFee = fee;\n this.viewStatus = 'feeRemovalConfirmation';\n }\n\n removeFee(fee: any){\n this.isRemoveBtnDisabled = true;\n this.paymentViewService.deleteFeeFromPaymentGroup(fee).subscribe(\n (success: any) => {\n if (this.paymentGroup.fees && this.paymentGroup.fees.length > 1){\n this.totalAfterRemission = 0;\n this.getPaymentGroup();\n this.viewStatus = 'main';\n return;\n }\n this.loadCaseTransactionPage();\n },\n (error: any) => {\n this.errorMessage = error;\n this.isRemoveBtnDisabled = false;\n }\n );\n }\n\n loadCaseTransactionPage() {\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n let partUrl = `selectedOption=${this.paymentLibComponent.SELECTED_OPTION}`;\n partUrl +=this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl +=this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl +=this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl +=this.paymentLibComponent.ISSFENABLE ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n let url = `/payment-history/${this.ccdCaseNumber}?view=case-transactions&takePayment=true&${partUrl}`;\n this.router.navigateByUrl(url);\n }\n cancelRemission() {\n this.viewStatus = 'main';\n }\n redirectToFeeSearchPage(event: any, page?: string) {\n event.preventDefault();\n let partUrl = this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl +=this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl +=this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl +=this.paymentLibComponent.ISSFENABLE ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n if(this.viewStatus === 'feeRemovalConfirmation' || this.viewStatus === 'add_remission') {\n this.viewStatus = 'main';\n return;\n }\n let url = `/fee-search?ccdCaseNumber=${this.ccdCaseNumber}&selectedOption=${this.paymentLibComponent.SELECTED_OPTION}&paymentGroupRef=${this.paymentGroupRef}${partUrl}`;\n this.router.navigateByUrl(url);\n }\n takePayment() {\n this.isConfirmationBtnDisabled = true;\n const seriveName = this.service ==='AA07' ? 'DIVORCE': this.service ==='AA08' ? 'PROBATE' : 'FINREM',\n\n requestBody = new PaymentToPayhubRequest(this.ccdCaseNumber, this.outStandingAmount, this.service, seriveName);\n this.paymentViewService.postPaymentToPayHub(requestBody, this.paymentGroupRef).subscribe(\n response => {\n this.location.go(`payment-history?view=fee-summary`);\n this.payhubHtml = response;\n this.viewStatus = 'payhub_view';\n this.isBackButtonEnable=false;\n },\n (error: any) => {\n this.errorMessage = error;\n this.isConfirmationBtnDisabled = false;\n this.router.navigateByUrl('/pci-pal-failure');\n }\n );\n }\n goToAllocatePage(outStandingAmount: number, isFeeAmountZero: Boolean) {\n if (outStandingAmount > 0 || (outStandingAmount === 0 && isFeeAmountZero)) {\n this.paymentLibComponent.paymentGroupReference = this.paymentGroupRef;\n this.paymentLibComponent.viewName = 'allocate-payments';\n } else {\n this.loadCaseTransactionPage();\n }\n }\n isCheckAmountdueExist(amountDue: any) {\n return typeof amountDue === 'undefined';\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\n\n\n\n@Component({\n selector: 'ccpay-error-banner',\n template: `<div class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title govuk-error-summary__title-custom\" id=\"error-summary-title\">\n {{errorMessage.title}}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n {{errorMessage.body}}\n </li>\n </ul>\n </div>\n</div>`,\n styles: [`.govuk-error-summary h2{font-size:24px}.govuk-error-summary__list li{font-size:19px}`]\n})\n\nexport class ErrorBannerComponent implements OnInit {\n @Input('errorMessage') errorMessage;\n\n constructor(\n ) {}\n\n ngOnInit() {\n\n }\n}\n","\nexport class UnidentifiedPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n unidentified_reason: string;\n\n constructor(payment_group_reference: string, payment_reference : string, unidentified_reason: any) {\n this.payment_allocation_status = {\n description: '',\n name: \"Unidentified\"\n };\n this.payment_group_reference = payment_group_reference ;\n this.payment_reference= payment_reference;\n this.unidentified_reason= unidentified_reason;\n\n }\n\n\n\n}\n","import { IBSPayments } from \"./IBSPayments\";\n\nexport class AllocatePaymentRequest {\n amount: Number;\n banked_date: String;\n ccd_case_number: String;\n exception_record: string;\n currency: String;\n document_control_number: String;\n external_provider: String;\n giro_slip_no: String;\n payer_name: String;\n payment_channel: Object;\n payment_status: Object;\n payment_method: String;\n requestor: String;\n site_id: String;\n payment_allocation_dto?: {\n allocation_reason: String,\n allocation_status: String,\n explanation: String,\n payment_allocation_status: Object,\n payment_group_reference: String,\n payment_reference: String,\n reason: String,\n receiving_office: String,\n unidentified_reason: String,\n user_id: String,\n user_name: String\n }\n\n constructor(ccd_case_number : string, unAllocatedPayment: IBSPayments, siteID: string, exceptionRecord: string, allocatedRequest?: any) {\n this.amount = unAllocatedPayment.amount;\n this.banked_date = unAllocatedPayment.date_banked;\n this.ccd_case_number = ccd_case_number;\n this.exception_record = exceptionRecord;\n this.currency= unAllocatedPayment.currency;\n this.document_control_number = unAllocatedPayment.dcn_reference;\n this.external_provider = 'exela';\n this.giro_slip_no = unAllocatedPayment.bgc_reference;\n this.payer_name = unAllocatedPayment.payer_name;\n this.payment_channel = {\n description: '',\n name: 'bulk scan'\n };\n this.payment_status ={\n description: 'bulk scan payment completed',\n name: 'success'\n }\n this.payment_method = unAllocatedPayment.payment_method;\n this.requestor= siteID==='AA07' ? 'DIVORCE' : siteID==='AA08' ? 'PROBATE' : 'FINREM';\n this.site_id= siteID;\n if(allocatedRequest) {\n this.payment_allocation_dto = allocatedRequest;\n }\n\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {BulkScaningPaymentService} from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { UnidentifiedPaymentsRequest } from '../../interfaces/UnidentifiedPaymentsRequest';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\n\n@Component({\n selector: 'app-mark-unidentified-payment',\n template: `<div class=\"mkpay-unidentified\" >\n <div *ngIf=\"viewStatus === 'mainForm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='MARKUNIDENTIFIED'>\n <h1 class=\"heading-large\">Mark payment as unidentified</h1>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n \n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{unassignedRecord.dcn_reference}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n </table>\n </div>\n <form [formGroup]=\"markPaymentUnidentifiedForm\" novalidate>\n <div class=\"govuk-form-group\">\n <p class=\"unidentifiedSubText\">\n Give a reason for marking this payment as unidentified.\n <br/>\n Include any investigations you've made.\n </p>\n <label class=\"heading-small\" for=\"investicationDetail\">\n\n </label>\n <textarea class=\"form-control form-control-3-4\" [ngClass]=\"{'inline-error-class': isInvesticationDetailEmpty || investicationDetailHasError || investicationDetailMinHasError || investicationDetailMaxHasError}\" name=\"investicationDetail\" id=\"investicationDetail\" rows=\"5\" formControlName=\"investicationDetail\">\n </textarea>\n <p class=\"inline-error-message\" *ngIf=\"isInvesticationDetailEmpty || investicationDetailHasError || investicationDetailMinHasError || investicationDetailMaxHasError\">\n <span *ngIf=\"isInvesticationDetailEmpty\">Enter a reason for marking this payment as unidentified.</span>\n <span *ngIf=\"investicationDetailHasError\">Enter a vaild reason</span>\n <span *ngIf=\"investicationDetailMinHasError\">Reason should be at least 3 characters.</span>\n <span *ngIf=\"investicationDetailMaxHasError\">Reason should be 255 characters or under.</span>\n </p>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"saveAndContinue()\">\n Continue\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments('cancel')\">\n Cancel\n </button>\n </div>\n </form>\n </div>\n <ng-container *ngIf=\"viewStatus === 'unidentifiedContinueConfirm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='UNIDENTIFIEDCONFIRMATION'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n <h1 class=\"heading-small\"> Are you sure you want to mark this payment as unidentified? </h1>\n \n </strong>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Investigations</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{investigationComment}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" [disabled]=\"isConfirmButtondisabled\" (click)=\"confirmPayments()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments()\">\n Cancel\n </button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'unidentifiedCancelConfirm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CANCELUNIDENTIFIED'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to cancel?\n </strong>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"gotoCasetransationPage()\">\n Yes\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments()\">\n No\n </button>\n </div>\n </ng-container>\n</div>\n`,\n styles: [`.mkpay-unidentified{margin:10px 0 20px}.mkpay-unidentified .govuk-button--group .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.mkpay-unidentified .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.mkpay-unidentified .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.govuk-grid-column-full{padding:0}.unidentifiedSubText{line-height:45px}.govuk-warning-text__text{font-size:19px}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}`]\n})\nexport class MarkUnidentifiedPaymentComponent implements OnInit {\n markPaymentUnidentifiedForm: FormGroup;\n viewStatus: string;\n ccdCaseNumber: string;\n bspaymentdcn: string;\n isInvesticationDetailEmpty: boolean = false;\n investicationDetailHasError: boolean = false;\n investicationDetailMinHasError: boolean = false;\n investicationDetailMaxHasError: boolean = false;\n errorMessage = this.getErrorMessage(false);\n unassignedRecord:IBSPayments;\n siteID: string = null;\n investigationComment: string;\n isConfirmButtondisabled:Boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n isStrategicFixEnable: boolean = true;\n\n constructor(private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.getUnassignedPayment();\n\n this.markPaymentUnidentifiedForm = this.formBuilder.group({\n investicationDetail: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ]))\n });\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n this.errorMessage = this.getErrorMessage(false);\n this.unassignedRecord = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n saveAndContinue() {\n this.resetForm([false, false, false, false]);\n const investicationField = this.markPaymentUnidentifiedForm.controls.investicationDetail;\n const formerror = investicationField.errors;\n if (this.markPaymentUnidentifiedForm.dirty && this.markPaymentUnidentifiedForm.valid) {\n this.investigationComment = this.markPaymentUnidentifiedForm.controls.investicationDetail.value;\n this.viewStatus = 'unidentifiedContinueConfirm';\n }else {\n if(investicationField.value == '' ) {\n this.resetForm([true, false, false, false]);\n }\n if(investicationField.value != '' && investicationField.invalid ) {\n this.resetForm([false, true, false, false]);\n }\n if(formerror && formerror.minlength && formerror.minlength.actualLength < 3 ) {\n this.resetForm([false, false, true, false]);\n }\n if(formerror && formerror.maxlength && formerror.maxlength.actualLength > 255 ) {\n this.resetForm([false, false, false, true]);\n }\n }\n }\n resetForm(val) {\n this.isInvesticationDetailEmpty = val[0];\n this.investicationDetailHasError = val[1];\n this.investicationDetailMinHasError = val[2];\n this.investicationDetailMaxHasError = val[3];\n }\n confirmPayments() {\n this.isConfirmButtondisabled = true;\n const reason = this.markPaymentUnidentifiedForm.get('investicationDetail').value;\n\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n allocation_status:'Unidentified',\n payment_allocation_status: {\n description: '',\n name: 'Unidentified'\n },\n unidentified_reason: reason,\n user_id: this.siteID,\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSWoPGStrategic(postStrategicBody).subscribe(\n res => {\n this.errorMessage = this.getErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n });\n } else {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.getErrorMessage(false);\n const requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference)\n this.paymentViewService.postBSPayments(requestBody).subscribe(\n res2 => {\n this.errorMessage = this.getErrorMessage(false);\n const response2 = JSON.parse(res2),\n reqBody = new UnidentifiedPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, reason);\n if (response2.success) {\n this.paymentViewService.postBSUnidentifiedPayments(reqBody).subscribe(\n res3 => {\n this.errorMessage = this.getErrorMessage(false);\n const response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n }\n cancelMarkUnidentifiedPayments(type?:string){\n if(type && type === 'cancel') {\n if(this.markPaymentUnidentifiedForm.get('investicationDetail').value!==\"\"){\n this.viewStatus = 'unidentifiedCancelConfirm';\n } else {\n this.gotoCasetransationPage();\n }\n } else {\n this.viewStatus = 'mainForm';\n }\n }\n\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n getErrorMessage(isErrorExist) {\n return {\n title: \"There is a problem with the service\",\n body: \"Try again later\",\n showError: isErrorExist\n };\n }\n}\n","\nexport class UnsolicitedPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n receiving_office: string;\n receiving_email_address: string;\n sending_email_address: string;\n unidentified_reason: string;\n constructor(payment_group_reference: string, payment_reference : string, reason: string,responsible_office: string, responsible_person:string,email_id: string) {\n this.payment_allocation_status = {\n description: '',\n name: \"Transferred\"\n };\n this.payment_group_reference = payment_group_reference;\n this.payment_reference= payment_reference;\n this.unidentified_reason= reason;\n this.receiving_office= responsible_office;\n this.receiving_email_address= email_id;\n this.sending_email_address= responsible_person;\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { UnsolicitedPaymentsRequest } from '../../interfaces/UnsolicitedPaymentsRequest';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\n\n\n@Component({\n selector: 'app-mark-unsolicited-payment',\n template: `<div class=\"mkpay-unidentified\">\n <div *ngIf=\"viewStatus === 'mainForm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <h1 class=\"heading-large\">Mark payment as transferred</h1>\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{unassignedRecord.dcn_reference}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <form [formGroup]=\"markPaymentUnsolicitedForm\" novalidate>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='MARKTRANSFERRED'>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label custom-govuk-label custom-govuk-label\" for=\"reason\">\n Reason for payment being marked as transferred \n </label>\n <textarea class=\"form-control form-control-3-4\" [ngClass]=\"{'inline-error-class': reasonHasError || reasonMinHasError || reasonMaxHasError}\" name=\"reason\" id=\"reason\" rows=\"5\" formControlName=\"reason\">\n </textarea>\n <p class=\"inline-error-message\" *ngIf=\"isReasonEmpty || reasonHasError || reasonMinHasError || reasonMaxHasError\">\n <span *ngIf=\"isReasonEmpty\">Enter a reason for marking this payment as transferred.</span>\n <span *ngIf=\"reasonHasError\">Enter a valid reason</span>\n <span *ngIf=\"reasonMinHasError\">Reason should be at least 3 characters.</span>\n <span *ngIf=\"reasonMaxHasError\">Reason should be 255 characters or under.</span>\n </p>\n </div>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label custom-govuk-label\" for=\"responsibleOffice\">\n Receiving Site ID (Receiving court/Bulk centre site ID) \n </label>\n <select class=\"form-control short-input\" id=\"responsibleOffice\" formControlName=\"responsibleOffice\" (change)=\"selectchange($event)\">\n <option value=\"\" selected='selected'>Please select</option>\n <option *ngFor=\"let siteID of siteIDList;\" value=\"{{siteID.siteId}}\">{{siteID.siteName}} ({{siteID.siteId}})</option>\n </select>\n <p class=\"inline-error-message\" *ngIf=\"isResponsibleOfficeEmpty || responsibleOfficeHasError\">\n <span *ngIf=\"isResponsibleOfficeEmpty\">Please select Receiving Site ID</span>\n <span *ngIf=\"responsibleOfficeHasError\">Please select a valid Receiving Site ID</span>\n </p>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" [disabled]=\"isContinueButtondisabled\" class=\"button\" (click)=\"saveAndContinue()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments('cancel')\">\n Cancel\n </button>\n </div>\n </form>\n \n</div>\n <ng-container *ngIf=\"viewStatus === 'unsolicitedContinueConfirm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n <h1 class=\"heading-small\"> Are you sure you want to mark this payment as transferred? </h1>\n </strong>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='TRANSFERREDCONFIRMATION'>\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Reason</td>\n <td class=\"govuk-table__header\" scope=\"col\">Receiving site ID</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{reason}}</td>\n <td class=\"govuk-table__cell\">{{selectedSiteName}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" [disabled]=\"isConfirmButtondisabled\" (click)=\"confirmPayments()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments()\">\n Cancel\n </button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'unsolicitedCancelConfirm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CANCELTRANSFERRED'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to cancel?\n </strong>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"gotoCasetransationPage()\">\n Yes\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments()\">\n No\n </button>\n </div>\n </ng-container>\n</div>`,\n styles: [`.mkpay-unidentified{margin:10px 0 20px}.mkpay-unidentified .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.mkpay-unidentified .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.mkpay-unidentified .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.custom-govuk-label,.govuk-warning-text__text{font-size:19px}#responsibleOffice{color:#000;width:75%;font-weight:#fff}select option{background:#fff}`]\n})\nexport class MarkUnsolicitedPaymentComponent implements OnInit {\n markPaymentUnsolicitedForm: FormGroup;\n viewStatus: string;\n reasonHasError: boolean = false;\n isReasonEmpty: boolean = false;\n reasonMinHasError: boolean = false;\n reasonMaxHasError: boolean = false;\n responsibleOfficeHasError: boolean = false;\n isResponsibleOfficeEmpty: boolean = false;\n errorMessage = this.getErrorMessage(false);\n ccdCaseNumber: string;\n bspaymentdcn: string;\n unassignedRecord: IBSPayments;\n siteID: string = null;\n reason: string;\n responsiblePerson: string;\n responsibleOffice: string;\n emailId: string;\n isConfirmButtondisabled: Boolean = false;\n isContinueButtondisabled: Boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n selectedSiteId: string;\n selectedSiteName: string;\n isStrategicFixEnable: boolean = true;\n siteIDList;\n\n constructor(private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.resetForm([false,false,false,false,false,false], 'all');\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.getUnassignedPayment();\n\n this.paymentViewService.getSiteID().subscribe(\n siteids => {\n this.isContinueButtondisabled = false;\n this.errorMessage = this.getErrorMessage(false);\n this.siteIDList = JSON.parse(siteids);\n },\n err => {\n window.scrollTo(0, 0);\n this.isContinueButtondisabled = true;\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n \n this.markPaymentUnsolicitedForm = this.formBuilder.group({\n reason: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ])),\n responsibleOffice: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9\\\\s\\\\n,\\\\.-:]*)$')\n ])),\n responsiblePerson: new FormControl(''),\n emailId: new FormControl('')\n });\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n confirmPayments() {\n this.isConfirmButtondisabled = true;\n const controls = this.markPaymentUnsolicitedForm.controls;\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n allocation_status:'Transferred',\n payment_allocation_status: {\n description: '',\n name: 'Transferred'\n },\n unidentified_reason: controls.reason.value,\n receiving_office: this.selectedSiteId,\n user_id: this.siteID,\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSWoPGStrategic(postStrategicBody).subscribe(\n res => {\n this.errorMessage = this.getErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n });\n } else {\n // controls.responsibleOffice.setValue('P219');\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.getErrorMessage(false);\n const response1 = JSON.parse(res1),\n requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference)\n this.paymentViewService.postBSPayments(requestBody).subscribe(\n res2 => {\n this.errorMessage = this.getErrorMessage(false);\n const response2 = JSON.parse(res2),\n reqBody = new UnsolicitedPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, controls.reason.value, this.selectedSiteId, controls.responsiblePerson.value, controls.emailId.value);\n if (response2.success) {\n this.paymentViewService.postBSUnsolicitedPayments(reqBody).subscribe(\n res3 => {\n this.errorMessage = this.getErrorMessage(false);\n const response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n }\n saveAndContinue() {\n this.resetForm([false,false,false,false,false,false], 'all');\n const formerror = this.markPaymentUnsolicitedForm.controls.reason.errors;\n const reasonField = this.markPaymentUnsolicitedForm.controls.reason;\n //const officeIdField = this.selectedSiteId;\n const officeIdField = this.markPaymentUnsolicitedForm.controls.responsibleOffice;\n if (this.markPaymentUnsolicitedForm.dirty && this.markPaymentUnsolicitedForm.valid) {\n const controls = this.markPaymentUnsolicitedForm.controls;\n this.emailId = controls.emailId.value;\n this.responsibleOffice = officeIdField.value;\n this.responsiblePerson = controls.responsiblePerson.value;\n this.reason = controls.reason.value;\n this.viewStatus = 'unsolicitedContinueConfirm';\n }else {\n if( reasonField.value == '' ) {\n this.resetForm([true,false,false,false,false,false], 'reason');\n }\n if(reasonField.value != '' && this.markPaymentUnsolicitedForm.controls.reason.invalid ) {\n this.resetForm([false,true,false,false,false,false], 'reason');\n }\n if(formerror && formerror.minlength && formerror.minlength.actualLength < 3 ) {\n this.resetForm([false,false,true,false,false,false], 'reason');\n }\n if(formerror && formerror.maxlength && formerror.maxlength.actualLength > 255 ) {\n this.resetForm([false,false,false,true,false,false], 'reason');\n }\n if(officeIdField.value == '') {\n this.resetForm([false,false,false,false,true,false], 'responsibleOffice');\n }\n if(officeIdField.value != '' && officeIdField.invalid) {\n this.resetForm([false,false,false,false,false,true],'responsibleOffice');\n }\n }\n }\n resetForm(val, field) {\n if(field==='reason' || field==='all') {\n this.isReasonEmpty = val[0];\n this.reasonHasError = val[1];\n this.reasonMinHasError = val[2];\n this.reasonMaxHasError = val[3];\n }\n if(field==='responsibleOffice' || field==='all') {\n this.isResponsibleOfficeEmpty = val[4];\n this.responsibleOfficeHasError = val[5];\n }\n }\n\ncancelMarkUnsolicitedPayments(type?:string){\n if(type && type === 'cancel') {\n if(this.checkingFormValue()){\n this.viewStatus = 'unsolicitedCancelConfirm';\n } else {\n this.gotoCasetransationPage();\n }\n } else {\n this.markPaymentUnsolicitedForm.controls.responsibleOffice.setValue('');\n this.viewStatus = 'mainForm';\n }\n }\n checkingFormValue(){\n const formFields = this.markPaymentUnsolicitedForm.value;\n let valueExists = false;\n\n for (var field in formFields) {\n if (formFields.hasOwnProperty(field) && formFields[field] !==\"\") {\n valueExists = true;\n break;\n }\n }\n return valueExists;\n }\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n \n this.unassignedRecord = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n }\n\n getErrorMessage(isErrorExist) {\n return {\n title: \"Something went wrong.\",\n body: \"Please try again later.\",\n showError: isErrorExist\n };\n }\n\n selectchange(args){ \n this.selectedSiteId = args.target.value; \n this.selectedSiteName = args.target.options[args.target.selectedIndex].text; \n } \n\n}\n","import { Component, OnInit, Output,Input, EventEmitter } from '@angular/core';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'ccpay-app-unprocessed-payments',\n template: `<div class=\"unprocessed-payments govuk-grid-column-full govuk-!-padding-bottom-3\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CASETRANSACTION'>\n <h3 class=\"heading-medium\" *ngIf=\"!IS_BUTTON_ENABLE\">Unprocessed payments</h3>\n <h3 class=\"heading-medium\" *ngIf=\"IS_BUTTON_ENABLE\">Unallocated payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\" *ngIf=\"IS_BUTTON_ENABLE && !isTurnOff\">Select</td>\n <td class=\"govuk-table__header\" scope=\"col\" *ngIf=\"IS_BUTTON_ENABLE && isTurnOff\"><a href=\"#\" (click)=\"unprocessedPaymentUnSelectEvent($event)\">Unselect</a></td>\n\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let unassignedRecord of unassignedRecordList; let i of index;\">\n <td class=\"govuk-table__cell\" *ngIf=\"IS_BUTTON_ENABLE\">\n <div class=\"multiple-choice unprocessed-payments--radio-button\">\n <input id=\"'unpaiedFee'+i+''\"\n aria-label=\"unassignedRecord\"\n name=\"unassignedRecord\"\n type=\"radio\"\n [(ngModel)]=\"recordId\"\n (click)=\"unprocessedPaymentSelectEvent(unassignedRecord.dcn_reference)\"\n value=\"{{unassignedRecord.dcn_reference}}\" />\n <label for=\"radio-inline-1\"></label>\n </div>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">\n {{unassignedRecord.dcn_reference}}\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell whitespace-inherit\"> {{ trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"upPaymentErrorMessage !== null\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No unallocated payments record available</td>\n </tbody>\n </table>\n <div class=\"button-grb\" *ngIf=\"IS_BUTTON_ENABLE && !isTurnOff\">\n <button type=\"button\"\n [disabled]=\"!isAllocatedToNewFeebtnEnabled\"\n [ngClass]=\"!isAllocatedToNewFeebtnEnabled ? 'button govuk-button--secondary button--disabled govuk-!-margin-right-1' : 'button govuk-button--secondary govuk-!-margin-right-1'\" (click)=\"redirectToFeeSearchPage($event)\">\n Allocate to a new fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isAllocateToExistingFeebtnEnabled\"\n [ngClass]='!isAllocateToExistingFeebtnEnabled ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"goToAllocatePage()\">\n Allocate to an existing fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isMarkAsUnidentifiedbtnEnabled\"\n [ngClass]='!isMarkAsUnidentifiedbtnEnabled ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unidentifiedPage')\">\n Mark as unidentified\n </button>\n <button type=\"button\" \n [disabled]=\"!isUnprocessedRecordSelected\"\n [ngClass]='!isUnprocessedRecordSelected ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unsolicitedPage')\">\n Mark as transferred\n </button> \n </div>\n\n <div class=\"button-grb\" *ngIf=\"IS_BUTTON_ENABLE && isTurnOff\">\n <button type=\"button\"\n [disabled]=\"!isAllocatedToNewFeebtnEnabled\"\n [ngClass]=\"!isAllocatedToNewFeebtnEnabled ? 'button button--disabled govuk-!-margin-right-1' : 'button govuk-!-margin-right-1'\" (click)=\"redirectToFeeSearchPage($event)\">\n Allocate to a new fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isAllocateToExistingFeebtnEnabled\"\n [ngClass]='!isAllocateToExistingFeebtnEnabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"goToAllocatePage()\">\n Allocate to an existing fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isMarkAsUnidentifiedbtnEnabled\"\n [ngClass]='!isMarkAsUnidentifiedbtnEnabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unidentifiedPage')\">\n Mark as unidentified\n </button>\n <button type=\"button\" \n [disabled]=\"!isUnprocessedRecordSelected\"\n [ngClass]='!isUnprocessedRecordSelected ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unsolicitedPage')\">\n Mark as transferred\n </button> \n </div>\n</div>\n\n`,\n styles: [`.unprocessed-payments .unprocessed-payments--radio-button{bottom:10px}.disable{text-decoration:none;padding:.526315em .789473em .263157em;cursor:default;color:#fff;background-color:#00823b;pointer-events:none;font-size:1em;line-height:1.25;outline:transparent solid 1px;outline-offset:-1px;-webkit-appearance:none;box-shadow:0 2px 0 #003618}.button.disabled,.button[disabled=disabled],.button[disabled]{zoom:1;opacity:.5}.button.disabled:active,.button[disabled=disabled]:active,.button[disabled]:active{top:0;box-shadow:0 2px 0 #003618}.button[disabled=disabled]{background:#00823b}.lowercase{text-transform:lowercase}.capitalize::first-letter{text-transform:uppercase}.whitespace-inherit{white-space:inherit!important}`]\n})\nexport class UnprocessedPaymentsComponent implements OnInit {\n\n @Input('FEE_RECORDS_EXISTS') FEE_RECORDS_EXISTS: boolean;\n @Input('PAYMENTREF') PAYMENTREF: string;\n @Input('ISTURNOFF') ISTURNOFF: boolean;\n @Input('IS_BUTTON_ENABLE') IS_BUTTON_ENABLE: boolean;\n @Input('IS_OS_AMT_AVAILABLE') IS_OS_AMT_AVAILABLE: boolean;\n @Input('ISSFENABLE') ISSFENABLE: boolean;\n\n @Output() selectedUnprocessedFeeEvent: EventEmitter<string> = new EventEmitter();\n @Output() getUnprocessedFeeCount: EventEmitter<string> = new EventEmitter();\n\n viewStatus = 'main';\n unassignedRecordList: IBSPayments;\n upPaymentErrorMessage: string = null;\n ccdCaseNumber: string;\n recordId: string = null;\n isRecordExist: boolean = false;\n dcnNumber: string = null;\n selectedOption: string;\n isUnprocessedRecordSelected: boolean = false;\n isAllocateToExistingFeebtnEnabled: boolean = false;\n isMarkAsUnidentifiedbtnEnabled: boolean = false;\n isAllocatedToNewFeebtnEnabled: boolean = false;\n isExceptionCase: boolean = false;\n serviceId: string = null;\n isBulkScanEnable;\n isTurnOff: boolean = true;\n isStFixEnable;\n\n constructor(private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n // Todo ...\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.isBulkScanEnable = this.paymentLibComponent.ISBSENABLE;\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n this.isStFixEnable = this.paymentLibComponent.ISSFENABLE;\n\n this.getUnassignedPaymentlist();\n }\n\n getUnassignedPaymentlist() {\n if (this.selectedOption === 'dcn') {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.dcnNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'] && unassignedPayments['data'].payments) {\n this.setValuesForUnassignedRecord(unassignedPayments['data']);\n } else if(unassignedPayments['payments']) {\n this.setValuesForUnassignedRecord(unassignedPayments);\n } else {\n this.upPaymentErrorMessage = 'error';\n this.getUnprocessedFeeCount.emit('0');\n }\n },\n (error: any) => {\n this.upPaymentErrorMessage = error;\n this.getUnprocessedFeeCount.emit('0');\n }\n );\n } else {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'] && unassignedPayments['data'].payments) {\n this.setValuesForUnassignedRecord(unassignedPayments['data']);\n } else if(unassignedPayments['payments']) {\n this.setValuesForUnassignedRecord(unassignedPayments);\n } else {\n this.upPaymentErrorMessage = 'error';\n this.getUnprocessedFeeCount.emit('0');\n }\n },\n (error: any) => {\n this.upPaymentErrorMessage = error;\n this.getUnprocessedFeeCount.emit('0');\n }\n );\n }\n\n }\n setValuesForUnassignedRecord(unassignedPayments) {\n this.unassignedRecordList = unassignedPayments.payments;\n this.serviceId = unassignedPayments.responsible_service_id;\n if (unassignedPayments['ccd_reference'] === undefined) {\n this.isExceptionCase = true;\n }\n this.isRecordExist = this.unassignedRecordList.length === 0;\n this.getUnprocessedFeeCount.emit(<any>this.unassignedRecordList.length);\n }\n formatUnassignedRecordId(ID: Number) {\n return `unassignrecord-${ID}`;\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n redirectToFeeSearchPage(event: any) {\n event.preventDefault();\n let url = this.isBulkScanEnable ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n url += this.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n url += this.isStFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n\n this.router.navigateByUrl(`/fee-search?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}&dcn=${this.recordId}${url}`);\n }\n loadUnsolicitedPage(viewName: string) {\n this.paymentLibComponent.bspaymentdcn = this.recordId;\n this.paymentLibComponent.viewName = viewName;\n }\n unprocessedPaymentSelectEvent(selectedRecordReference: any) {\n this.isUnprocessedRecordSelected = true;\n this.validateButtons();\n this.selectedUnprocessedFeeEvent.emit(selectedRecordReference);\n }\n goToAllocatePage() {\n this.paymentLibComponent.bspaymentdcn = this.recordId;\n this.paymentLibComponent.unProcessedPaymentServiceId = this.serviceId\n this.paymentLibComponent.isTurnOff = this.ISTURNOFF;\n this.paymentLibComponent.ISSFENABLE = this.isStFixEnable;\n\n if(!this.ISTURNOFF) {\n this.paymentLibComponent.paymentGroupReference = this.PAYMENTREF;\n this.paymentLibComponent.viewName = 'fee-summary';\n }else {\n this.paymentLibComponent.paymentGroupReference = null;\n this.paymentLibComponent.viewName = 'allocate-payments';\n }\n\n }\n\n validateButtons() {\n if ( this.isUnprocessedRecordSelected && this.isExceptionCase) {\n this.isMarkAsUnidentifiedbtnEnabled = true;\n } else if ( this.isUnprocessedRecordSelected && !this.isExceptionCase && !this.FEE_RECORDS_EXISTS) {\n this.isAllocateToExistingFeebtnEnabled = false;\n this.isAllocatedToNewFeebtnEnabled = true;\n } else if( this.isUnprocessedRecordSelected && !this.isExceptionCase && this.FEE_RECORDS_EXISTS ) {\n if(!this.ISTURNOFF) {\n this.isAllocateToExistingFeebtnEnabled = true;\n this.isAllocatedToNewFeebtnEnabled = false;\n } else {\n this.isAllocateToExistingFeebtnEnabled = this.IS_OS_AMT_AVAILABLE;\n this.isAllocatedToNewFeebtnEnabled = true;\n }\n }\n }\n unprocessedPaymentUnSelectEvent(event: any) {\n event.preventDefault();\n this.recordId = null;\n this.isUnprocessedRecordSelected = false;\n this.isAllocateToExistingFeebtnEnabled = false;\n this.isAllocatedToNewFeebtnEnabled = false;\n this.isMarkAsUnidentifiedbtnEnabled = false;\n //this.validateButtons();\n this.selectedUnprocessedFeeEvent.emit('');\n }\n\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport {IPayment} from '../../interfaces/IPayment';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'ccpay-app-processed-payments',\n template: `<div class=\"processed-payments govuk-grid-column-full govuk-!-padding-bottom-3\">\n <h3 class=\"heading-medium\">Processed payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let processedRecord of NONPAYMENTS\">\n <td class=\"govuk-table__cell\">\n <a href=\"javascript:void(0)\" (click)=\"redirectToPaymentViewPage(processedRecord.paymentGroupReference, processedRecord.reference, processedRecord.method)\">{{processedRecord.document_control_number}}</a>\n </td>\n <td class=\"govuk-table__cell\"> {{processedRecord.banked_date | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{processedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{ trimUnderscore(processedRecord.method) | lowercase}} </td>\n <td class=\"capitalize govuk-table__cell\"> {{ processedRecord.payment_allocation[0] ? processedRecord.payment_allocation[0].allocation_status : '-' }} </td>\n\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"NONPAYMENTS.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">\n No processed payments\n </td>\n\n </tr>\n\n </tbody>\n </table>\n</div>\n`,\n styles: [`.lowercase{text-transform:lowercase}.capitalize::first-letter{text-transform:uppercase}`]\n})\nexport class ProcessedPaymentsComponent implements OnInit {\n\n @Input('NONPAYMENTS') NONPAYMENTS: IPayment[];\n @Output() goToPaymentViewComponent: EventEmitter<any> = new EventEmitter();\n\n constructor(\n private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService\n ) { }\n ngOnInit() {\n }\n\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n redirectToPaymentViewPage(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.goToPaymentViewComponent.emit({paymentGroupReference, paymentReference, paymentMethod});\n }\n}\n","\nexport class IAllocationPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n reason: string;\n explanation: string;\n user_name: string;\n constructor(payment_group_reference: string, payment_reference : string, reason? : string, explanation? : string, userName? : string) {\n this.payment_allocation_status = {\n description: '',\n name: \"Allocated\"\n };\n this.payment_group_reference = payment_group_reference;\n this.payment_reference= payment_reference;\n this.reason = reason ? reason : null;\n this.explanation = explanation ? explanation : null;\n this.user_name = userName ? userName : null;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {CaseTransactionsService} from '../../services/case-transactions/case-transactions.service'; \nimport {BulkScaningPaymentService} from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {IBSPayments} from '../../interfaces/IBSPayments';\nimport {AllocatePaymentRequest} from '../../interfaces/AllocatePaymentRequest';\nimport {IAllocationPaymentsRequest} from '../../interfaces/IAllocationPaymentsRequest';\n\n@Component({\n selector: 'app-allocate-payments',\n template: `<div class=\"allocate-payments\">\n <div *ngIf=\"viewStatus==='mainForm' && isTurnOff\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ALLOCATEPAYMENTS'>\n <div class=\"govuk-breadcrumbs\" *ngIf=\"paymentRef\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a href=\"#\" (click)=\"gotoSummaryPage($event)\" class=\"govuk-back-link\">Back</a>\n </li>\n </ol>\n </div>\n <div class=\"govuk-heading-section\">\n <h1 class=\"govuk-heading-xl\">Allocate payment to fee group</h1>\n <h2 class=\"govuk-heading-l\">Amount left to be allocated:\n {{ unAllocatedPayment.amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</h2>\n </div>\n <div class=\"payment-group-section\" *ngFor=\"let paymentGroup of paymentGroups\">\n <h3 class=\"govuk-heading-m\">Group reference: {{paymentGroup.payment_group_reference}}</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\"></td>\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1 govuk-table__custom--col1\"\n [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n <div class=\"multiple-choice\">\n <input id=\"unpaiedFee-{{i}}\" name=\"unassignedRecord\" type=\"radio\"\n (click)=\"selectedPaymentGroup(paymentGroup)\" />\n <label for=\"unpaiedFee-{{i}}\"></label>\n </div>\n </td>\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\">\n {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\">\n {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6 govuk-table__custom--col6\"\n [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n {{getGroupOutstandingAmount(paymentGroup) | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n\n </tr>\n\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length==0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-button-group-allocate\">\n <button type=\"button\" class=\"button govuk-!-margin-right-1\" [disabled]=\"isContinueButtondisabled\"\n (click)=\"saveAndContinue()\">\n Continue\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"gotoCasetransationPage()\">\n Cancel\n </button>\n </div>\n </div>\n\n <ng-container *ngIf=\"(viewStatus === 'mainForm' && !isTurnOff) || viewStatus === 'allocatePaymentConfirmation'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='{{feedbackUrlLabel}}'>\n <h1 class=\"govuk-heading-xl\">Confirm association</h1>\n <h2 class=\"govuk-heading-l govuk-heading-l--custom\">\n Amount to be allocated: {{amountForAllocation | currency:'GBP':'symbol-narrow':'1.2-2'}}\n </h2>\n <div class=\"payment-group-section\" *ngIf=\"paymentGroup\">\n <h3 class=\"govuk-heading-m--custom\" *ngIf=\"isTurnOff\">Group reference: {{paymentGroup.payment_group_reference}}\n </h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount Due</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\">\n {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\">\n {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6\" [attr.rowspan]=\"paymentGroup.fees.length\"\n *ngIf=\"i==0\"> {{afterFeeAllocateOutstanding | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length == 0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"isRemainingAmountGtZero || isRemainingAmountLtZero || remainingAmount === 0\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text govuk-warning-text__custom\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n {{paymentSectionLabel.title}} {{ remainingAmount | currency:'GBP':'symbol-narrow':'1.2-2' }}\n </strong>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"isRemainingAmountGtZero || isRemainingAmountLtZero\">\n <div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"how-contacted-conditional-hint\">\n <span id=\"how-contacted-conditional-hint\" class=\"govuk-hint\"\n [ngClass]=\"{'inline-error-message': paymentReasonHasError}\">\n {{paymentSectionLabel.reason}}\n </span>\n <div\n [ngClass]=\"paymentReasonHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountGtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let reason of reasonList.overPayment | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{reason.key}}\" name=\"paymentReason\" type=\"radio\"\n [(ngModel)]=\"paymentReason\" value={{reason.value}}>\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{reason.value}}\n </label>\n </div>\n </div>\n <div\n [ngClass]=\"paymentReasonHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountLtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let reason of reasonList.shortFall | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{reason.key}}\" name=\"paymentReason\" type=\"radio\"\n [(ngModel)]=\"paymentReason\" value={{reason.value}}>\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{reason.value}}\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n <div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"how-contacted-conditional-hint\">\n <span id=\"how-contacted-conditional-hint\" class=\"govuk-hint\"\n [ngClass]=\"{'inline-error-message': paymentExplanationHasError}\">\n Provide an explanatory note\n </span>\n <div\n [ngClass]=\"paymentExplanationHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountGtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let explanation of explanationList.overPayment | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{explanation.key}}\" name=\"paymentExplanation\" type=\"radio\"\n [(ngModel)]=\"paymentExplanation\" value={{explanation.value}}\n (click)=\"selectRadioButton(explanation.key, 'explanation')\">\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{explanation.value}}\n </label>\n </div>\n </div>\n\n <div\n [ngClass]=\"paymentExplanationHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountLtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let explanation of explanationList.shortFall | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{explanation.key}}\" name=\"paymentExplanation\" type=\"radio\"\n [(ngModel)]=\"paymentExplanation\" value={{explanation.value}}\n (click)=\"selectRadioButton(explanation.key, 'explanation')\">\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{explanation.value}}\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n\n <form [formGroup]=\"overUnderPaymentForm\" novalidate>\n <div\n [ngClass]=\"isMoreDetailsBoxHide ? 'govuk-radios__conditional govuk-radios__conditional--hidden' : isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError ? 'govuk-radios__conditional inline-error-border' : 'govuk-radios__conditional'\"\n id=\"conditional-how-contacted-conditional-3\">\n <div class=\"govuk-form-group\">\n <span id=\"more-detail-hint\" class=\"govuk-hint govuk-font__custom\">\n Please enter details\n </span>\n <textarea class=\"govuk-textarea\"\n [ngClass]=\"{'inline-error-class': isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError}\"\n id=\"moreDetails\" name=\"moreDetails\" rows=\"5\" formControlName=\"moreDetails\">\n </textarea>\n <p class=\"inline-error-message\"\n *ngIf=\"isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError\">\n <span *ngIf=\"isPaymentDetailsEmpty\">Enter a explanation</span>\n <span *ngIf=\"isPaymentDetailsInvalid\">Enter a valid explanation</span>\n <span *ngIf=\"paymentDetailsMinHasError\">Explanation should be at least 3 characters.</span>\n <span *ngIf=\"paymentDetailsMaxHasError\">Explanation should be 255 characters or under.</span>\n </p>\n </div>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"isRemainingAmountGtZero || isRemainingAmountLtZero\">\n <label class=\"govuk-label govuk-font__custom\" for=\"userName\">\n Enter your name\n </label>\n <input class=\"govuk-input\" id=\"userName\" name=\"userName\" type=\"text\"\n [ngClass]=\"{'inline-error-class': isUserNameEmpty || isUserNameInvalid}\" formControlName=\"userName\">\n <p class=\"inline-error-message\" *ngIf=\"isUserNameEmpty || isUserNameInvalid\">\n <span *ngIf=\"isUserNameEmpty\">Enter your name.</span>\n <span *ngIf=\"isUserNameInvalid\">Enter a valid name</span>\n </p>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" [disabled]=\"isConfirmButtondisabled\"\n [ngClass]=\"isConfirmButtondisabled ? 'button button--disabled' : 'button'\"\n (click)=\"confirmAllocatePayement()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelAllocatePayment($event)\">\n Cancel\n </button>\n </div>\n </form>\n </ng-container>\n</div>`,\n styles: [`.allocate-payments{margin:20px 0}.allocate-payments .govuk-table__cell--col1,.allocate-payments .govuk-table__cell--col3{width:10%}.allocate-payments .govuk-table__cell--col2,.allocate-payments .govuk-table__cell--col6{width:25%}.allocate-payments .govuk-table__cell--col4,.allocate-payments .govuk-table__cell--col5{width:15%}.allocate-payments .govuk-button-group-allocate{display:flex;justify-content:flex-start}.allocate-payments .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.allocate-payments .govuk-custom-warning__message{font-size:30px;position:relative;top:12px;font-weight:700}.allocate-payments .govuk-warning-text-custom{margin-bottom:0!important;padding:10px 0 5px}.allocate-payments .govuk-table__custom--col1{padding-top:0;padding-bottom:20px;padding-left:15px}.allocate-payments .govuk-table__custom--col6{text-align:center}.allocate-payments .govuk-list__custom{padding-left:20px}.allocate-payments .govuk-font__custom,.allocate-payments .govuk-heading-m--custom,.allocate-payments .govuk-hint,.allocate-payments .govuk-label--m,.allocate-payments .govuk-list__custom,.allocate-payments .govuk-radios__item,.allocate-payments .govuk-warning-text__custom{font-size:19px}.allocate-payments .govuk-radios__conditional--hidden{display:none}.allocate-payments .form-group-error{border-left:5px solid #b10e1e;padding-left:15px}.allocate-payments .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.allocate-payments .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.allocate-payments .inline-error-border{border-color:#a71414}`]\n})\nexport class AllocatePaymentsComponent implements OnInit {\n @Input() isTurnOff: boolean;\n overUnderPaymentForm: FormGroup;\n viewStatus: string;\n ccdCaseNumber: string;\n bspaymentdcn: string;\n feedbackUrlLabel:string;\n unAllocatedPayment: IBSPayments = {\n amount: 0\n };\n siteID: string = null;\n errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n paymentGroup: IPaymentGroup;\n paymentGroups: IPaymentGroup[] = [];\t\n remainingAmount: number;\n isRemainingAmountGtZero: boolean;\n isMoreDetailsBoxHide: boolean = true;\n isRemainingAmountLtZero: boolean;\n afterFeeAllocateOutstanding: number;\n amountForAllocation: number;\n isConfirmButtondisabled: boolean = false;\n isContinueButtondisabled: boolean = true;\n otherPaymentExplanation: string = null;\n selectedOption: string = null;\n isFeeAmountZero: boolean = false;\t\n\n paymentReasonHasError: boolean = false;\n paymentExplanationHasError: boolean = false;\n isPaymentDetailsEmpty: boolean = false;\n isPaymentDetailsInvalid: boolean = false;\n paymentDetailsMinHasError: boolean = false;\n paymentDetailsMaxHasError: boolean = false;\n isUserNameEmpty: boolean = false;\n isUserNameInvalid: boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n paymentReason: string = null;\n paymentExplanation: string = null;\n userName: string = null;\n paymentSectionLabel: any;\n paymentRef: string = null;\n isStrategicFixEnable: boolean = true;\n\n reasonList: { [key: string]: { [key: string]: string } }= {\n overPayment: {\n hwfReward: 'Help with Fees (HWF) awarded. Please include the HWF reference number in the explanatory note',\n wrongFee: 'Incorrect payment received',\n notIssueCase: 'Unable to issue case',\n otherDeduction: 'Other'\n },\n shortFall: {\n helpWithFee: 'Help with Fees (HWF) application declined',\n wrongFee: 'Incorrect payment received',\n other: 'Other'\n }\n }\n explanationList = {\n overPayment: {\n referRefund: 'Details in case notes. Refund due',\n noRefund: 'Details in case notes. No refund due',\n noCase: 'No case created. Refund due',\n other: 'Other'\n },\n shortFall: {\n holdCase: 'I have put a stop on the case and contacted the applicant requesting the balance of payment',\n heldCase: 'I have put a stop on the case. The applicant needs to be contacted to request the balance of payment',\n other: 'Other'\n }\n }\n\n\n constructor(\n private errorHandlerService: ErrorHandlerService,\n private caseTransactionsService: CaseTransactionsService,\n private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.paymentRef = this.paymentLibComponent.paymentGroupReference;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.isTurnOff = this.paymentLibComponent.isTurnOff;\n this.overUnderPaymentForm = this.formBuilder.group({\n moreDetails: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ])),\n userName: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9\\\\s]*)$')\n ])),\n });\n this.getUnassignedPayment();\n }\n getGroupOutstandingAmount(paymentGroup: IPaymentGroup): number {\n return this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);\n }\n\n getPaymentGroupDetails(){\n\n if(!this.isTurnOff){\n this.paymentViewService.getPaymentGroupDetails(this.paymentRef).subscribe(\n paymentGroup => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.paymentGroup = paymentGroup;\n this.saveAndContinue();\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }else {\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.paymentGroups = paymentGroups['payment_groups'].filter(paymentGroup => {\n paymentGroup.fees.forEach(fee => {\n if(fee.calculated_amount === 0) {\n this.isFeeAmountZero = true\n }\n });\n let fstCon = this.getGroupOutstandingAmount(<IPaymentGroup>paymentGroup),\n scndCn = fstCon > 0 || (fstCon == 0 && this.isFeeAmountZero) && paymentGroup.payment_group_reference === this.paymentRef;\n return this.paymentRef ? scndCn : fstCon > 0 || (fstCon == 0 && this.isFeeAmountZero);\n });\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }\n\n }\n\n selectedPaymentGroup(paymentGroup: IPaymentGroup) {\t\n this.isContinueButtondisabled = false;\t\n this.paymentGroup = paymentGroup;\t\n }\t\n\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n\n gotoSummaryPage(event: any) { \n event.preventDefault();\n this.paymentLibComponent.viewName = 'fee-summary';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n\n cancelAllocatePayment(event: any){\n event.preventDefault();\n this.resetForm([false, false, false, false, false, false, false, false], 'all');\n if(!this.isTurnOff){\n this.paymentLibComponent.viewName = 'fee-summary';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n } else {\n this.viewStatus = 'mainForm';\t\n }\n }\n confirmAllocatePayement(){\n const paymentDetailsField = this.overUnderPaymentForm.controls.moreDetails,\n paymentFormError = this.overUnderPaymentForm.controls.moreDetails.errors,\n userNameField = this.overUnderPaymentForm.controls.userName,\n isEmptyCondtion = this.paymentReason && this.paymentExplanation,\n isOtherOptionSelected = this.paymentExplanation === 'Other';\n\n this.resetForm([false, false, false, false, false, false, false, false], 'all');\n if ( (!this.isRemainingAmountGtZero && !this.isRemainingAmountLtZero) || isEmptyCondtion && (!isOtherOptionSelected && userNameField.valid || isOtherOptionSelected && userNameField.valid && paymentDetailsField.valid)) {\n this.isConfirmButtondisabled = true;\n this.otherPaymentExplanation = this.paymentExplanation === 'Other' ? paymentDetailsField.value : this.paymentExplanation;\n this.userName = userNameField.value;\n this.finalServiceCall();\n }else {\n if(!this.paymentReason) {\n this.resetForm([true, false, false, false, false, false, false, false], 'reason');\n }\n if(!this.paymentExplanation) {\n this.resetForm([false, true, false, false, false, false, false, false], 'explanation');\n }\n if(this.paymentExplanation && isOtherOptionSelected) {\n if(paymentDetailsField.value == '' ) {\n this.resetForm([false, false, true, false, false, false, false, false], 'other');\n }\n if(paymentDetailsField.value != '' && paymentDetailsField.invalid ) {\n this.resetForm([false, false, false, true, false, false, false, false], 'other');\n }\n if(paymentFormError && paymentFormError.minlength && paymentFormError.minlength.actualLength < 3 ) {\n this.resetForm([false, false, false, false, true, false, false, false], 'other');\n }\n if(paymentFormError && paymentFormError.maxlength && paymentFormError.maxlength.actualLength > 255 ) {\n this.resetForm([false, false, false, false, false, true, false, false], 'other');\n }\n }\n if(userNameField.value === \"\") {\n this.resetForm([false, false, false, false, false, false, true, false], 'username');\n }\n if(userNameField.value !== \"\" && userNameField.invalid) {\n this.resetForm([false, false, false, false, false, false, false, true], 'username');\n }\n }\n }\n resetForm(vals, field) {\n if(field==='reason' || field==='all') {\n this.paymentReasonHasError = vals[0];\n }\n if(field==='explanation' || field==='all') {\n this.paymentExplanationHasError = vals[1];\n }\n if(field==='other' || field==='all') {\n this.isPaymentDetailsEmpty = vals[2];\n this.isPaymentDetailsInvalid = vals[3];\n this.paymentDetailsMinHasError = vals[4];\n this.paymentDetailsMaxHasError = vals[5];\n }\n if(field==='username' || field==='all') {\n this.isUserNameEmpty = vals[6];\n this.isUserNameInvalid = vals[7];\n }\n }\n finalServiceCall() {\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n reason: this.paymentReason,\n allocation_status:'Allocated',\n explanation: this.otherPaymentExplanation,\n payment_allocation_status: {\n description: '',\n name: 'Allocated'\n },\n payment_group_reference: this.paymentGroup.payment_group_reference,\n user_id: this.siteID,\n user_name: this.userName\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unAllocatedPayment, this.siteID, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSPaymentStrategic(postStrategicBody , this.paymentGroup.payment_group_reference).subscribe(\n res => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n });\n\n } else {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response1 = JSON.parse(res1);\n if (response1.success) {\n const requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unAllocatedPayment, this.siteID, this.exceptionReference);\n this.bulkScaningPaymentService.postBSAllocatePayment(requestBody, this.paymentGroup.payment_group_reference).subscribe(\n res2 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response2 = JSON.parse(res2);\n const reqBody = new IAllocationPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, this.paymentReason, this.otherPaymentExplanation, this.userName);\n if (response2.success) {\n this.paymentViewService.postBSAllocationPayments(reqBody).subscribe(\n \n res3 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n ); \n }\n }\n\n saveAndContinue(){\n if(this.paymentGroup) {\n this.isMoreDetailsBoxHide = true;\n this.overUnderPaymentForm.get('moreDetails').reset();\n this.overUnderPaymentForm.get('moreDetails').setValue('');\n this.overUnderPaymentForm.get('userName').reset();\n this.overUnderPaymentForm.get('userName').setValue('');\n this.paymentReason = '';\n this.paymentExplanation = '';\n let GroupOutstandingAmount = this.getGroupOutstandingAmount(this.paymentGroup);\n const remainingToBeAssigned = this.unAllocatedPayment.amount - GroupOutstandingAmount;\n this.isRemainingAmountGtZero = remainingToBeAssigned > 0;\n this.isRemainingAmountLtZero = remainingToBeAssigned < 0;\n this.paymentSectionLabel = this.isRemainingAmountGtZero ? { \n title: 'There is a surplus of',\n reason: 'Provide a reason. This will be used in the Refund process.',\n }: this.isRemainingAmountLtZero ? { \n title: 'There is a shortfall of',\n reason: 'Provide a reason',\n }: { \n title:'Amount left to be allocated',\n reason:'',\n };\n this.feedbackUrlLabel = this.isRemainingAmountGtZero ? 'CONFIRMALLOCATION_SURPLUS' : this.isRemainingAmountLtZero ? 'CONFIRMALLOCATION_SHORTFALL' : 'CONFIRMALLOCATION';\n this.remainingAmount = this.isRemainingAmountGtZero ? remainingToBeAssigned : this.isRemainingAmountLtZero ? remainingToBeAssigned * -1 : 0;\n this.afterFeeAllocateOutstanding = remainingToBeAssigned >= 0 ? 0 : (remainingToBeAssigned * -1);\n this.amountForAllocation = GroupOutstandingAmount >= this.unAllocatedPayment.amount ? this.unAllocatedPayment.amount : GroupOutstandingAmount;\n if(this.isTurnOff){\n this.viewStatus = 'allocatePaymentConfirmation';\t\n }\n }\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.unAllocatedPayment = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n this.getPaymentGroupDetails();\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }\n selectRadioButton(key, type) {\n this.isMoreDetailsBoxHide = true;\n if( type === 'explanation' && key === 'other' ){\n this.isPaymentDetailsEmpty = false;\n this.isPaymentDetailsInvalid = false;\n this.paymentDetailsMinHasError = false;\n this.paymentDetailsMaxHasError = false;\n this.isMoreDetailsBoxHide = false;\n }\n }\n}","import { IFee } from './IFee';\n\nexport class AddRemissionRequest {\n beneficiary_name: string;\n ccd_case_number: string;\n fee: IFee;\n hwf_amount: number;\n hwf_reference: string;\n payment_group_reference: string;\n site_id: string;\n\n constructor(ccd_case_number: string, fee: IFee, hwf_amount: number, hwf_reference: string, service: string) {\n this.ccd_case_number = ccd_case_number;\n this.fee = fee;\n this.hwf_amount = hwf_amount;\n this.hwf_reference = hwf_reference;\n this.site_id = service;\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { IFee } from '../../interfaces/IFee';\nimport {Router} from '@angular/router';\nimport { AddRemissionRequest } from '../../interfaces/AddRemissionRequest';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-add-remission',\n template: `<div class=\"add-remission\">\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Error in processing the request\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"viewStatus === 'main'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ADDREMISSION'>\n <h1 class=\"heading-large\">Add remission</h1>\n <form novalidate>\n <div class=\"govuk-form-group\">\n <form [formGroup]=\"remissionForm\" novalidate>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--s\" for=\"remission-code\">\n Add remission to {{ fee.code }}:{{ fee.description }}\n <span class=\"form-hint\">Enter remission for reference. For example: HWF-A1B-23C</span>\n </label>\n <input [ngClass]=\"{'inline-error-class': isRemissionCodeEmpty || remissionCodeHasError}\" class=\"govuk-input govuk-input--width-20 govuk-!-margin-right-1\" id=\"remissionCode\" aria-label=\"remissionCode\" name=\"remissionCode\" type=\"text\" formControlName=\"remissionCode\">\n <p class=\"inline-error-message\" *ngIf=\"isRemissionCodeEmpty || remissionCodeHasError\">\n <span *ngIf=\"isRemissionCodeEmpty\">Enter a remission code</span>\n <span *ngIf=\"remissionCodeHasError\">Enter a vaild remission code</span>\n </p>\n </div>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--s\" for=\"amount\">\n How much does the applicant need to pay?\n </label>\n\n <div id=\"amount-currency\" class=\"govuk-visually-hidden\">in pounds</div>\n <div class=\"hmcts-currency-input\">\n <div class=\"hmcts-currency-input__symbol\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input govuk-input--width-10\" [ngClass]=\"{'inline-error-class': isAmountEmpty || amountHasError || isRemissionLessThanFeeError}\" id=\"amount\" aria-label=\"amount\" name=\"amount\" type=\"text\" aria-describedby=\"amount-currency\" formControlName=\"amount\">\n <p class=\"inline-error-message\" *ngIf=\"isAmountEmpty || amountHasError || isRemissionLessThanFeeError\">\n <span *ngIf=\"isAmountEmpty\">Enter a amount</span>\n <span *ngIf=\"amountHasError\">Enter a vaild amount</span>\n <span *ngIf=\"isRemissionLessThanFeeError\">The remission amount must be less than the total fee</span>\n </p>\n </div>\n </div>\n </form>\n <button class=\"button\" type=\"submit\" (click)=\"addRemission()\">\n Submit\n </button>\n </div>\n </form>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'confirmation'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ADDREMISSIONCONFIRMATION'> \n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to add remission to this fee?\n </strong>\n </div>\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Remission code:</td>\n <td class=\"govuk-table__cell\">{{ remissionForm.controls.remissionCode.value }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Fee code:</td>\n <td class=\"govuk-table__cell\">{{ fee.code }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Fee description:</td>\n <td class=\"govuk-table__cell\">{{ fee.description }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Amount the applicant must pay:</td>\n <td class=\"govuk-table__cell\">{{ remissionForm.controls.amount.value | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n </tr>\n </table>\n\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemission.emit()\">\n Cancel\n </button>\n <button type=\"submit\"\n [disabled]=\"isConfirmationBtnDisabled\"\n [ngClass]='isConfirmationBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"confirmRemission()\">\n Confirm\n </button>\n\n </ng-container>\n\n</div>\n\n`,\n styles: [`.add-remission .button{margin:20px 2px}.add-remission td.govuk-table__cell{width:50%}.add-remission .govuk-button--secondary{background-color:#dee0e2;box-shadow:0 2px 0 #858688;color:#0b0c0c;margin-right:.5em}.add-remission .govuk-label--s,.add-remission .govuk-warning-text__text,.add-remission .hmcts-currency-input__symbol{font-size:19px}.add-remission .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.add-remission .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}`]\n})\nexport class AddRemissionComponent implements OnInit {\n @Input() fee: IFee;\n @Input() ccdCaseNumber: string;\n @Input() service: string;\n @Input() paymentGroupRef: string;\n @Input() isTurnOff: boolean;\n @Input() isStrategicFixEnable: boolean;\n @Output() cancelRemission: EventEmitter<void> = new EventEmitter();\n\n remissionForm: FormGroup;\n hasErrors = false;\n viewStatus = 'main';\n errorMessage = null;\n option: string = null;\n isConfirmationBtnDisabled: boolean = false;\n bsPaymentDcnNumber: string;\n\n isRemissionCodeEmpty: boolean = false;\n remissionCodeHasError: boolean = false;\n isAmountEmpty: boolean = false;\n amountHasError: boolean = false;\n isRemissionLessThanFeeError: boolean = false;\n\n constructor(private formBuilder: FormBuilder,\n private router: Router,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.option = this.paymentLibComponent.SELECTED_OPTION;\n this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;\n this.remissionForm = this.formBuilder.group({\n remissionCode: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9]{3})-([a-zA-Z0-9]{3})-([a-zA-Z0-9]{3})$')\n ])),\n amount: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^[0-9]+(\\\\.[0-9]{2})?$')\n ]))\n });\n this.viewStatus = 'main';\n }\n\n addRemission() {\n this.resetRemissionForm([false, false, false, false, false], 'All');\n const remissionctrls=this.remissionForm.controls,\n isRemissionLessThanFee = this.fee.calculated_amount > remissionctrls.amount.value; \n if (this.remissionForm.dirty && this.remissionForm.valid && isRemissionLessThanFee) {\n this.viewStatus = 'confirmation';\n }else {\n\n if(remissionctrls['remissionCode'].value == '' ) {\n this.resetRemissionForm([true, false, false, false, false], 'remissionCode');\n }\n if(remissionctrls['remissionCode'].value != '' && remissionctrls['remissionCode'].invalid ) {\n this.resetRemissionForm([false, true, false, false, false], 'remissionCode');\n }\n if(remissionctrls['amount'].value == '' ) {\n this.resetRemissionForm([false, false, true, false, false], 'amount');\n }\n if(remissionctrls['amount'].value != '' && remissionctrls['amount'].invalid ) {\n this.resetRemissionForm([false, true, false, true, false], 'amount');\n }\n if(remissionctrls.amount.valid && !isRemissionLessThanFee){\n this.resetRemissionForm([false, false, false, false, true], 'amount');\n }\n }\n }\n\n resetRemissionForm(val, field){\n if(field==='remissionCode' || field==='All') {\n this.isRemissionCodeEmpty = val[0];\n this.remissionCodeHasError = val[1];\n } else if (field==='amount' || field==='All'){\n this.isAmountEmpty = val[2];\n this.amountHasError = val[3];\n this.isRemissionLessThanFeeError = val[4];\n }\n }\n\n confirmRemission() {\n this.isConfirmationBtnDisabled = true;\n const newNetAmount = this.remissionForm.controls.amount.value,\n remissionAmount = this.fee.net_amount - newNetAmount,\n requestBody = new AddRemissionRequest\n (this.ccdCaseNumber, this.fee, remissionAmount, this.remissionForm.controls.remissionCode.value, this.service);\n this.paymentViewService.postPaymentGroupWithRemissions(decodeURIComponent(this.paymentGroupRef).trim(), this.fee.id, requestBody).subscribe(\n response => {\n if (JSON.parse(response).success) {\n const LDUrl = this.isTurnOff ? '&isTurnOff=Enable' : '&isTurnOff=Disable'\n if (this.paymentLibComponent.bspaymentdcn) {\n this.router.routeReuseStrategy.shouldReuseRoute = () => false;\n this.router.onSameUrlNavigation = 'reload';\n this.router.navigateByUrl(`/payment-history/${this.ccdCaseNumber}?view=fee-summary&selectedOption=${this.option}&paymentGroupRef=${this.paymentGroupRef}&dcn=${this.paymentLibComponent.bspaymentdcn}${LDUrl}`);\n }else {\n this.gotoCasetransationPage();\n }\n\n }\n },\n (error: any) => {\n this.errorMessage = error;\n this.isConfirmationBtnDisabled = false;\n }\n );\n }\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISTURNOFF = this.isTurnOff;\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n\n let partUrl = this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl += this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl += this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl += this.isStrategicFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n let url = `/payment-history/${this.ccdCaseNumber}?view=case-transactions&takePayment=true&selectedOption=${this.option}${partUrl}`;\n this.router.navigateByUrl(url);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n@Pipe({\n name: 'ccdHyphens'\n})\nexport class CcdHyphensPipe implements PipeTransform {\n constructor() {}\n transform(value: any, args?: any): any {\n const pattern = /^([0-9]{4})+([0-9]{4})+([0-9]{4})+([0-9]{4})$/;\n if ( value.match(pattern)) {\n return value.replace(pattern,'$1-$2-$3-$4') \n }\n return value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n@Pipe({\n name: 'keyValue'\n})\nexport class keyValuePipe implements PipeTransform {\n constructor() {}\n transform(input: any): any {\n let keys = [];\n for (let key in input) {\n if (input.hasOwnProperty(key)) {\n keys.push({ key: key, value: input[key]});\n }\n }\n return keys;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Pipe({ name: 'sanitizeHtml' })\nexport class SanitizeHtmlPipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n transform(value: any): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as FileSaver from 'file-saver';\nimport * as XLSX from 'xlsx';\nimport * as XLSXStyle from 'xlsx-style';\n\n\nconst EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';\nconst EXCEL_EXTENSION = '.xlsx';\n\n@Injectable()\nexport class XlFileService {\n\n constructor() { }\n\n public exportAsExcelFile(json: any[], excelFileName: string): void {\n let worksheet: XLSX.WorkSheet; \n let workbook: XLSX.WorkBook; \n\n if(excelFileName.match('Data_Loss')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['loss_resp','payment_asset_dcn','env_ref','env_item','resp_service_id','resp_service_name','date_banked','bgc_batch','payment_method','amount']});\n worksheet = this.setDataLossReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else if(excelFileName.match('Unprocessed')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','exception_ref','ccd_ref','date_banked','bgc_batch','payment_asset_dcn','env_ref','env_item','payment_method','amount']});\n worksheet = this.setUnprocessedReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else if(excelFileName.match('Processed_Unallocated')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','allocation_status','receiving_office','allocation_reason','ccd_exception_reference','ccd_case_reference','payment_asset_dcn','env_ref','env_item','date_banked','bgc_batch','payment_method','amount']});\n worksheet = this.setProcessedUnallocatedReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else {\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','surplus_shortfall','balance','payment_amount','ccd_case_reference', 'ccd_exception_reference', 'processed_date', 'reason', 'explanation', 'user_name']});\n worksheet = this.setShortFallReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n }\n workbook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });\n this.saveAsExcelFile(excelBuffer, excelFileName);\n }\n\n\nprivate autoFitColumns (worksheet: XLSX.WorkSheet,json:any) : XLSX.WorkSheet {\n let objectMaxLength = []; \n let ColWidth = [];\n let obj = <any>Object;\n for (let i = 0; i < json.length; i++) {\n let value = obj.values(json[i]);\n let key = obj.keys(json[i]);\n for (let j = 0; j < value.length; j++) {\n if(value[j] === null){\n value[j] = '';\n }\n objectMaxLength[j] =\n key[j].length >= value[j].length\n ? key[j].length+2\n : value[j].length+1;\n if( value[j].length === undefined){\n objectMaxLength[j] = key[j].length+2;\n }\n ColWidth.push({'width': +objectMaxLength[j]});\n }\n }\n worksheet['!cols'] = ColWidth;\n return worksheet;\n}\n\n\nprivate setDataLossReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Loss_Resp\";\n worksheet.B1.v = \"Payment_Asset_DCN\";\n worksheet.C1.v = \"Envelope_Ref\";\n worksheet.D1.v = \"Envelope_Item\";\n worksheet.E1.v = \"Resp_Service ID\";\n worksheet.F1.v = \"Resp_Service Name\";\n worksheet.G1.v = \"Date_Banked\";\n worksheet.H1.v = \"BGC_Batch\";\n worksheet.I1.v = \"Payment_Method\";\n worksheet.J1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setUnprocessedReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Exception_Ref\";\n worksheet.D1.v = \"CCD_Ref\";\n worksheet.E1.v = \"Date_Banked\";\n worksheet.F1.v = \"BGC_Batch\";\n worksheet.G1.v = \"Payment_Asset_DCN\";\n worksheet.H1.v = \"Envelope_Ref\";\n worksheet.I1.v = \"Envelope_Item\";\n worksheet.J1.v = \"Payment_Method\";\n worksheet.K1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setProcessedUnallocatedReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Allocation_Status\";\n worksheet.D1.v = \"Receiving_Office\";\n worksheet.E1.v = \"Allocation_Reason\";\n worksheet.F1.v = \"CCD_Exception_Ref\";\n worksheet.G1.v = \"CCD_Case_Ref\";\n worksheet.H1.v = \"Payment_Asset_DCN\";\n worksheet.I1.v = \"Envelope_Ref\";\n worksheet.J1.v = \"Envelope_Item\";\n worksheet.K1.v = \"Date_Banked\";\n worksheet.L1.v = \"BGC_Batch\";\n worksheet.M1.v = \"Payment_Method\";\n worksheet.N1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setShortFallReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Surplus_Shortfall\";\n worksheet.D1.v = \"Balance\";\n worksheet.E1.v = \"Payment_Amount\";\n worksheet.F1.v = \"CCD_Case_Ref\";\n worksheet.G1.v = \"Exception_Ref\";\n worksheet.H1.v = \"Processed_Date\";\n worksheet.I1.v = \"Reason\";\n worksheet.J1.v = \"Explanation\";\n worksheet.K1.v = \"Updated Name\";\n return worksheet;\n}\n\nprivate saveAsExcelFile(buffer: any, fileName: string): void {\n const data: Blob = new Blob([buffer], {\n type: EXCEL_TYPE\n });\n FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, FormControl } from '@angular/forms';\nimport { formatDate } from \"@angular/common\";\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {XlFileService} from '../../services/xl-file/xl-file.service';\n\n@Component({\n selector: 'ccpay-reports',\n template: `<div class=\"header\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='REPORTS'>\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <legend class=\"govuk-fieldset__legend--xl\">\n <h1 class=\"govuk-fieldset__heading\"> Choose the report type and date range</h1>\n </legend>\n</div>\n<form [formGroup]=\"reportsForm\">\n <div class=\"govuk-form-group\">\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\">\n <div class=\"govuk-radios__item\">\n <input \n required\n id=\"DataLoss\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('DATA_LOSS')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"DATA_LOSS\" \n data-aria-controls=\"DataLoss\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"DataLoss\">Data loss</label>\n <span class=\"form-hint\">Missing transactions where data has been received from only either of Exela or Bulk scan</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"UnprocessedTransactions\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('UNPROCESSED')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"UNPROCESSED\" \n data-aria-controls=\"UnprocessedTransactions\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"UnprocessedTransactions\">Unprocessed transactions</label>\n <span class=\"form-hint\">Transaction records that are still unprocessed by staff.</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ProcessedUnallocated\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PROCESSED_UNALLOCATED')\"\n type=\"radio\"\n value=\"PROCESSED_UNALLOCATED\" \n data-aria-controls=\"ProcessedUnallocated\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ProcessedUnallocated\">Processed unallocated</label>\n <span class=\"form-hint\">Payments that are marked as âUnidentifiedâ or âTransferredâ (Unsolicited requests)</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ShortfallsandSurplus\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('SURPLUS_AND_SHORTFALL')\"\n type=\"radio\"\n value=\"SURPLUS_AND_SHORTFALL\" \n data-aria-controls=\"ShortfallsandSurplus\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ShortfallsandSurplus\">Shortfalls and surplus</label>\n <span class=\"form-hint\">Requests where balances are marked as shortfall/surplus further case management.\n E.g: Refund approval, Customer contact</span>\n </div>\n \n </div>\n </div>\n <div class=\"govuk-form-group\">\n <div class=\"datefrom\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-from\">Date from</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-from\" name=\"date-from\" type=\"date\" formControlName=\"startDate\" required/>\n </div>\n\n <div class=\"dateto\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-to\">Date to</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-to\" name=\"search\" type=\"date\" formControlName=\"endDate\" required/>\n </div>\n </div>\n <p class=\"inline-error-message\" *ngIf=\"isStartDateLesthanEndDate || isDateRangeBetnWeek\">\n <span *ngIf=\"isStartDateLesthanEndDate\">Please select 'Date From' less than or equal to 'Date To'</span>\n <span *ngIf=\"isDateRangeBetnWeek\"> Please select the date range between 7 days</span>\n </p>\n <div class=\"btnsubmit\">\n <button type=\"submit\" (click)=\"downloadReport()\" class=\"button\" [disabled]=\"!reportsForm.valid || isDownLoadButtondisabled || isStartDateLesthanEndDate || isDateRangeBetnWeek\">Download report</button>\n </div>\n </form>\n `,\n styles: [`.govuk-radios__input:focus+.govuk-radios__label::before{border-width:4px;box-shadow:0 0 0 4px #ffaf00}.datefrom{width:50%;float:left}.dateto{width:50%;float:right}.govuk-label--m{font-size:large}.form-hint{padding-left:.7em}.header{margin-top:10px;margin-bottom:15px}.btnsubmit{margin-bottom:30px}.inline-error-message{color:#a71414;font-weight:700;margin-top:10px}`]\n})\nexport class ReportsComponent implements OnInit {\n reportsForm: FormGroup;\n startDate: string;\n endDate: string;\n ccdCaseNumber: string;\n isDownLoadButtondisabled:Boolean = false;\n isStartDateLesthanEndDate: Boolean = false;\n isDateRangeBetnWeek: Boolean = false;\n errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n paymentGroups: IPaymentGroup[] = [];\n\n constructor(\n private xlFileService: XlFileService,\n private errorHandlerService: ErrorHandlerService,\n private formBuilder: FormBuilder,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private paymentViewService: PaymentViewService) { }\n \n\n ngOnInit() {\n this.fromValidation();\n\n }\n\n getToday(): string {\n return new Date().toISOString().split('T')[0];\n }\n\n getSelectedFromDate(): void {\n this.validateDates(this.reportsForm.get('selectedreport').value);\n }\n\n validateDates(reportName){\n const selectedStartDate = this.tranformDate(this.reportsForm.get('startDate').value),\n selectedEndDate = this.tranformDate(this.reportsForm.get('endDate').value);\n const isDateRangeMoreThanWeek = (<any>new Date(selectedStartDate) - <any>new Date(selectedEndDate))/(1000 * 3600 * -24) > 7;\n if(new Date(selectedStartDate) > new Date(selectedEndDate) && selectedEndDate !== ''){\n this.reportsForm.get('startDate').setValue('');\n this.isDateRangeBetnWeek = false;\n this.isStartDateLesthanEndDate = true;\n } else if(reportName && reportName ==='SURPLUS_AND_SHORTFALL' && isDateRangeMoreThanWeek ) {\n this.isDateRangeBetnWeek = true;\n this.isStartDateLesthanEndDate = false;\n } else {\n this.isDateRangeBetnWeek = false;\n this.isStartDateLesthanEndDate = false;\n }\n\n }\n\n fromValidation() {\n this.reportsForm = this.formBuilder.group({\n selectedreport: new FormControl('') ,\n startDate: new FormControl(''),\n endDate: new FormControl('') \n });\n}\n\ndownloadReport(){\n this.isDownLoadButtondisabled = true;\n const dataLossRptDefault = [{loss_resp:'',payment_asset_dcn:'',env_ref:'',env_item:'',resp_service_id:'',resp_service_name:'',date_banked:'',bgc_batch:'',payment_method:'',amount:''}],\n unProcessedRptDefault = [{resp_service_id:'',resp_service_name:'',exception_ref:'',ccd_ref:'',date_banked:'',bgc_batch:'',payment_asset_dcn:'',env_ref:'',env_item:'',payment_method:'',amount:''}],\n processedUnallocated =[{resp_service_id:'',resp_service_name:'',allocation_status:'',receiving_office:'',allocation_reason:'',ccd_exception_ref:'',ccd_case_ref:'',payment_asset_dcn:'',env_ref:'',env_item:'',date_banked:'',bgc_batch:'',payment_method:'',amount:'',updated_by:''}],\n shortFallsRptDefault = [{resp_service_id:'',resp_service_name:'',surplus_shortfall:'',balance:'',payment_amount:'',ccd_case_reference:'',ccd_exception_reference:'',processed_date:'', reason:'', explanation:'', user_name:''}],\n selectedReportName = this.reportsForm.get('selectedreport').value,\n selectedStartDate = this.tranformDate(this.reportsForm.get('startDate').value),\n selectedEndDate = this.tranformDate(this.reportsForm.get('endDate').value);\n\n if(selectedReportName === 'PROCESSED_UNALLOCATED' || selectedReportName === 'SURPLUS_AND_SHORTFALL' ){\n this.paymentViewService.downloadSelectedReport(selectedReportName,selectedStartDate,selectedEndDate).subscribe(\n response => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n const result = JSON.parse(response);\n let res= {data: this.applyDateFormat(result)};\n if(res['data'].length === 0 && selectedReportName === 'PROCESSED_UNALLOCATED' ){\n res.data= processedUnallocated;\n } else if(res['data'].length === 0 && selectedReportName === 'SURPLUS_AND_SHORTFALL' ) {\n res.data= shortFallsRptDefault;\n } \n if(result['data'].length > 0) {\n for( var i=0; i< res['data'].length; i++) {\n if(res['data'][i][\"payment_asset_dcn\"] !== undefined) {\n res['data'][i]['env_ref'] = res['data'][i][\"payment_asset_dcn\"].substr(0,13);\n res['data'][i]['env_item'] = res['data'][i][\"payment_asset_dcn\"].substr(13,21);\n }\n if(res['data'][i][\"amount\"] !== undefined) {\n res['data'][i]['amount'] = this.convertToFloatValue(res['data'][i]['amount']);\n }\n if(res['data'][i][\"balance\"] !== undefined) {\n res['data'][i]['balance'] = this.convertToFloatValue(res['data'][i][\"balance\"]);\n }\n if(res['data'][i][\"payment_amount\"] !== undefined) {\n res['data'][i]['payment_amount'] = this.convertToFloatValue(res['data'][i]['payment_amount']);\n }\n }\n } \n this.isDownLoadButtondisabled = false;\n this.xlFileService.exportAsExcelFile(res['data'], this.getFileName(this.reportsForm.get('selectedreport').value, selectedStartDate, selectedEndDate));\n },\n (error: any) => {\n this.isDownLoadButtondisabled = false;\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n })\n } else {\n this.bulkScaningPaymentService.downloadSelectedReport(selectedReportName,selectedStartDate,selectedEndDate).subscribe(\n response => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n const result = JSON.parse(response);\n let res = {data: this.applyDateFormat(result)};\n if(res['data'].length === 0 && selectedReportName === 'DATA_LOSS' ){\n res.data= dataLossRptDefault;\n } else if(res['data'].length === 0 && selectedReportName === 'UNPROCESSED'){\n res.data = unProcessedRptDefault;\n }\n if(result['data'].length > 0) {\n for( var i=0; i< res['data'].length; i++) {\n if(res['data'][i][\"amount\"] !== undefined) {\n res['data'][i]['amount'] = this.convertToFloatValue(res['data'][i]['amount']);\n }\n if(res['data'][i][\"payment_asset_dcn\"] !== undefined) {\n res['data'][i]['env_ref'] = res['data'][i][\"payment_asset_dcn\"].substr(0,13);\n res['data'][i]['env_item'] = res['data'][i][\"payment_asset_dcn\"].substr(13,21);\n }\n }\n }\n this.isDownLoadButtondisabled = false;\n this.xlFileService.exportAsExcelFile(res['data'], this.getFileName(this.reportsForm.get('selectedreport').value, selectedStartDate, selectedEndDate ));\n },\n (error: any) => {\n this.isDownLoadButtondisabled = false;\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n })\n }\n }\n\n getFileName(selectedOption: string, startDate: string, endDate: string ) {\n const loc = 'en-US',\n stDt = formatDate(startDate, 'ddMMyy', loc),\n enDt = formatDate(endDate, 'ddMMyy', loc),\n now = new Date(),\n currentDate = formatDate(now, 'ddMMyy', loc),\n timestamp = `${currentDate}_${this.getTwodigit(now.getHours())}${this.getTwodigit(now.getMinutes())}${this.getTwodigit(now.getSeconds())}`,\n selectedOptionTxt = this.getCamelCaseString(selectedOption);\n \n return selectedOptionTxt+'_'+stDt+'_To_'+enDt+'_Run_'+ timestamp;\n } \n tranformDate(strDate: string) {\n let result = '';\n if (strDate) {\n let parts = strDate.split('-');\n result = `${parts[1]}/${parts[2]}/${parts[0]}`;\n }\n return result;\n }\n getTwodigit(input: number){\n return (\"0\" + input).slice(-2);\n }\n getCamelCaseString(selectedOption) {\n let result;\n switch(selectedOption) { \n case 'UNPROCESSED': { \n result = 'Unprocessed';\n break; \n } \n case 'DATA_LOSS': { \n result = 'Data_Loss';\n break; \n } \n case 'PROCESSED_UNALLOCATED': { \n result = 'Processed_Unallocated';\n break; \n } \n case 'SURPLUS_AND_SHORTFALL': { \n result = 'Surplus_Shortfall';\n break; \n } \n default: { \n result = selectedOption;\n break; \n } \n } \n return result;\n }\n applyDateFormat(res) {\n const fmt = 'dd/MM/yyyy',\n loc = 'en-US';\n return res['data'].map(value => {\n if (value['date_banked']) {\n value['date_banked'] = formatDate(value['date_banked'], fmt, loc);\n }\n return value;\n });\n }\n \n convertToFloatValue(amt) {\n return amt ? Number.parseFloat(amt).toFixed(2): '0.00';\n }\n}\n","import { NgModule } from '@angular/core';\nimport {HttpClientModule} from '@angular/common/http';\nimport { CommonModule } from '@angular/common';\n\nimport {PaymentListComponent} from './components/payment-list/payment-list.component';\nimport {PaymentViewComponent} from './components/payment-view/payment-view.component';\nimport {CardDetailsComponent} from './components/card-details/card-details.component';\nimport {PageNotFoundComponent} from './components/page-not-found.component';\nimport {PaymentLibComponent} from './payment-lib.component';\nimport { StatusHistoryComponent } from './components/status-history/status-history.component';\nimport { PbaDetailsComponent } from './components/pba-details/pba-details.component';\nimport { LoggerService } from './services/shared/logger/logger.service';\nimport { ConsoleLoggerService } from './services/shared/logger/console-logger.service';\nimport { WebComponentHttpClient } from './services/shared/httpclient/webcomponent.http.client';\nimport { CaseTransactionsComponent } from './components/case-transactions/case-transactions.component';\nimport { FeeSummaryComponent } from './components/fee-summary/fee-summary.component';\nimport { ErrorBannerComponent } from './components/error-banner/error-banner.component';\nimport { MarkUnidentifiedPaymentComponent } from './components/mark-unidentified-payment/mark-unidentified-payment.component';\nimport { MarkUnsolicitedPaymentComponent } from './components/mark-unsolicited-payment/mark-unsolicited-payment.component';\nimport { UnprocessedPaymentsComponent } from './components/unprocessed-payments/unprocessed-payments.component';\nimport { ProcessedPaymentsComponent } from './components/processed-payments/processed-payments.component';\nimport { AllocatePaymentsComponent } from './components/allocate-payments/allocate-payments.component';\nimport { AddRemissionComponent } from './components/add-remission/add-remission.component';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CcdHyphensPipe } from './pipes/ccd-hyphens.pipe';\nimport { keyValuePipe } from './pipes/key-value.pipe';\nimport { SanitizeHtmlPipe } from './pipes/sanitize-html.pipe';\nimport { ReportsComponent } from './components/reports/reports.component';\nimport { XlFileService } from './services/xl-file/xl-file.service';\n\n\n@NgModule({\n imports: [\n CommonModule,\n HttpClientModule,\n FormsModule,\n ReactiveFormsModule\n ],\n declarations: [\n PaymentLibComponent,\n PaymentListComponent,\n PaymentViewComponent,\n CardDetailsComponent,\n PageNotFoundComponent,\n StatusHistoryComponent,\n MarkUnidentifiedPaymentComponent,\n MarkUnsolicitedPaymentComponent,\n UnprocessedPaymentsComponent,\n ProcessedPaymentsComponent,\n AllocatePaymentsComponent,\n PbaDetailsComponent,\n CaseTransactionsComponent,\n FeeSummaryComponent,\n AddRemissionComponent,\n CcdHyphensPipe,\n keyValuePipe,\n SanitizeHtmlPipe,\n ReportsComponent,\n ErrorBannerComponent\n ],\n exports: [ PaymentLibComponent ],\n providers: [ \n { provide: LoggerService, useClass: ConsoleLoggerService },\n XlFileService,\n WebComponentHttpClient\n ]\n})\n\nexport class PaymentLibModule { }\n"]}
|
|
1
|
+
{"version":3,"sources":["ng://@hmcts/ccpay-web-component/lib/payment-lib.service.ts","ng://@hmcts/ccpay-web-component/lib/payment-lib.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/error-handler.service.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/logger/logger.service.ts","ng://@hmcts/ccpay-web-component/lib/services/payment-list/payment-list.service.ts","ng://@hmcts/ccpay-web-component/lib/components/payment-list/payment-list.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/httpclient/webcomponent.http.client.ts","ng://@hmcts/ccpay-web-component/lib/services/payment-view/payment-view.service.ts","ng://@hmcts/ccpay-web-component/lib/components/payment-view/payment-view.component.ts","ng://@hmcts/ccpay-web-component/lib/services/card-details/card-details.service.ts","ng://@hmcts/ccpay-web-component/lib/components/card-details/card-details.component.ts","ng://@hmcts/ccpay-web-component/lib/components/page-not-found.component.ts","ng://@hmcts/ccpay-web-component/lib/services/status-history/status-history.service.ts","ng://@hmcts/ccpay-web-component/lib/components/status-history/status-history.component.ts","ng://@hmcts/ccpay-web-component/lib/components/pba-details/pba-details.component.ts","ng://@hmcts/ccpay-web-component/lib/services/shared/logger/console-logger.service.ts","ng://@hmcts/ccpay-web-component/lib/services/case-transactions/case-transactions.service.ts","ng://@hmcts/ccpay-web-component/lib/services/bulk-scaning-payment/bulk-scaning-payment.service.ts","ng://@hmcts/ccpay-web-component/lib/components/case-transactions/case-transactions.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/PaymentToPayhubRequest.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/PayhubAntennaRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/fee-summary/fee-summary.component.ts","null","ng://@hmcts/ccpay-web-component/lib/components/error-banner/error-banner.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/UnidentifiedPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/AllocatePaymentRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/mark-unidentified-payment/mark-unidentified-payment.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/UnsolicitedPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/mark-unsolicited-payment/mark-unsolicited-payment.component.ts","ng://@hmcts/ccpay-web-component/lib/components/unprocessed-payments/unprocessed-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/components/processed-payments/processed-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/IAllocationPaymentsRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/allocate-payments/allocate-payments.component.ts","ng://@hmcts/ccpay-web-component/lib/interfaces/AddRemissionRequest.ts","ng://@hmcts/ccpay-web-component/lib/components/add-remission/add-remission.component.ts","ng://@hmcts/ccpay-web-component/lib/pipes/ccd-hyphens.pipe.ts","ng://@hmcts/ccpay-web-component/lib/pipes/key-value.pipe.ts","ng://@hmcts/ccpay-web-component/lib/pipes/sanitize-html.pipe.ts","ng://@hmcts/ccpay-web-component/lib/services/xl-file/xl-file.service.ts","ng://@hmcts/ccpay-web-component/lib/components/reports/reports.component.ts","ng://@hmcts/ccpay-web-component/lib/payment-lib.module.ts"],"names":["PaymentLibService","prototype","setApiRootUrl","apiRoot","this","API_ROOT","getApiRootUrl","setBulkScanApiRootUrl","bulkscanapiRoot","BULKSCAN_API_ROOT","getBulkScanApiRootUrl","Injectable","args","providedIn","PaymentLibComponent","paymentLibService","ngOnInit","PAYMENT_GROUP_REF","paymentGroupReference","DCN_NUMBER","bspaymentdcn","VIEW","viewName","Component","selector","template","Input","ErrorHandlerService","handleError","err","errorMessage","error","Error","message","status","messsage","undefined","_throw","getServerErrorMessage","isErrorExist","title","body","showError","LoggerService","invokeConsoleMethod","type","PaymentListService","http","logger","errorHandlerService","getPaymentByCcdCaseNumber","ccdCaseNumber","paymentMethod","info","get","withCredentials","pipe","catchError","HttpClient","PaymentListComponent","paymentListService","paymentLibComponent","_this","CCD_CASE_NUMBER","PAYMENT_METHOD","subscribe","payments","loadPaymentViewComponent","paymentReference","styles","WebComponentHttpClient","meta","post","url","options","opts","addHeaders","put","delete","patch","csrfToken","getTag","headers","forEach","element","content","HttpHeaders","responseType","Meta","PaymentViewService","https","getPaymentDetails","getPaymentGroupDetails","getApportionPaymentDetails","postBSPayments","postBSUnidentifiedPayments","postBSUnsolicitedPayments","postBSAllocationPayments","postPaymentGroupWithRemissions","feeId","deleteFeeFromPaymentGroup","postPaymentToPayHub","paymentGroupRef","postPaymentAntennaToPayHub","downloadSelectedReport","reportName","startDate","endDate","getBSfeature","getSiteID","PaymentViewComponent","paymentViewService","selectedOption","SELECTED_OPTION","dcnNumber","isTurnOff","ISTURNOFF","paymentGroup","fees","fee","isRemissionsMatch","remissions","rem","fee_code","code","push","filter","paymentGroupObj","includes","paymentAllocation","payment_allocation","isStatusAllocated","length","allocation_status","Object","defineProperty","method","channel","goToPaymentList","goToCaseTransationPage","event","preventDefault","features","result","JSON","parse","feature","uid","ISBSENABLE","enable","CardDetailsService","getCardDetails","CardDetailsComponent","cardDetailsService","cardDetails","PageNotFoundComponent","StatusHistoryService","getPaymentStatusesByReference","StatusHistoryComponent","statusHistoryService","statuses","PbaDetailsComponent","noop","ConsoleLoggerService","console","log","apply","CaseTransactionsService","getPaymentGroups","BulkScaningPaymentService","getBSPaymentsByCCD","getBSPaymentsByDCN","dcn","postBSAllocatePayment","paymentRef","postBSPaymentStrategic","postBSWoPGStrategic","patchBSChangeStatus","calculateOutStandingAmount","feesTotal","paymentsTotal","remissionsTotal","calculated_amount","payment","toUpperCase","amount","remission","hwf_amount","removeUnwantedString","input","replaceText","replace","CaseTransactionsComponent","router","bulkScaningPaymentService","caseTransactionsService","ls.get","isGrpOutstandingAmtPositive","caseType","CASETYPE","EXC_REFERENCE","excReference","takePayment","TAKEPAYMENT","isBulkScanEnable","toLocaleLowerCase","isStrategicFixEnable","ISSFENABLE","paymentGroups","calculateAmounts","totalRefundAmount","calculateRefundAmount","setDefaults","lsCcdNumber","navigateByUrl","isAnyFeeGroupAvilable","checkForExceptionRecord","totalPayments","totalRemissions","totalNonOffPayments","totalFees","getAllocationStatus","recordData","exception_record_reference","ccd_reference","isExceptionRecord","isAddFeeBtnEnabled","case_reference","ccd_case_number","nonOffLinePayment","date_created","a","amount_due","b","clAmountDue","net_amount","payment_group_reference","allPayments","allocationLen","nonPayments","remisison","totalRefundAmount_1","isFeeAmountZero_1","grpOutstandingAmount","isFeeRecordsExist","isNewPaymentGroup_1","index","isHistoricGroupAvailable","getGroupOutstandingAmount","redirectToFeeSearchPage","redirectToReportsPage","loadFeeSummaryPage","goToPaymentViewComponent","goToPayementView","selectedUnprocessedFeeEvent","unprocessedRecordId","isUnprocessedRecordSelected","getUnprocessedFeeCount","unProcessedRecordCount","unprocessedRecordCount","calculateAmountDue","confirmRemoveFee","isRemoveBtnDisabled","viewStatus","cancelRemoval","removeFee","success","window","location","reload","isCheckAmountdueExist","amountDue","Router","PaymentToPayhubRequest","toFixed","case_type","PayhubAntennaRequest","BS_ENABLE_FLAG","FeeSummaryComponent","bsPaymentDcnNumber","platForm","getUnassignedPaymentlist","getPaymentGroup","unassignedPayments","service","responsible_service_id","upPaymentErrorMessage","getRemissionByFeeCode","feeCode","_a","o","m","Symbol","iterator","i","call","next","value","done","tslib_1.__values","_b","addRemission","currentFee","isPaymentExist","isRemissionsExist","totalAfterRemission","isFeeAmountZero","outStandingAmount","loadCaseTransactionPage","partUrl","cancelRemission","page","isConfirmationBtnDisabled","antennaReqBody","response","isBackButtonEnable","href","goToAllocatePage","Location","ErrorBannerComponent","UnidentifiedPaymentsRequest","payment_reference","unidentified_reason","payment_allocation_status","description","name","AllocatePaymentRequest","unAllocatedPayment","exceptionRecord","allocatedRequest","banked_date","date_banked","exception_record","currency","document_control_number","dcn_reference","external_provider","giro_slip_no","bgc_reference","payer_name","payment_channel","payment_status","payment_method","payment_allocation_dto","MarkUnidentifiedPaymentComponent","formBuilder","getErrorMessage","getUnassignedPayment","markPaymentUnidentifiedForm","group","investicationDetail","FormControl","Validators","compose","required","minLength","maxLength","pattern","unassignedRecord","siteID","beCcdNumber","beExceptionNumber","exceptionReference","ccdReference","trimUnderscore","saveAndContinue","resetForm","investicationField","controls","formerror","errors","dirty","valid","investigationComment","invalid","actualLength","val","isInvesticationDetailEmpty","investicationDetailHasError","investicationDetailMinHasError","investicationDetailMaxHasError","confirmPayments","isConfirmButtondisabled","reason","res1","requestBody","res2","response2","reqBody","reference","res3","gotoCasetransationPage","user_id","postStrategicBody","res","cancelMarkUnidentifiedPayments","FormBuilder","UnsolicitedPaymentsRequest","responsible_office","responsible_person","email_id","receiving_office","receiving_email_address","sending_email_address","MarkUnsolicitedPaymentComponent","siteids","isContinueButtondisabled","siteIDList","scrollTo","markPaymentUnsolicitedForm","responsibleOffice","responsiblePerson","emailId","selectedSiteId","reasonField","officeIdField","field","isReasonEmpty","reasonHasError","reasonMinHasError","reasonMaxHasError","isResponsibleOfficeEmpty","responsibleOfficeHasError","cancelMarkUnsolicitedPayments","checkingFormValue","setValue","formFields","valueExists","hasOwnProperty","selectchange","target","selectedSiteName","selectedIndex","text","UnprocessedPaymentsComponent","EventEmitter","isStFixEnable","setValuesForUnassignedRecord","emit","unassignedRecordList","serviceId","isExceptionCase","isRecordExist","formatUnassignedRecordId","ID","recordId","loadUnsolicitedPage","unprocessedPaymentSelectEvent","selectedRecordReference","validateButtons","unProcessedPaymentServiceId","PAYMENTREF","isMarkAsUnidentifiedbtnEnabled","FEE_RECORDS_EXISTS","isAllocateToExistingFeebtnEnabled","IS_OS_AMT_AVAILABLE","isAllocatedToNewFeebtnEnabled","unprocessedPaymentUnSelectEvent","Output","ProcessedPaymentsComponent","redirectToPaymentViewPage","IAllocationPaymentsRequest","explanation","userName","user_name","AllocatePaymentsComponent","overPayment","hwfReward","wrongFee","notIssueCase","otherDeduction","shortFall","helpWithFee","other","referRefund","noRefund","noCase","holdCase","heldCase","overUnderPaymentForm","moreDetails","fstCon","scndCn","selectedPaymentGroup","gotoSummaryPage","cancelAllocatePayment","confirmAllocatePayement","enCookieUserName","document","cookie","split","find","row","cookieUserName","decodeURIComponent","fullName","paymentDetailsField","paymentFormError","userNameField","isEmptyCondtion","paymentReason","paymentExplanation","isOtherOptionSelected","isRemainingAmountGtZero","isRemainingAmountLtZero","otherPaymentExplanation","finalServiceCall","vals","paymentReasonHasError","paymentExplanationHasError","isPaymentDetailsEmpty","isPaymentDetailsInvalid","paymentDetailsMinHasError","paymentDetailsMaxHasError","isUserNameEmpty","isUserNameInvalid","isMoreDetailsBoxHide","reset","GroupOutstandingAmount","remainingToBeAssigned","paymentSectionLabel","feedbackUrlLabel","remainingAmount","afterFeeAllocateOutstanding","amountForAllocation","selectRadioButton","key","AddRemissionRequest","hwf_reference","AddRemissionComponent","option","remissionForm","remissionCode","resetRemissionForm","remissionctrls","isRemissionLessThanFee","isRemissionCodeEmpty","remissionCodeHasError","isAmountEmpty","amountHasError","isRemissionLessThanFeeError","confirmRemission","newNetAmount","remissionAmount","trim","id","LDUrl","routeReuseStrategy","shouldReuseRoute","onSameUrlNavigation","CcdHyphensPipe","transform","match","Pipe","keyValuePipe","keys","SanitizeHtmlPipe","sanitizer","bypassSecurityTrustHtml","DomSanitizer","XlFileService","exportAsExcelFile","json","excelFileName","worksheet","workbook","XLSX.utils","json_to_sheet","header","setDataLossReportHeaders","setUnprocessedReportHeaders","setProcessedUnallocatedReportHeaders","setShortFallReportHeaders","Sheets","data","autoFitColumns","SheetNames","excelBuffer","XLSX.write","bookType","saveAsExcelFile","objectMaxLength","ColWidth","obj","values","j","width","v","buffer","fileName","Blob","FileSaver.saveAs","ReportsComponent","xlFileService","fromValidation","getToday","Date","toISOString","getSelectedFromDate","validateDates","reportsForm","selectedStartDate","tranformDate","selectedEndDate","isDateRangeMoreThanWeek","isDateRangeBetnWeek","isStartDateLesthanEndDate","selectedreport","downloadReport","isDownLoadButtondisabled","dataLossRptDefault","loss_resp","payment_asset_dcn","env_ref","env_item","resp_service_id","resp_service_name","bgc_batch","unProcessedRptDefault","exception_ref","ccd_ref","processedUnallocated","allocation_reason","ccd_exception_ref","ccd_case_ref","updated_by","shortFallsRptDefault","surplus_shortfall","balance","payment_amount","ccd_case_reference","ccd_exception_reference","processed_date","selectedReportName","applyDateFormat","substr","convertToFloatValue","Op","getFileName","loc","stDt","formatDate","enDt","now","timestamp","getTwodigit","getHours","getMinutes","getSeconds","getCamelCaseString","strDate","parts","slice","map","amt","Number","parseFloat","PaymentLibModule","NgModule","imports","CommonModule","HttpClientModule","FormsModule","ReactiveFormsModule","declarations","exports","providers","provide","useClass"],"mappings":"m5BAAA,IAAAA,EAAA,WAUE,SAAAA,YAEAA,EAAAC,UAAAC,cAAA,SAAcC,GACZC,KAAKC,SAAWF,GAGlBH,EAAAC,UAAAK,cAAA,WACE,OAAOF,KAAKC,UAGdL,EAAAC,UAAAM,sBAAA,SAAsBC,GACpBJ,KAAKK,kBAAoBD,GAG3BR,EAAAC,UAAAS,sBAAA,WACE,OAAON,KAAKK,uCAvBfE,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,sJAHd,GCAAC,EAAA,WAuDE,SAAAA,EAAoBC,GAAAX,KAAAW,kBAAAA,mC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ANT,GCAAwjB,EAAA,oDA+BCC,EAAAA,SAAQtoB,KAAA,CAAC,CACRuoB,QAAS,CACPC,EAAAA,aACAC,EAAAA,iBACAC,EAAAA,YACAC,EAAAA,qBAEFC,aAAc,CACZ1oB,EACA6C,EACAmD,EACA0C,EACAG,EACAG,EACA0L,EACA4D,EACA8B,EACAyB,EACAM,EACAhT,EACA+B,EACAsF,EACA2P,EACAqB,EACAI,EACAE,EACAoC,EACAjR,GAEF0V,QAAS,CAAE3oB,GACX4oB,UAAW,CACT,CAAEC,QAAShnB,EAAeinB,SAAUzf,GACpC6Y,EACA1e,SAhEJ","sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class PaymentLibService {\n API_ROOT: string;\n BULKSCAN_API_ROOT: string;\n\n constructor() { }\n\n setApiRootUrl(apiRoot: string): void {\n this.API_ROOT = apiRoot;\n }\n\n getApiRootUrl(): string {\n return this.API_ROOT;\n }\n\n setBulkScanApiRootUrl(bulkscanapiRoot: string): void {\n this.BULKSCAN_API_ROOT = bulkscanapiRoot;\n }\n\n getBulkScanApiRootUrl(): string {\n return this.BULKSCAN_API_ROOT;\n }\n}\n","import {Component, Input, OnInit} from '@angular/core';\nimport {PaymentLibService} from './payment-lib.service';\nimport { IBSPayments } from './interfaces/IBSPayments';\n\n@Component({\n selector: 'ccpay-payment-lib',\n template: `\n <ccpay-payment-list *ngIf=\"viewName === 'payment-list'\"></ccpay-payment-list>\n <ccpay-payment-view *ngIf=\"viewName === 'payment-view'\"\n [isTurnOff]=\"ISTURNOFF\"></ccpay-payment-view>\n <ccpay-case-transactions *ngIf=\"viewName === 'case-transactions'\"></ccpay-case-transactions>\n <app-mark-unidentified-payment *ngIf=\"viewName === 'unidentifiedPage'\"\n [caseType]=\"CASETYPE\"></app-mark-unidentified-payment>\n <app-mark-unsolicited-payment *ngIf=\"viewName === 'unsolicitedPage'\"\n [caseType]=\"CASETYPE\"></app-mark-unsolicited-payment>\n <app-allocate-payments *ngIf=\"viewName === 'allocate-payments'\"\n [isTurnOff]=\"ISTURNOFF\"\n [caseType]=\"CASETYPE\"\n ></app-allocate-payments>\n <ccpay-fee-summary *ngIf=\"viewName === 'fee-summary'\"\n [ccdCaseNumber]=\"CCD_CASE_NUMBER\"\n [paymentGroupRef]=\"paymentGroupReference\"\n [isTurnOff]=\"ISTURNOFF\"\n [caseType]=\"CASETYPE\"\n ></ccpay-fee-summary>\n <ccpay-reports *ngIf=\"viewName === 'reports'\"></ccpay-reports>\n `\n})\n\nexport class PaymentLibComponent implements OnInit {\n @Input('API_ROOT') API_ROOT: string;\n @Input('BULKSCAN_API_ROOT') BULKSCAN_API_ROOT: string;\n @Input('CCD_CASE_NUMBER') CCD_CASE_NUMBER: string;\n @Input('EXC_REFERENCE') EXC_REFERENCE: string;\n @Input('PAYMENT_METHOD') PAYMENT_METHOD: string;\n @Input('VIEW') VIEW: string;\n @Input('PAYMENT_GROUP_REF') PAYMENT_GROUP_REF?: string;\n @Input('TAKEPAYMENT') TAKEPAYMENT: boolean;\n @Input('DCN_NUMBER') DCN_NUMBER: string;\n @Input('SELECTED_OPTION') SELECTED_OPTION: string;\n @Input('ISBSENABLE') ISBSENABLE: Boolean;\n @Input('ISSFENABLE') ISSFENABLE: boolean;\n @Input('ISTURNOFF') ISTURNOFF: boolean;\n @Input('CASETYPE') CASETYPE: String;\n\n paymentMethod: string;\n bspaymentdcn: string;\n unProcessedPaymentServiceId: string = null;\n paymentGroupReference: string;\n paymentReference: string;\n viewName: string;\n isTurnOff: boolean;\n caseType: string;\n unProcessedPayment: IBSPayments = null;\n\n constructor(private paymentLibService: PaymentLibService) { }\n\n ngOnInit() {\n this.paymentLibService.setApiRootUrl(this.API_ROOT);\n this.paymentLibService.setBulkScanApiRootUrl(this.BULKSCAN_API_ROOT);\n if (this.PAYMENT_GROUP_REF) {\n this.paymentGroupReference = this.PAYMENT_GROUP_REF;\n }\n if (this.DCN_NUMBER) {\n this.bspaymentdcn = this.DCN_NUMBER;\n }\n\n if (this.VIEW === 'fee-summary') {\n this.viewName = 'fee-summary';\n } else if (this.VIEW !== 'reports') {\n this.viewName = 'case-transactions';\n } else {\n this.viewName = this.VIEW;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { _throw } from 'rxjs/observable/throw';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\n\n\nexport class ErrorHandlerService {\n\n constructor() { }\n\n\n handleError(err: HttpErrorResponse): Observable<any> {\n let errorMessage: string;\n if (err.error instanceof Error) {\n // A client-side or network error occurred.\n errorMessage = `An error occurred: ${err.error.message}`;\n } else {\n // The backend returned an unsuccessful response code.\n if (err.status === 404) {\n if (!err.error) {\n errorMessage = 'Not found';\n } else {\n errorMessage = err.error;\n }\n } else if (err.error.messsage === undefined) {\n errorMessage = 'Server error';\n } else {\n errorMessage = `${err.error.message}`;\n }\n }\n return _throw(errorMessage);\n }\n\n getServerErrorMessage(isErrorExist) {\n return {\n title: \"There is a problem with the service\",\n body: \"Try again later\",\n showError: isErrorExist\n };\n }\n}\n","import { Injectable } from '@angular/core';\n\nconst noop = (): any => undefined;\n\nexport abstract class Logger {\n\n info: any;\n warn: any;\n error: any;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggerService implements Logger {\n\n info: any;\n warn: any;\n error: any;\n\n invokeConsoleMethod(type: string, args?: any): void {}\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { Observable } from 'rxjs/internal/Observable';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { IPayments } from '../../interfaces/IPayments';\nimport { catchError } from 'rxjs/operators';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PaymentListService {\n payments: IPayments;\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n\n getPaymentByCcdCaseNumber(ccdCaseNumber: string, paymentMethod: string): Observable<IPayments> {\n this.logger.info('Payment-list-service getPaymentByCcdCaseNumber for: ', ccdCaseNumber);\n\n return this.http.get<IPayments>(`${this.paymentLibService.API_ROOT}/cases/${ccdCaseNumber}/payments`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import {Component, OnInit} from '@angular/core';\n\nimport {PaymentListService} from '../../services/payment-list/payment-list.service';\nimport {IPayments} from '../../interfaces/IPayments';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IStatusHistory} from '../../interfaces/IStatusHistory';\n\n@Component({\n selector: 'ccpay-payment-list',\n template: `<div class=\"govuk-width-container\">\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payments list could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!errorMessage && payments\">\n\n <table class=\"table\">\n <tr>\n <th class=\"bold font-xsmall\">Payment group reference</th>\n <th class=\"bold font-xsmall\">Payment reference</th>\n <th class=\"bold font-xsmall\">Date created</th>\n <th class=\"bold font-xsmall\">Channel</th>\n <th class=\"bold font-xsmall\">Method</th>\n <th class=\"bold font-xsmall\">Amount</th>\n <th class=\"bold font-xsmall\">Status</th>\n </tr>\n <tr *ngFor=\"let payment of payments.payments\">\n <td class=\"font-xsmall\">\n <a href=\"javascript:void(0)\" (click)=\"loadPaymentViewComponent(payment.payment_group_reference, payment.payment_reference, payment.method)\">{{ payment.payment_group_reference }}</a>\n <td class=\"font-xsmall\">{{ payment.payment_reference }}</td>\n <td class=\"font-xsmall\">{{ payment.date_created | date:'dd MMM yyyy hh:mm:ss' }}</td>\n <td class=\"font-xsmall\">{{ payment.channel | titlecase }}</td>\n <td class=\"font-xsmall\">{{ payment.method | titlecase }}</td>\n <td class=\"font-xsmall\">£{{ payment.amount | number:'.2' }}</td>\n <td *ngIf=\"payment.method === 'card' && payment.channel === 'online'\">\n <details>\n <summary><span class=\"summary font-xsmall\">{{ payment.status }}</span></summary>\n <div class=\"panel panel-border-narrow\" *ngIf=\"payment.status === 'Failed'\">\n <div *ngFor=\"let statusHistory of payment.status_histories\">\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0010'\">\n Payment rejected due to payment method selected or payment information entered, for example, failed fraud check, a 3D Secure authentication failure, or the user does not have enough money in account\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0020'\">\n Payment was not confirmed and completed within 90 minutes of being created\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0030'\">\n User clicked on the âCancel paymentâ button during the payment journey\n </p>\n <p class=\"font-xsmall\" *ngIf=\"statusHistory.error_code === 'P0050'\">\n Multiple possible causes, for example a configuration problem with the payment provider, or incorrect login credentials\n </p>\n </div>\n </div>\n </details>\n </td>\n <td *ngIf=\"payment.method === 'card' && payment.channel === 'telephony'\" class=\"font-xsmall\">\n {{ payment.status}}\n </td>\n <td *ngIf=\"payment.method === 'payment by account'\">\n <details>\n <summary><span class=\"summary font-xsmall\">{{ payment.status }}</span></summary>\n <div class=\"panel panel-border-narrow\" *ngIf=\"payment.status === 'Pending'\">\n <p class=\"font-xsmall\">This means the transaction is being processed by Liberata.</p>\n </div>\n </details>\n </td>\n </tr>\n </table>\n\n </div>\n\n</div>\n`,\n styles: [``]\n})\nexport class PaymentListComponent implements OnInit {\n payments: IPayments;\n errorMessage: string;\n code: string;\n\n constructor(private paymentListService: PaymentListService,\n private paymentLibComponent: PaymentLibComponent) {\n }\n\n ngOnInit() {\n this.paymentListService.getPaymentByCcdCaseNumber(this.paymentLibComponent.CCD_CASE_NUMBER, this.paymentLibComponent.PAYMENT_METHOD)\n .subscribe(\n payments => this.payments = payments,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n loadPaymentViewComponent(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.paymentLibComponent.paymentMethod = paymentMethod;\n this.paymentLibComponent.paymentGroupReference = paymentGroupReference;\n this.paymentLibComponent.paymentReference = paymentReference;\n this.paymentLibComponent.viewName = 'payment-view';\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Meta } from '@angular/platform-browser';\nimport { Observable } from 'rxjs';\n\n@Injectable()\nexport class WebComponentHttpClient {\n constructor(\n private http: HttpClient,\n private meta: Meta\n ) { }\n\n post(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.post(url, body, opts);\n }\n\n put(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.put(url, body, opts);\n }\n\n get(url: string, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.get(url, opts);\n }\n\n delete(url: string, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.delete(url, opts);\n }\n \n patch(url: string, body: any | null, options?: any): Observable<any> {\n const opts = this.addHeaders(options || {});\n return this.http.patch(url, body, opts);\n }\n\n addHeaders(options: any): any {\n const csrfToken = this.meta.getTag('name=csrf-token');\n const headers = {};\n if (options.headers) {\n options.headers.forEach(element => {\n headers[element] = options.headers.get(element);\n });\n }\n headers['X-Requested-With'] = 'XMLHttpRequest';\n headers['CSRF-Token'] = csrfToken.content;\n options.headers = new HttpHeaders(headers);\n options.responseType = 'text';\n return options;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Observable } from 'rxjs/internal/Observable';\n\nimport {IPayment} from '../../interfaces/IPayment';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { WebComponentHttpClient } from '../shared/httpclient/webcomponent.http.client';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { catchError } from 'rxjs/operators';\nimport { LoggerService } from '../shared/logger/logger.service';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport { AddRemissionRequest } from '../../interfaces/AddRemissionRequest';\nimport { PaymentToPayhubRequest } from '../../interfaces/PaymentToPayhubRequest';\nimport { PayhubAntennaRequest } from '../../interfaces/PayhubAntennaRequest';\nimport { UnidentifiedPaymentsRequest } from '../../interfaces/UnidentifiedPaymentsRequest';\nimport { UnsolicitedPaymentsRequest } from '../../interfaces/UnsolicitedPaymentsRequest';\nimport { Meta } from '@angular/platform-browser';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { IAllocationPaymentsRequest } from '../../interfaces/IAllocationPaymentsRequest';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PaymentViewService {\n\n private meta: Meta;\n\n constructor(private http: HttpClient,\n private https: WebComponentHttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getPaymentDetails(paymentReference: string, paymentMethod: string): Observable<IPayment> {\n this.logger.info('Payment-view-service getPaymentDetails for: ', paymentReference);\n\n return this.http.get<IPayment>(paymentMethod === 'card' || paymentMethod === 'cash' || paymentMethod === 'cheque' || paymentMethod === 'postal order' ?\n `${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}` :\n `${this.paymentLibService.API_ROOT}/credit-account-payments/${paymentReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n\n getPaymentGroupDetails(paymentGroupReference: string): Observable<IPaymentGroup> {\n this.logger.info('Payment-view-service getPaymentGroupDetails for: ', paymentGroupReference);\n\n return this.http.get<IPayment>(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n getApportionPaymentDetails(paymentReference: string): Observable<IPaymentGroup> {\n this.logger.info('Payment-view-service getPaymentGroupDetails for: ', paymentReference);\n\n return this.http.get<IPayment>(`${this.paymentLibService.API_ROOT}/payment-groups/fee-pay-apportion/${paymentReference}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSPayments(body: AllocatePaymentRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/bulk-scan-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSUnidentifiedPayments(body: UnidentifiedPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSUnsolicitedPayments(body: UnsolicitedPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSAllocationPayments(body: IAllocationPaymentsRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-allocations`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n\n postPaymentGroupWithRemissions(paymentGroupReference: string, feeId: number, body: AddRemissionRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupReference}/fees/${feeId}/remissions`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n deleteFeeFromPaymentGroup(feeId: number): Observable<any> {\n this.logger.info('Payment-view-service deleteFeeFromPaymentGroup for: ', feeId);\n return this.https.delete(`${this.paymentLibService.API_ROOT}/fees/${feeId}`).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postPaymentToPayHub(body: PaymentToPayhubRequest, paymentGroupRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupRef}/card-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n\n postPaymentAntennaToPayHub(body: PayhubAntennaRequest, paymentGroupRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupRef}/telephony-card-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n downloadSelectedReport(reportName: string, startDate: string, endDate:string): Observable<any> {\n const url = `${this.paymentLibService.API_ROOT}/report/data?date_from=${startDate}&date_to=${endDate}&report_type=${reportName}`;\n return this.https.get(url, { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n getBSfeature(): Observable<any> {\n return this.https.get('api/payment-history/bulk-scan-feature', { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n getSiteID(): Observable<any> {\n return this.https.get('api/payment-history/refdata/legacy-sites', { withCredentials: true }).pipe( catchError(this.errorHandlerService.handleError));\n }\n}\n","import {Component, OnInit, Input} from '@angular/core';\nimport {PaymentViewService} from '../../services/payment-view/payment-view.service';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-payment-view',\n template: `<div class=\"govuk-width-container\">\n\n <div class=\"govuk-breadcrumbs\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a href=\"#\" (click)=\"goToCaseTransationPage($event)\" class=\"govuk-back-link\">Back</a>\n </li>\n </ol>\n </div>\n\n <main class=\"govuk-main-wrapper govuk-!-padding-top-0\" id=\"main-content\" role=\"main\">\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment details could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <div class=\"payment-view-alignment\" *ngIf=\"!errorMessage && paymentGroup\">\n\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='PAYMENTDETAILS'>\n <div class=\"govuk-grid-row\">\n <div class=\"column\">\n <h1 class=\"heading-large govuk-!-margin-top-0\">Payment details</h1>\n </div>\n </div>\n <table>\n <tbody>\n <tr class=\"section\" *ngIf=\"isTurnOff\">\n <td class=\"bold tb-col-w\">Payment group reference</td>\n <td>{{ paymentGroup.payment_group_reference }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Payment reference</td>\n <td>{{ paymentGroup.payments[0].reference }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Payment amount</td>\n <td>£{{ paymentGroup.payments[0].amount | number:'.2' }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">GovPay Transaction ID</td>\n <td>{{ paymentGroup.payments[0].external_reference }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].document_control_number && !paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">Payment asset number(DCN)</td>\n <td>{{ paymentGroup.payments[0].document_control_number }}</td>\n </tr>\n <tr class=\"section\" *ngIf=\"paymentGroup.payments[0] && paymentGroup.payments[0].document_control_number && !paymentGroup.payments[0].external_reference\">\n <td class=\"bold tb-col-w\">Banked date</td>\n <td>{{ paymentGroup.payments[0].banked_date | date:'dd MMM yyyy' }}</td>\n </tr>\n </tbody>\n </table>\n\n <div class=\"govuk-grid-row\" *ngIf=\"paymentGroup.fees.length > 0\">\n <div class=\"column\">\n <h2 class=\"heading-large\">Fee and remission details</h2>\n </div>\n </div>\n\n <div *ngFor=\"let fee of paymentGroup.fees\">\n <table class=\"table\">\n <tbody>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Description</td>\n <td>Application for {{ fee.description }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\">Fee code</td>\n <td>{{ fee.code }}</td>\n </tr>\n <tr class=\"section\">\n <td class=\"bold tb-col-w\" [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions && !isTurnOff }\">Fee amount</td>\n <td [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions && !isTurnOff }\">£{{ fee.calculated_amount | number:'.2' }}</td>\n </tr>\n <tr *ngIf=\"fee.net_amount && isTurnOff\">\n <td class=\"bold tb-col-w\" [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions}\" >Net amount</td>\n <td [ngClass]=\"{'tr-border': !fee.apportion_amount && !fee.remissions}\">£{{ fee.net_amount | number:'.2' }}</td>\n </tr>\n <tr *ngIf=\"fee.apportion_amount\">\n <td class=\"bold tb-col-w tr-border\" [ngClass]=\"{'tr-border': !fee.remissions}\">Allocated amount</td>\n <td [ngClass]=\"{'tr-border': !fee.remissions}\">£{{ fee.apportion_amount | number:'.2' }}</td>\n </tr>\n\n <tr *ngIf=\"fee.remissions\">\n <td class=\"bold tb-col-w\">Remission code</td>\n <td>{{fee.remissions.hwf_reference}}</td>\n </tr>\n <tr *ngIf=\"fee.remissions\">\n <td class=\"bold tb-col-w tr-border\">Remission amount</td>\n <td class=\"tr-border\">£{{ fee.remissions.hwf_amount | number:'.2'}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n\n <!-- card details -->\n <ccpay-card-details *ngIf=\"isCardPayment && !isTelephonyPayment\"></ccpay-card-details>\n\n <!-- pba details -->\n <ccpay-pba-details *ngIf=\"!isCardPayment\" [payment]=\"paymentGroup.payments[0]\"></ccpay-pba-details>\n\n <!-- Status histories -->\n <ccpay-payment-statuses *ngIf=\"isStatusAllocated\"></ccpay-payment-statuses>\n\n </div>\n\n </main>\n</div>\n`,\n styles: [`.tb-col-w{width:330px}.tr-border{border-bottom:2px solid}.payment-view-alignment{margin-left:30px}`]\n})\nexport class PaymentViewComponent implements OnInit {\n @Input() isTurnOff: boolean;\n paymentGroup: IPaymentGroup;\n errorMessage: string;\n ccdCaseNumber: string;\n selectedOption: string;\n dcnNumber: string;\n isStatusAllocated: boolean;\n isRemissionsMatch: boolean;\n\n constructor(private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent) {\n }\n\n ngOnInit() {\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION;\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n\n this.paymentViewService.getApportionPaymentDetails(this.paymentLibComponent.paymentReference).subscribe(\n paymentGroup => {\n let fees = [];\n paymentGroup.fees.forEach(fee => {\n this.isRemissionsMatch = false;\n\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n });\n paymentGroup.fees = fees\n this.paymentGroup = paymentGroup;\n\n this.paymentGroup.payments = this.paymentGroup.payments.filter\n (paymentGroupObj => paymentGroupObj['reference'].includes(this.paymentLibComponent.paymentReference));\n const paymentAllocation = this.paymentGroup.payments[0].payment_allocation;\n this.isStatusAllocated = paymentAllocation.length > 0 && paymentAllocation[0].allocation_status === 'Allocated' || paymentAllocation.length === 0;\n }, \n (error: any) => this.errorMessage = error\n );\n \n }\n\n get isCardPayment(): boolean {\n return this.paymentGroup.payments[0].method === 'card';\n }\n\n get isTelephonyPayment(): boolean {\n return this.paymentGroup.payments[0].channel === 'telephony';\n }\n\n public goToPaymentList(): void {\n this.paymentLibComponent.viewName = 'payment-list';\n }\n\n goToCaseTransationPage(event: any) {\n event.preventDefault()\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {Observable} from 'rxjs/internal/Observable';\n\nimport {ICardDetails} from '../../interfaces/ICardDetails';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport { catchError } from 'rxjs/operators';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CardDetailsService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getCardDetails(paymentReference: string): Observable<ICardDetails> {\n this.logger.info('Card-detail-service getCardDetails for: ', paymentReference);\n\n return this.http.get<ICardDetails>(`${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}/details`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { CardDetailsService } from '../../services/card-details/card-details.service';\nimport {ICardDetails} from '../../interfaces/ICardDetails';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\n@Component({\n selector: 'ccpay-card-details',\n template: `\n<div class=\"column\">\n <h2 class=\"heading-medium\">Payment method</h2>\n</div>\n\n<div role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\" *ngIf=\"errorMessage\">\n Payment method unavailable, The payment has either expired or unsuccessful.\n</div>\n\n<div *ngIf=\"!errorMessage && cardDetails\">\n\n<table>\n <tbody>\n <tr>\n <td class=\"bold tb-col-w\">Method</td>\n <td>Card</td>\n </tr>\n <tr>\n <td class=\"bold tb-col-w\">Type</td>\n <td>{{ cardDetails.card_brand }}</td>\n </tr>\n </tbody>\n</table>\n</div>\n\n`,\n styles: [`.tb-col-w{width:330px}`]\n})\nexport class CardDetailsComponent implements OnInit {\n pageTitle: string = 'Card details';\n cardDetails: ICardDetails;\n paymentReference: string;\n errorMessage: string;\n\n constructor(private cardDetailsService: CardDetailsService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.cardDetailsService.getCardDetails(this.paymentLibComponent.paymentReference).subscribe(\n cardDetails => this.cardDetails = cardDetails,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n get getPaymentReference(): string {\n return this.paymentReference;\n }\n\n}\n","import { Component } from '@angular/core';\n\n@Component({\n template: `\n <h1>This is not the page you were looking for!</h1>\n `\n})\nexport class PageNotFoundComponent { }\n","import { Injectable } from '@angular/core';\nimport { PaymentLibService } from '../../payment-lib.service';\nimport { HttpClient } from '@angular/common/http';\nimport { IStatusHistories } from '../../interfaces/IStatusHistories';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { ErrorHandlerService } from '../shared/error-handler.service';\nimport { catchError } from 'rxjs/operators';\nimport { LoggerService } from '../shared/logger/logger.service';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class StatusHistoryService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService) { }\n\n getPaymentStatusesByReference(paymentReference: string, paymentMethod: string): Observable<IStatusHistories> {\n this.logger.info('Status-history-service getPaymentStatusesByReference for: ', paymentReference);\n\n return this.http.get<IStatusHistories>(paymentMethod === 'card' || paymentMethod === 'cash' || paymentMethod === 'cheque' || paymentMethod === 'postal order' ?\n `${this.paymentLibService.API_ROOT}/card-payments/${paymentReference}/statuses` :\n `${this.paymentLibService.API_ROOT}/credit-account-payments/${paymentReference}/statuses`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { IStatusHistories } from '../../interfaces/IStatusHistories';\nimport { StatusHistoryService } from '../../services/status-history/status-history.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\n@Component({\n selector: 'ccpay-payment-statuses',\n template: `<div class=\"column\">\n <h2 class=\"heading-medium\">{{ pageTitle }}</h2>\n</div>\n\n\n<div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\" *ngIf=\"errorMessage\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment status history could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n</div>\n\n<div *ngIf=\"!errorMessage && statuses\">\n <table>\n <thead>\n <tr>\n <th>Status</th>\n <th>Amount</th>\n <th>Date</th>\n </tr>\n </thead> \n <tbody>\n <tr *ngFor=\"let status of statuses.status_histories\">\n <td>{{ status.status }}</td>\n <td>£{{ statuses.amount | number:'.2' }}</td>\n <td>{{ status.date_created | date:'dd MMM yyyy hh:mm:ss'}}</td>\n </tr>\n </tbody>\n </table>\n</div>\n`,\n styles: [``]\n})\nexport class StatusHistoryComponent implements OnInit {\n pageTitle: string = 'Payment status history';\n statuses: IStatusHistories;\n errorMessage: string;\n\n constructor(private statusHistoryService: StatusHistoryService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.statusHistoryService.getPaymentStatusesByReference(this.paymentLibComponent.paymentReference, this.paymentLibComponent.paymentMethod).subscribe(\n statuses => this.statuses = statuses,\n (error: any) => this.errorMessage = <any>error\n );\n }\n\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { IPayment } from '../../interfaces/IPayment';\n\n@Component({\n selector: 'ccpay-pba-details',\n template: `\n <h2 class=\"heading-large\">Payment method</h2>\n <table>\n <tbody>\n <tr>\n <td class=\"bold tb-col-w\">Method</td>\n <td class=\"capitalize\">{{ payment.method | lowercase}}</td>\n </tr>\n <tr>\n <td class=\"bold tb-col-w\">Type</td>\n <td>Credit</td>\n </tr>\n <tr *ngIf=\"payment.organisation_name\">\n <td class=\"bold tb-col-w\">PBA account name</td>\n <td>{{ payment.organisation_name }}</td>\n </tr>\n <tr *ngIf=\"payment.account_number\">\n <td class=\"bold tb-col-w\">PBA number</td>\n <td>{{ payment.account_number }}</td>\n </tr>\n <tr *ngIf=\"payment.customer_reference\">\n <td class=\"bold tb-col-w\">Customer internal reference</td>\n <td>{{ payment.customer_reference }}</td>\n </tr>\n </tbody>\n </table>\n`,\n styles: [`.capitalize::first-letter{text-transform:uppercase}.tb-col-w{width:330px}`]\n})\nexport class PbaDetailsComponent implements OnInit {\n @Input() payment: IPayment;\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { Logger } from './logger.service';\n\nexport let isDebugMode = false;\n\nconst noop = (): any => undefined;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConsoleLoggerService implements Logger {\n\n get info() {\n if (isDebugMode) {\n return console.info.bind(console);\n } else {\n return noop;\n }\n }\n\n get warn() {\n if (isDebugMode) {\n return console.warn.bind(console);\n } else {\n return noop;\n }\n }\n\n get error() {\n if (isDebugMode) {\n return console.error.bind(console);\n } else {\n return noop;\n }\n }\n\n invokeConsoleMethod(type: string, args?: any): void {\n const logFn: Function = (console)[type] || console.log || noop;\n logFn.apply(console, [args]);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {LoggerService} from '../shared/logger/logger.service';\nimport {ErrorHandlerService} from '../shared/error-handler.service';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport {Observable} from 'rxjs/Observable';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {catchError} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CaseTransactionsService {\n\n constructor(private http: HttpClient,\n private logger: LoggerService,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService\n ) { }\n\n getPaymentGroups(ccdCaseNumber: string): Observable<IPaymentGroup[]> {\n this.logger.info('Case-transactions-service getPaymentGroups for: ', ccdCaseNumber);\n\n return this.http.get<IPaymentGroup[]>(`${this.paymentLibService.API_ROOT}/cases/${ccdCaseNumber}/paymentgroups`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ErrorHandlerService} from '../shared/error-handler.service';\nimport { WebComponentHttpClient } from '../shared/httpclient/webcomponent.http.client';\nimport {PaymentLibService} from '../../payment-lib.service';\nimport {Observable} from 'rxjs/Observable';\nimport {catchError} from 'rxjs/operators';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { IPaymentGroup } from '../../interfaces/IPaymentGroup';\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BulkScaningPaymentService {\n\n constructor(private http: HttpClient,\n private https: WebComponentHttpClient,\n private errorHandlerService: ErrorHandlerService,\n private paymentLibService: PaymentLibService\n ) { }\n\n getBSPaymentsByCCD(ccdCaseNumber: string): Observable<IBSPayments> {\n return this.http.get<IBSPayments>(`${this.paymentLibService.BULKSCAN_API_ROOT}/cases/${ccdCaseNumber}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n getBSPaymentsByDCN(dcn: string): Observable<IBSPayments> {\n return this.http.get<IBSPayments>(`${this.paymentLibService.BULKSCAN_API_ROOT}/cases?document_control_number=${dcn}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSAllocatePayment(body: AllocatePaymentRequest, paymentRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentRef}/bulk-scan-payments`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSPaymentStrategic(body: AllocatePaymentRequest, paymentGroupRef: string): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/${paymentGroupRef}/bulk-scan-payments-strategic`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n postBSWoPGStrategic(body: AllocatePaymentRequest): Observable<any> {\n return this.https.post(`${this.paymentLibService.API_ROOT}/payment-groups/bulk-scan-payments-strategic`, body).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n patchBSChangeStatus(dcnNumber: string, status: string): Observable<any> {\n return this.https.patch(`${this.paymentLibService.API_ROOT}/bulk-scan-payments/${dcnNumber}/status/${status}`, status).pipe(\n catchError(this.errorHandlerService.handleError)\n );\n }\n calculateOutStandingAmount(paymentGroup: IPaymentGroup): number {\n let feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00;\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n });\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n } \n return (feesTotal - remissionsTotal) - paymentsTotal;\n }\n\n removeUnwantedString(input: string, replaceText: string) {\n const pattern = /[\\_]/gi;\n return input.replace(pattern, replaceText);\n }\n\n downloadSelectedReport(reportName: string, startDate: string, endDate:string): Observable<any> {\n return this.https.get(`${this.paymentLibService.BULKSCAN_API_ROOT}/report/data?date_from=${startDate}&date_to=${endDate}&report_type=${reportName}`, {\n withCredentials: true\n })\n .pipe(\n catchError(this.errorHandlerService.handleError)\n );\n}\n}\n","import { Component, OnInit } from '@angular/core';\nimport {PaymentLibComponent} from '../../payment-lib.component';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {CaseTransactionsService} from '../../services/case-transactions/case-transactions.service';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {IFee} from '../../interfaces/IFee';\nimport {IPayment} from '../../interfaces/IPayment';\nimport {IRemission} from '../../interfaces/IRemission';\nimport {Router} from '@angular/router';\nimport * as ls from \"local-storage\";\n\n@Component({\n selector: 'ccpay-case-transactions',\n template: `<div class=\"govuk-width-container\">\n\n <main class=\"govuk-main-wrapper\">\n <div *ngIf=\"viewStatus === 'main'&& !isTurnOff && takePayment\">\n\n\n <div *ngIf=\"takePayment\" class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Case transactions</h1>\n </div>\n </div>\n\n <div *ngIf=\"takePayment\" class=\"govuk-grid-row\">\n <div *ngIf='!isExceptionRecord' class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6 govuk-!-padding-top-6\">\n <h3 class=\"heading-medium\">CCD reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div *ngIf='isExceptionRecord' class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6 govuk-!-padding-top-6\">\n <h3 class=\"heading-medium\">Exception reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Total payments</td>\n <td class=\"govuk-table__header\" scope=\"col\">Total remissions</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n <td class=\"govuk-table__header govuk-table__header--custom\" scope=\"col\" *ngIf=\"isBulkScanEnable\">Unallocated payments</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"totalpayments govuk-table__row\">\n <td class=\"govuk-table__cell summary-table-font\">{{ totalPayments | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell summary-table-font\">{{ totalRemissions | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell summary-table-font\">{{ clAmountDue | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"govuk-table__cell case-transaction__color summary-table-font\" *ngIf=\"isBulkScanEnable\">{{unprocessedRecordCount}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class=\"govuk-grid-column-two-thirds\" *ngIf=\"takePayment\">\n <button type=\"submit\" (click)=\"redirectToFeeSearchPage($event)\"\n [disabled]=\"!isAddFeeBtnEnabled\"\n [ngClass]='!isAddFeeBtnEnabled ? \"govuk-button govuk-button--secondary govuk-button--disabled govuk-!-margin-right-1\" : \"govuk-button govuk-button--secondary govuk-!-margin-right-1\"'>\n Take telephony payment\n </button>\n </div>\n\n </div>\n <div class=\"govuk-grid-row\">\n\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [FEE_RECORDS_EXISTS]=\"isAnyFeeGroupAvilable\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [PAYMENTREF]=\"paymentRef\"\n (getUnprocessedFeeCount) = \"getUnprocessedFeeCount($event)\"\n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n </ccpay-app-unprocessed-payments>\n </div>\n <div *ngIf=\"takePayment\" class=\" govuk-!-margin-top-9\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h3 class=\"heading-medium\">Fees</h3>\n </div>\n <div class=\"govuk-grid-column-full\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n <td class=\"govuk-table__header\" scope=\"col\">Action</td>\n\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngFor=\"let paymentGroup of paymentGroups;\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell\">\t{{fee.code}} </td>\n <td class=\"govuk-table__cell\">{{fee.description}}</td>\n <td class=\"govuk-table__cell\">{{fee.volume? fee.volume : '-'}}</td>\n <td class=\"govuk-table__cell\">{{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\" [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"paymentGroup.old && i==0\"> {{getGroupOutstandingAmount(paymentGroup)| currency:'GBP':'symbol-narrow':'1.2-2'}}* </td>\n <td class=\"govuk-table__cell\" *ngIf=\"!paymentGroup.old\"> {{calculateAmountDue(fee) | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n <td class=\"govuk-table__cell\" *ngIf=\"!paymentGroup.old\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='!isCheckAmountdueExist(fee.amount_due) || fee.remissions ? \"disable-link\" : \"\"'>Remove</a>\n </td>\n <td class=\"govuk-table__cell\" *ngIf=\"paymentGroup.old\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='paymentGroup.payments?.length > 0 || paymentGroup.remissions?.length > 0 ? \"disable-link\" : \"\"'>Remove</a>\n </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroups?.length === 0\">\n <tr class=\"govuk-table__row\" >\n <td class=\"govuk-table__cell\" colspan=\"7\">No fees recorded</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"hmcts-banner\" *ngIf=\"isHistoricGroupAvailable\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z\"></path>\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">information</span>\n * These fees have already been processed offline. Check the notes in CCD for more information.\n </div>\n </div>\n <div class=\"panel panel-no--style\" *ngIf=\"allPayments?.length > 0 || remissions?.length > 0\">\n <!-- payments -->\n <h3 class=\"heading-medium\">Payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header col-28\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header col-15\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Payment status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of allPayments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(payment.paymentGroupReference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"7\">No payments recorded</td>\n </tbody>\n </table>\n\n <!-- remissions -->\n <h3 class=\"heading-medium\">Remissions</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Remission reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission amount</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"remissions?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let remission of remissions\">\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.remission_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.fee_code }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_amount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"remissions?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">No remissions recorded</td>\n </tbody>\n </table>\n </div>\n </div>\n</div>\n <div *ngIf=\"takePayment && isTurnOff\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Case transactions</h1>\n </div>\n\n <div class=\"govuk-grid-column-one-third\" align=\"right\" >\n <a [ngClass]=\"{ 'disable': !isAddFeeBtnEnabled} \" (click)=\"redirectToFeeSearchPage($event)\" class=\"button\">Add a new fee</a>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds govuk-!-padding-bottom-6\">\n <h3 class=\"heading-medium\">CCD reference:</h3>\n <span> {{ ccdCaseNumber | ccdHyphens }}</span>\n </div>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Total payments</td>\n <td class=\"govuk-table__header\" scope=\"col\">Total remissions</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount due</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"totalpayments govuk-table__row\">\n <td class=\"govuk-table__cell\">{{ totalPayments | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{ totalRemissions | currency :'GBP':'symbol':'1.2-2' }}</td>\n <td class=\"govuk-table__cell\">{{ (totalFees - totalRemissions) - totalPayments | currency :'GBP':'symbol':'1.2-2'}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n\n\n <!-- No fees start -->\n <div *ngIf=\"paymentGroups?.length === 0\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-small\">Existing fees</span>\n </div>\n\n <div class=\"govuk-grid-column-full\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No fees recorded</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n <!-- No fees end -->\n\n <div *ngFor=\"let paymentGroup of paymentGroups\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full govuk-grid-column-full--gr\">\n <span class=\"heading-medium\">Group reference: {{paymentGroup.payment_group_reference}}</span>\n </div>\n </div>\n <div class=\"govuk-grid-row\">\n\n <!--New Code start-->\n\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-small\">Exisiting fees</span>\n </div>\n <div class=feeclass>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"groupamount govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3 align-center\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\"> {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\"> {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6 govuk-table__custom--col6\" [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n {{getGroupOutstandingAmount(paymentGroup) | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length==0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"govuk-inset-text govuk-inset-text__no-border\" *ngIf=\"paymentGroup.payments || paymentGroup.remissions\">\n <details>\n <summary class=\"govuk-hidetext\">\n <span class=\"summary\">Allocated payments and remissions</span>\n </summary>\n\n <div class=\"panel panel-border-narrow\">\n <!-- payments -->\n <span class=\"heading-medium\">Payments</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.payments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of paymentGroup.payments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(paymentGroup.payment_group_reference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.payments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n\n <!-- remissions -->\n <span class=\"heading-medium\">Remissions</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Remission reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee applied against</td>\n <td class=\"govuk-table__header\" scope=\"col\">Remission amount</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.remissions?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let remission of paymentGroup.remissions\">\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.remission_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_reference }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.fee_code }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ remission.hwf_amount }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.remissions?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">No remissions recorded</td>\n </tbody>\n </table>\n </div>\n </details>\n\n\n <div *ngIf=\"takePayment\">\n <button type=\"submit\" (click)=\"loadFeeSummaryPage(paymentGroup)\"\n [disabled]=\"(getGroupOutstandingAmount(paymentGroup) <= 0 || isUnprocessedRecordSelected)\"\n [ngClass]='(getGroupOutstandingAmount(paymentGroup) <= 0 || isUnprocessedRecordSelected) ? \"govuk-button govuk-button--secondary govuk-button--disabled govuk-!-margin-right-1\" : \"govuk-button govuk-button--secondary govuk-!-margin-right-1\"'>\n Add telephone payment\n </button>\n </div>\n </div>\n </div>\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [FEE_RECORDS_EXISTS]=\"isFeeRecordsExist\"\n [IS_OS_AMT_AVAILABLE]=\"isGrpOutstandingAmtPositive\"\n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n </ccpay-app-unprocessed-payments>\n <div class=\"govuk-grid-row govuk-grid__surplus-payments\" *ngIf=\"totalRefundAmount > 0 && takePayment\">\n <div class=\"govuk-grid-column-full govuk-grid__surplus-payments-col1\">\n <h3 class=\"heading-medium\">Surplus payments</h3>\n </div>\n <div class=\"govuk-grid-column-full\">\n Total surplus payments received: {{totalRefundAmount | currency :'GBP':'symbol':'1.2-2'}}\n </div>\n </div>\n </div>\n <ccpay-app-unprocessed-payments\n *ngIf=\"isBulkScanEnable && !takePayment\"\n [IS_BUTTON_ENABLE]=\"takePayment\"\n [ISTURNOFF]=\"isTurnOff\"\n [ISSFENABLE]=\"isStrategicFixEnable\"\n [FEE_RECORDS_EXISTS]=\"isFeeRecordsExist\"\n [IS_OS_AMT_AVAILABLE]=\"isGrpOutstandingAmtPositive\"\n (selectedUnprocessedFeeEvent) = \"selectedUnprocessedFeeEvent($event)\">\n</ccpay-app-unprocessed-payments>\n\n<div *ngIf=\"!takePayment\" class=\"govuk-grid-row govuk-grid__surplus-payments\">\n <div class=\"govuk-grid-column-full\">\n <span class=\"heading-medium\">Processed payments</span>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment reference</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date created</td>\n <td class=\"govuk-table__header\" scope=\"col\">Date updated</td>\n <td class=\"govuk-table__header\" scope=\"col\">Channel</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n <td class=\"govuk-table__header\" scope=\"col\">Status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length > 0\">\n <tr class=\"govuk-table__row\" *ngFor=\"let payment of allPayments\">\n <td class=\"govuk-table__cell whitespace-inherit\">\n <a href=\"javascript:void(0)\" (click)=\"goToPayementView(payment.paymentGroupReference, payment.reference, payment.method)\">{{ payment.reference }}</a>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_created | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.date_updated | date:'dd MMM yyyy HH:mm:ss' }}</td>\n <td class=\"channel govuk-table__cell whitespace-inherit\">{{ payment.channel | lowercase }}</td>\n <td class=\"govuk-table__cell capitalize whitespace-inherit\">{{ payment.method | lowercase}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.amount }}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{getAllocationStatus(payment)}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\">{{ payment.status }}</td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"allPayments?.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"8\">No payments recorded</td>\n </tbody>\n </table>\n</div>\n</div>\n\n<input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEEREMOVALCONFIRMATION_2'>\n<ng-container *ngIf=\"viewStatus === 'feeRemovalConfirmation'\">\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to delete this fee?\n </strong>\n </div>\n <div class=\"govuk-button-grb\">\n <form novalidate>\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemoval()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"button\"\n [disabled]=\"isRemoveBtnDisabled\"\n [ngClass]='isRemoveBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"removeFee(feeId)\">\n Remove\n </button>\n </form>\n </div>\n</ng-container>\n </main>\n</div>\n`,\n styles: [`.govuk-grid-column-full--gr{position:relative;margin-bottom:10px}.disable{text-decoration:none;cursor:default;color:#fff;background-color:grey;pointer-events:none}.govuk-grid__surplus-payments{margin:20px 0}.govuk-grid__surplus-payments>.govuk-grid-column-full{padding:0}.govuk-grid__surplus-payments-col1{margin-bottom:10px}.govuk-inset-text__no-border{border-left:0}.govuk-hidetext{font-size:22px;padding-bottom:10px}.lowercase{text-transform:lowercase}.channel::first-letter{text-transform:uppercase}.govuk-heading-xl{font-size:48px;margin-bottom:1px}.govuk-section-break--visible{border-bottom:2px solid #000}.totalpayments.govuk-table__row{border-bottom:2px solid #000!important}.govuk-inset-text{margin-left:1em}.govuk-button{font-size:19px}.govuk-table__cell.govuk-table__cell--col6.govuk-table__custom--col6,.groupamount.govuk-table__header{text-align:right}.feeclass{padding-left:.7em}.align-center{text-align:center}details summary{display:list-item}.case-transaction__color{color:#a71414;font-weight:700;text-align:center}.capitalize::first-letter{text-transform:uppercase}.govuk-inset-text__no-left-margin{margin-left:0;padding-left:0}.whitespace-inherit{white-space:inherit!important}.govuk-section-records-break{margin:10px;border-bottom:2px solid #000!important}.exisitng-fees{margin-left:12px}.add-telephony-payment{margin-top:-2em;margin-left:-2em}.govuk-table__header--custom{text-align:center}.disable-link{cursor:default;pointer-events:none;color:#8e8c8c}.panel-no--style{border-left-style:none}.col-28{width:28%}.col-15{width:15%}.hmcts-banner>.hmcts-banner__message{font-size:19px;line-height:1.25}.summary-table-font{font-size:36px}`]\n})\nexport class CaseTransactionsComponent implements OnInit {\n takePayment: boolean;\n ccdCaseNumber: string;\n excReference: string;\n paymentGroups: any[] = [];\n payments: IPayment[] = [];\n nonPayments: IPayment[] = [];\n allPayments: IPayment[] = [];\n remissions: IRemission[] = [];\n fees: IFee[] = [];\n errorMessage: string;\n totalFees: number;\n totalPayments: number;\n totalNonOffPayments: number;\n totalRemissions: number;\n selectedOption: string;\n dcnNumber: string;\n paymentRef: string;\n isTurnOff: boolean;\n isStrategicFixEnable: boolean;\n isAddFeeBtnEnabled: boolean = true;\n isExceptionRecord: boolean = false;\n isUnprocessedRecordSelected: boolean = false;\n exceptionRecordReference: string;\n isAnyFeeGroupAvilable: boolean = true;\n isHistoricGroupAvailable: boolean = false;\n isBulkScanEnable;\n isRemissionsMatch: boolean;\n viewStatus = 'main';\n isRemoveBtnDisabled: boolean = false;\n feeId:IFee;\n clAmountDue: number = 0;\n unprocessedRecordCount: number;\n isFeeRecordsExist: boolean = false;\n isGrpOutstandingAmtPositive: boolean = false;\n totalRefundAmount: Number;\n caseType: String;\n lsCcdNumber: any = ls.get<any>('ccdNumber');\n constructor(private router: Router,\n private paymentViewService: PaymentViewService,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private caseTransactionsService: CaseTransactionsService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.isGrpOutstandingAmtPositive = false;\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.caseType = this.paymentLibComponent.CASETYPE;\n if(this.paymentLibComponent.CCD_CASE_NUMBER === '') {\n this.ccdCaseNumber = this.paymentLibComponent.EXC_REFERENCE;\n }\n this.excReference = this.paymentLibComponent.EXC_REFERENCE;\n this.takePayment = this.paymentLibComponent.TAKEPAYMENT;\n this.isBulkScanEnable = this.paymentLibComponent.ISBSENABLE;\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n if(!this.isTurnOff) {\n if(this.lsCcdNumber !== this.ccdCaseNumber) {\n this.router.navigateByUrl(`/ccd-search?takePayment=true`);\n }\n\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.paymentGroups = paymentGroups['payment_groups'];\n this.calculateAmounts();\n this.calculateRefundAmount();\n },\n (error: any) => {\n this.errorMessage = <any>error;\n this.isAnyFeeGroupAvilable = false;\n this.setDefaults();\n }\n );\n } else {\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.paymentGroups = paymentGroups['payment_groups'];\n this.calculateAmounts();\n this.totalRefundAmount = this.calculateRefundAmount();\n },\n (error: any) => {\n this.errorMessage = <any>error;\n this.setDefaults();\n }\n );\n }\n this.checkForExceptionRecord();\n }\n\n setDefaults(): void {\n this.totalPayments = 0.00;\n this.totalRemissions = 0.00;\n this.totalNonOffPayments = 0.00;\n this.totalFees = 0.00;\n}\n\ngetAllocationStatus(payments: any){\n\n let paymentAllocation = payments.payment_allocation,\n isAllocationStatusExist = paymentAllocation.length >0;\n return isAllocationStatusExist ? paymentAllocation[0].allocation_status : '-';\n //return \"-\";\n\n}\n\ncheckForExceptionRecord(): void {\n if(this.paymentGroups.length === 0 && (this.selectedOption.toLocaleLowerCase() === 'ccdorexception' || this.selectedOption.toLocaleLowerCase() === 'rc')) {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n recordData => {\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length > 0 && recordData['data'].ccd_reference >0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length > 0 && recordData['data'].ccd_reference === undefined) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n }\n\n if(recordData['data'] && recordData['data'].exception_record_reference && recordData['data'].exception_record_reference.length === undefined && recordData['data'].ccd_reference >0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n });\n }\n\n if (this.paymentGroups.length === 0 && this.selectedOption.toLocaleLowerCase() === 'dcn') {\n if (this.paymentLibComponent.CCD_CASE_NUMBER.length > 0 && this.paymentLibComponent.EXC_REFERENCE.length > 0) {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n } else if(this.paymentLibComponent.CCD_CASE_NUMBER.length === 0 && this.paymentLibComponent.EXC_REFERENCE.length > 0) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n } else {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n }\n if (this.paymentGroups.length > 0)\n this.paymentGroups.forEach(paymentGroup => {\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.case_reference !== undefined && payment.ccd_case_number === undefined) {\n this.isExceptionRecord = true;\n this.isAddFeeBtnEnabled = false;\n } else {\n this.isExceptionRecord = false;\n this.isAddFeeBtnEnabled = true;\n }\n\n });\n }\n });\n}\n\n calculateAmounts(): void {\n let feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00,\n nonOffLinePayment = 0.00;\n\n this.paymentGroups.forEach(paymentGroup => {\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n if(fee.date_created) {\n let a = fee.amount_due === undefined;\n let b = fee.amount_due <= 0;\n this.clAmountDue = a ? this.clAmountDue + fee.net_amount : b ? this.clAmountDue + 0 : this.clAmountDue + fee.amount_due;\n }\n fee['payment_group_reference'] = paymentGroup['payment_group_reference'];\n this.fees.push(fee);\n } else {\n feesTotal = feesTotal + fee.calculated_amount;\n this.fees.push(fee);\n }\n\n });\n }\n if(this.isTurnOff){\n this.totalFees = feesTotal;\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n let allocationLen = payment.payment_allocation;\n\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n if(allocationLen.length === 0 || allocationLen.length > 0 && allocationLen[0].allocation_status ==='Allocated') {\n nonOffLinePayment = nonOffLinePayment + payment.amount;\n }\n if( allocationLen.length > 0 ) {\n this.nonPayments.push(payment);\n }\n }\n if(allocationLen.length === 0) {\n this.payments.push(payment);\n }\n payment.paymentGroupReference = paymentGroup.payment_group_reference\n this.allPayments.push(payment);\n } else {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n this.payments.push(payment);\n }\n payment.paymentGroupReference = paymentGroup.payment_group_reference\n this.allPayments.push(payment);\n }\n });\n }\n this.totalPayments = paymentsTotal;\n // new feature Apportionment toggle changes\n if(!this.isTurnOff){\n this.totalNonOffPayments = nonOffLinePayment;\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remisison => {\n remissionsTotal = remissionsTotal + remisison.hwf_amount;\n this.remissions.push(remisison);\n });\n }\n this.totalRemissions = remissionsTotal;\n });\n\n }\n calculateRefundAmount() {\n if(!this.isTurnOff){\n let isNewPaymentGroup = false;\n\n this.paymentGroups.forEach((paymentGroup, index) => {\n let grpOutstandingAmount = 0.00,\n feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00,\n fees = [];\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n\n this.isRemissionsMatch = false;\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n\n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n\n if(fee.date_created) {\n isNewPaymentGroup = true;\n }else {\n this.isHistoricGroupAvailable = true;\n this.paymentGroups[index]['old'] = true;\n }\n });\n this.paymentGroups[index].fees = fees;\n }\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n }\n grpOutstandingAmount = (feesTotal - remissionsTotal) - paymentsTotal;\n if(grpOutstandingAmount > 0 && isNewPaymentGroup) {\n this.isAnyFeeGroupAvilable = true;\n this.paymentRef = paymentGroup.payment_group_reference;\n }\n if(paymentGroup.fees && paymentGroup.fees.length > 0 && grpOutstandingAmount <= 0 && isNewPaymentGroup) {\n this.isAnyFeeGroupAvilable = false;\n }\n });\n if((!isNewPaymentGroup && this.isHistoricGroupAvailable) || (!isNewPaymentGroup && !this.isHistoricGroupAvailable)) {\n this.isAnyFeeGroupAvilable = false;\n }\n } else {\n let totalRefundAmount = 0,\n isFeeAmountZero = false;\n this.paymentGroups.forEach(paymentGroup => {\n let grpOutstandingAmount = 0.00,\n feesTotal = 0.00,\n paymentsTotal = 0.00,\n remissionsTotal = 0.00;\n if (paymentGroup.fees) {\n this.isFeeRecordsExist = true;\n paymentGroup.fees.forEach(fee => {\n feesTotal = feesTotal + fee.calculated_amount;\n if(fee.calculated_amount === 0) {\n isFeeAmountZero = true\n }\n });\n\n }\n\n if (paymentGroup.payments) {\n paymentGroup.payments.forEach(payment => {\n if (payment.status.toUpperCase() === 'SUCCESS') {\n paymentsTotal = paymentsTotal + payment.amount;\n }\n });\n }\n\n if (paymentGroup.remissions) {\n paymentGroup.remissions.forEach(remission => {\n remissionsTotal = remissionsTotal + remission.hwf_amount;\n });\n }\n grpOutstandingAmount = (feesTotal - remissionsTotal) - paymentsTotal;\n if (grpOutstandingAmount < 0) {\n if(totalRefundAmount === 0) {\n totalRefundAmount = grpOutstandingAmount;\n } else {\n totalRefundAmount = (totalRefundAmount + grpOutstandingAmount);\n }\n }\n else if(grpOutstandingAmount > 0 || (grpOutstandingAmount === 0 && isFeeAmountZero)) {\n this.isGrpOutstandingAmtPositive = true;\n }\n });\n return totalRefundAmount * -1;\n }\n }\n\n getGroupOutstandingAmount(paymentGroup: IPaymentGroup): number {\n return this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);;\n }\n\n redirectToFeeSearchPage(event: any) {\n event.preventDefault();\n if(!this.isAnyFeeGroupAvilable || this.isTurnOff) {\n let url = this.isBulkScanEnable ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n url += this.isTurnOff ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n url += this.isStrategicFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n url +=`&caseType=${this.caseType}`;\n\n this.router.navigateByUrl(`/fee-search?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}${url}`);\n } else {\n this.paymentLibComponent.bspaymentdcn = null;\n this.paymentLibComponent.paymentGroupReference = this.paymentRef;\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.viewName = 'fee-summary';\n }\n }\n\n redirectToReportsPage(event: any) {\n event.preventDefault();\n this.router.navigateByUrl(`/reports?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}`);\n }\n loadFeeSummaryPage(paymentGroup: IPaymentGroup) {\n this.paymentLibComponent.bspaymentdcn = null;\n this.paymentLibComponent.paymentGroupReference = paymentGroup.payment_group_reference;\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.viewName = 'fee-summary';\n }\n\n goToPaymentViewComponent(paymentGroup: any) {\n this.paymentLibComponent.paymentMethod = paymentGroup.paymentMethod;\n this.paymentLibComponent.paymentGroupReference = paymentGroup.paymentGroupReference;\n this.paymentLibComponent.paymentReference = paymentGroup.paymentReference;\n this.paymentLibComponent.viewName = 'payment-view';\n }\n\n goToPayementView(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.goToPaymentViewComponent({paymentGroupReference, paymentReference, paymentMethod});\n }\n\n selectedUnprocessedFeeEvent(unprocessedRecordId: string) {\n if ( unprocessedRecordId ) {\n if(this.isTurnOff) {\n this.isAddFeeBtnEnabled = false;\n }\n this.isUnprocessedRecordSelected = true;\n } else {\n if(this.isTurnOff) {\n this.isAddFeeBtnEnabled = true;\n }\n this.isUnprocessedRecordSelected = false;\n }\n }\n getUnprocessedFeeCount(unProcessedRecordCount: number) {\n this.unprocessedRecordCount = unProcessedRecordCount;\n }\n\n calculateAmountDue(fee: IFee) {\n\n if(fee.date_created) {\n return fee.amount_due !== undefined? fee.amount_due : fee.net_amount;\n } else {\n return \"0.00\";\n }\n }\n\n confirmRemoveFee(fee: IFee){\n this.isRemoveBtnDisabled = false;\n this.feeId = fee;\n this.viewStatus = 'feeRemovalConfirmation';\n }\n cancelRemoval() {\n this.viewStatus = 'main';\n }\n removeFee(fee: any){\n this.isRemoveBtnDisabled = true;\n this.paymentViewService.deleteFeeFromPaymentGroup(fee).subscribe(\n (success: any) => {\n window.location.reload();\n },\n (error: any) => {\n this.errorMessage = error;\n this.isRemoveBtnDisabled = false;\n }\n );\n }\n\n isCheckAmountdueExist(amountDue: any) {\n return typeof amountDue === 'undefined';\n }\n}\n","export class PaymentToPayhubRequest {\n currency = 'GBP';\n description = 'PayBubble payment';\n channel = 'telephony';\n provider = 'pci pal';\n case_type: string;\n\n ccd_case_number: string;\n amount: number;\n\n constructor(ccd_case_number: string, amount: number, caseType: string) {\n this.ccd_case_number = ccd_case_number;\n this.amount = <any>amount.toFixed(2);\n this.case_type= caseType;\n }\n}\n","export class PayhubAntennaRequest {\n currency = 'GBP';\n case_type: string;\n ccd_case_number: string;\n amount: number;\n\n constructor(ccd_case_number: string, amount: number, caseType: string) {\n this.ccd_case_number = ccd_case_number;\n this.amount = <any>amount.toFixed(2);\n this.case_type= caseType;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { IPaymentGroup } from '../../interfaces/IPaymentGroup';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { IRemission } from '../../interfaces/IRemission';\nimport { IFee } from '../../interfaces/IFee';\nimport { PaymentToPayhubRequest } from '../../interfaces/PaymentToPayhubRequest';\nimport { PayhubAntennaRequest } from '../../interfaces/PayhubAntennaRequest';\nimport { SafeHtml } from '@angular/platform-browser';\nimport {Router} from '@angular/router';\nimport {Location} from '@angular/common';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-fee-summary',\n template: `\n<div class=\"govuk-breadcrumbs\" *ngIf=\"isBackButtonEnable\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\" *ngIf=\"!isTurnOff\">\n <a (click)=\"loadCaseTransactionPage()\" class=\"govuk-back-link govuk-label\">Back</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\" *ngIf=\"isTurnOff\">\n <a (click)=\"redirectToFeeSearchPage($event,'summary')\" class=\"govuk-back-link govuk-label\">Back</a>\n </li>\n </ol>\n</div>\n<div class=\"fee-summary\" *ngIf=\"viewStatus === 'main'\">\n <main class=\"govuk-main-wrapper\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEESUMMARY'>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"heading-xlarge\">Fee Summary</h1>\n </div>\n\n\n  <div class=\"govuk-grid-column-one-third\" align=\"right\">\n       <button *ngIf=\"!isTurnOff\" (click)=\"redirectToFeeSearchPage($event,'summary')\"\n       [disabled]=\"isPaymentExist\"\n       [ngClass]='isPaymentExist ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'>\n Add a new fee\n </button>\n\n <a *ngIf=\"isTurnOff\" (click)=\"redirectToFeeSearchPage($event,'summary')\" class=\"button\">Add a new fee</a>\n </div>\n </div>\n\n\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Payment Group details could not be retrieved\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n\n <table class=\"govuk-table\" *ngIf=\"!errorMessage && paymentGroup\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Fee Code</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Fee description</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\">Remission code</th>\n <th class=\"govuk-table__header govuk-!-font-weight-bold\" scope=\"col\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell\">{{ fee.code }}</td>\n <td class=\"govuk-table__cell\">{{ fee.description }}</td>\n <td class=\"govuk-table__cell\">{{ getRemissionByFeeCode(fee.code)?.hwf_reference }}</td>\n <td class=\"govuk-table__cell grey-text\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Fee amount:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"!isTurnOff\">\n <a (click)=\"confirmRemoveFee(fee.id)\" [ngClass]='isPaymentExist || fee.remissions ? \"disable-link\" : \"\"'>remove fee</a>\n </td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"isTurnOff\">\n <a (click)=\"confirmRemoveFee(fee.id)\">remove fee</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"fee.volume && fee.volume > 0\">\n <td class=\"no-border grey-text subcolumn-1\">Volume:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.volume }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Fee total:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Remission amount:</td>\n <td class=\"no-border subcolumn-2\">{{ getRemissionByFeeCode(fee.code)?.hwf_amount? ( getRemissionByFeeCode(fee.code)?.hwf_amount | currency:'GBP':'symbol-narrow':'1.2-2') : '-' }}</td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"!isTurnOff\">\n <a (click)=\"addRemission(fee)\" *ngIf=\"(getRemissionByFeeCode(fee.code)?.hwf_amount === 0 || !getRemissionByFeeCode(fee.code)?.hwf_amount) && !isPaymentExist\">\n Deduct remission\n </a>\n </td>\n <td class=\"no-border subcolumn-3\" *ngIf=\"isTurnOff\">\n <a (click)=\"addRemission(fee)\" *ngIf=\"getRemissionByFeeCode(fee.code)?.hwf_amount === 0 || !getRemissionByFeeCode(fee.code)?.hwf_amount\">\n Deduct remission\n </a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border grey-text subcolumn-1\">Total after remission:</td>\n <td class=\"no-border subcolumn-2\">{{ fee.net_amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n </table>\n </td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border govuk-!-font-weight-bold subcolumn-1\">Total payment</td>\n <td class=\"no-border subcolumn-2\">{{ totalAfterRemission - outStandingAmount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border govuk-!-font-weight-bold subcolumn-1\">Total outstanding amount</td>\n <td class=\"no-border subcolumn-2\">{{ outStandingAmount | currency:'GBP':'symbol-narrow':'1.2-2'}}</td>\n <td class=\"no-border subcolumn-3\"></td>\n </tr>\n </table>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!bsPaymentDcnNumber\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n </td>\n </tr>\n </tbody>\n <tr class=\"govuk-table__row\">\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\"></td>\n <td class=\"no-border\">\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"no-border subcolumn-2\">\n <button *ngIf=\"!bsPaymentDcnNumber\" type=\"submit\" (click)=\"takePayment()\"\n [disabled]=\"totalFee <= 0 || !platForm || isConfirmationBtnDisabled\"\n [ngClass]='totalFee <= 0 || !platForm || isConfirmationBtnDisabled? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'>\n Take payment\n </button>\n <button *ngIf=\"bsPaymentDcnNumber\" type=\"button\" (click)=\"goToAllocatePage(outStandingAmount, isFeeAmountZero)\" class=\"button govuk-!-margin-right-1\">\n <span *ngIf=\"outStandingAmount > 0 || (isFeeAmountZero && outStandingAmount === 0)\">\n Allocate payment\n </span>\n <span *ngIf=\"outStandingAmount < 0 || (!isFeeAmountZero && outStandingAmount === 0)\">\n Continue\n </span>\n </button>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n</main>\n</div>\n\n <ng-container *ngIf=\"viewStatus === 'feeRemovalConfirmation'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='FEEREMOVALCONFIRMATION_1'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to delete this fee?\n </strong>\n </div>\n <div class=\"govuk-button-grb\">\n <form novalidate>\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemission()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"button\"\n [disabled]=\"isRemoveBtnDisabled\"\n [ngClass]='isRemoveBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"removeFee(currentFee)\">\n Remove\n </button>\n </form>\n </div>\n </ng-container>\n<ccpay-add-remission *ngIf=\"viewStatus === 'add_remission' && currentFee\"\n [isTurnOff]=\"isTurnOff\"\n [isStrategicFixEnable]=\"isStrategicFixEnable\"\n [fee]=\"currentFee\"\n [caseType]=\"caseType\"\n [ccdCaseNumber]=\"ccdCaseNumber\"\n [paymentGroupRef]=\"paymentGroupRef\"\n (cancelRemission)=\"cancelRemission()\"></ccpay-add-remission>\n <input *ngIf=\"viewStatus === 'payhub_view' && payhubHtml\" #myInput type='hidden' id='iFrameDrivenImageValue' value='PCIPAL'>\n`,\n styles: [`.fee-summary .grey-text{color:#6b7376;font-weight:500}.fee-summary .govuk-table{margin-bottom:0}.fee-summary .no-border{border:none;border-bottom:none}.fee-summary table td,.fee-summary table th{font-size:15px;font-weight:500;vertical-align:top;max-width:320px}.fee-summary table td .no-padding,.fee-summary table th .no-padding{padding:0}.fee-summary table td .subcolumn-1,.fee-summary table th .subcolumn-1{width:45%}.fee-summary table td .subcolumn-2,.fee-summary table th .subcolumn-2{width:25%;text-align:right}.fee-summary table td .subcolumn-3,.fee-summary table th .subcolumn-3{width:30%;text-align:center}.govuk-button-grb{padding-bottom:20px}.govuk-button-grb .govuk-button--secondary{background-color:#dee0e2;box-shadow:0 2px 0 #858688;color:#0b0c0c;margin-right:10px}.govuk-form-group--mg{margin-top:10px!important}.govuk-fieldset__heading--fz{font-size:16px}.remissionDisable{color:grey;cursor:default}.heading-xlarge{margin:0 0 14px -20px}.govuk-select--custom{width:50%}.disable-link{cursor:default;pointer-events:none;color:#8e8c8c}`]\n})\n\nexport class FeeSummaryComponent implements OnInit {\n @Input() paymentGroupRef: string;\n @Input() ccdCaseNumber: string;\n @Input() isTurnOff: string;\n @Input() caseType: string;\n\n\n bsPaymentDcnNumber: string;\n paymentGroup: IPaymentGroup;\n errorMessage: string;\n viewStatus = 'main';\n currentFee: IFee;\n totalFee: number;\n payhubHtml: SafeHtml;\n service: string = \"\";\n platForm: string = \"\";\n upPaymentErrorMessage: string;\n selectedOption:string;\n isBackButtonEnable: boolean = true;\n outStandingAmount: number;\n isFeeAmountZero: boolean = false;;\n totalAfterRemission: number = 0;\n isConfirmationBtnDisabled: boolean = false;\n isRemoveBtnDisabled: boolean = false;\n isPaymentExist: boolean = false;\n isRemissionsExist: Boolean = false;\n isRemissionsMatch = false;\n isStrategicFixEnable: boolean;\n\n constructor(\n private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private location: Location,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent\n ) {}\n\n ngOnInit() {\n this.viewStatus = 'main';\n this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n\n this.platForm = 'Antenna';\n\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n if (this.bsPaymentDcnNumber) {\n this.getUnassignedPaymentlist();\n }\n this.getPaymentGroup();\n }\n\n getUnassignedPaymentlist() {\n if (this.selectedOption === 'dcn') {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.paymentLibComponent.DCN_NUMBER).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'].payments) {\n this.service = unassignedPayments['data'].responsible_service_id;\n } else {\n this.upPaymentErrorMessage = 'error';\n }\n },\n (error: any) => this.upPaymentErrorMessage = error\n );\n } else {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'].payments) {\n this.service = unassignedPayments['data'].responsible_service_id;\n } else {\n this.upPaymentErrorMessage = 'error';\n }\n },\n (error: any) => this.upPaymentErrorMessage = error\n );\n }\n\n }\n\n getRemissionByFeeCode(feeCode: string): IRemission {\n if (this.paymentGroup && this.paymentGroup.remissions && this.paymentGroup.remissions.length > 0) {\n for (const remission of this.paymentGroup.remissions) {\n if (remission.fee_code === feeCode) {\n return remission;\n }\n }\n }\n return null;\n }\n\n addRemission(fee: IFee) {\n this.currentFee = fee;\n this.viewStatus = 'add_remission';\n }\n\n getPaymentGroup() {\n let fees = [];\n this.paymentViewService.getPaymentGroupDetails(this.paymentGroupRef).subscribe(\n paymentGroup => {\n this.paymentGroup = paymentGroup;\n this.isPaymentExist = paymentGroup.payments ? paymentGroup.payments.length > 0 : false;\n this.isRemissionsExist = paymentGroup.remissions ? paymentGroup.remissions.length > 0 : false;\n\n if (paymentGroup.fees) {\n paymentGroup.fees.forEach(fee => {\n this.totalAfterRemission = this.totalAfterRemission + fee.net_amount;\n if(fee.calculated_amount === 0) {\n this.isFeeAmountZero = true;\n }\n this.isRemissionsMatch = false;\n paymentGroup.remissions.forEach(rem => {\n if(rem.fee_code === fee.code) {\n this.isRemissionsMatch = true;\n fee['remissions'] = rem;\n fees.push(fee);\n }\n });\n\n if(!this.isRemissionsMatch) {\n fees.push(fee);\n }\n });\n paymentGroup.fees = fees;\n }\n\n this.outStandingAmount = this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);\n },\n (error: any) => this.errorMessage = error\n );\n }\n\n confirmRemoveFee(fee: IFee){\n this.isRemoveBtnDisabled = false;\n this.currentFee = fee;\n this.viewStatus = 'feeRemovalConfirmation';\n }\n\n removeFee(fee: any){\n this.isRemoveBtnDisabled = true;\n this.paymentViewService.deleteFeeFromPaymentGroup(fee).subscribe(\n (success: any) => {\n if (this.paymentGroup.fees && this.paymentGroup.fees.length > 1){\n this.totalAfterRemission = 0;\n this.getPaymentGroup();\n this.viewStatus = 'main';\n return;\n }\n this.loadCaseTransactionPage();\n },\n (error: any) => {\n this.errorMessage = error;\n this.isRemoveBtnDisabled = false;\n }\n );\n }\n\n loadCaseTransactionPage() {\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n\n let partUrl = `selectedOption=${this.paymentLibComponent.SELECTED_OPTION}`;\n partUrl +=this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl +=this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl +=this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl +=this.paymentLibComponent.ISSFENABLE ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n partUrl +=`&caseType=${this.paymentLibComponent.CASETYPE}`;\n\n let url = `/payment-history/${this.ccdCaseNumber}?view=case-transactions&takePayment=true&${partUrl}`;\n this.router.navigateByUrl(url);\n }\n cancelRemission() {\n this.viewStatus = 'main';\n }\n redirectToFeeSearchPage(event: any, page?: string) {\n event.preventDefault();\n let partUrl =this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl +=this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl +=this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl +=this.paymentLibComponent.ISSFENABLE ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n partUrl +=`&caseType=${this.paymentLibComponent.CASETYPE}`;\n\n if(this.viewStatus === 'feeRemovalConfirmation' || this.viewStatus === 'add_remission') {\n this.viewStatus = 'main';\n return;\n }\n let url = `/fee-search?ccdCaseNumber=${this.ccdCaseNumber}&selectedOption=${this.paymentLibComponent.SELECTED_OPTION}&paymentGroupRef=${this.paymentGroupRef}${partUrl}`;\n this.router.navigateByUrl(url);\n }\n takePayment() {\n this.isConfirmationBtnDisabled = true;\n const requestBody = new PaymentToPayhubRequest(this.ccdCaseNumber, this.outStandingAmount, this.caseType),\n antennaReqBody = new PayhubAntennaRequest(this.ccdCaseNumber, this.outStandingAmount, this.caseType);\n\n if(this.platForm === 'Antenna') {\n\n this.paymentViewService.postPaymentAntennaToPayHub(antennaReqBody, this.paymentGroupRef).subscribe(\n response => {\n this.isBackButtonEnable=false;\n window.location.href = '/makePaymentByTelephoneyProvider';\n },\n (error: any) => {\n this.errorMessage = error;\n this.isConfirmationBtnDisabled = false;\n this.router.navigateByUrl('/pci-pal-failure');\n }\n );\n }\n\n }\n\n goToAllocatePage(outStandingAmount: number, isFeeAmountZero: Boolean) {\n if (outStandingAmount > 0 || (outStandingAmount === 0 && isFeeAmountZero)) {\n this.paymentLibComponent.paymentGroupReference = this.paymentGroupRef;\n this.paymentLibComponent.viewName = 'allocate-payments';\n } else {\n this.loadCaseTransactionPage();\n }\n }\n isCheckAmountdueExist(amountDue: any) {\n return typeof amountDue === 'undefined';\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\n\n\n\n@Component({\n selector: 'ccpay-error-banner',\n template: `<div class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title govuk-error-summary__title-custom\" id=\"error-summary-title\">\n {{errorMessage.title}}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n {{errorMessage.body}}\n </li>\n </ul>\n </div>\n</div>`,\n styles: [`.govuk-error-summary h2{font-size:24px}.govuk-error-summary__list li{font-size:19px}`]\n})\n\nexport class ErrorBannerComponent implements OnInit {\n @Input('errorMessage') errorMessage;\n\n constructor(\n ) {}\n\n ngOnInit() {\n\n }\n}\n","\nexport class UnidentifiedPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n unidentified_reason: string;\n\n constructor(payment_group_reference: string, payment_reference : string, unidentified_reason: any) {\n this.payment_allocation_status = {\n description: '',\n name: \"Unidentified\"\n };\n this.payment_group_reference = payment_group_reference ;\n this.payment_reference= payment_reference;\n this.unidentified_reason= unidentified_reason;\n\n }\n\n\n\n}\n","import { IBSPayments } from \"./IBSPayments\";\n\nexport class AllocatePaymentRequest {\n amount: Number;\n banked_date: String;\n ccd_case_number: String;\n exception_record: string;\n currency: String;\n document_control_number: String;\n external_provider: String;\n giro_slip_no: String;\n payer_name: String;\n payment_channel: Object;\n payment_status: Object;\n payment_method: String;\n case_type: String;\n payment_allocation_dto?: {\n allocation_reason: String,\n allocation_status: String,\n explanation: String,\n payment_allocation_status: Object,\n payment_group_reference: String,\n payment_reference: String,\n reason: String,\n receiving_office: String,\n unidentified_reason: String,\n user_id: String,\n user_name: String,\n case_type: String\n }\n\n constructor(ccd_case_number : string, unAllocatedPayment: IBSPayments, caseType: string, exceptionRecord: string, allocatedRequest?: any) {\n this.amount = unAllocatedPayment.amount;\n this.banked_date = unAllocatedPayment.date_banked;\n this.ccd_case_number = ccd_case_number;\n this.exception_record = exceptionRecord;\n this.currency= unAllocatedPayment.currency;\n this.document_control_number = unAllocatedPayment.dcn_reference;\n this.external_provider = 'exela';\n this.giro_slip_no = unAllocatedPayment.bgc_reference;\n this.payer_name = unAllocatedPayment.payer_name;\n this.payment_channel = {\n description: '',\n name: 'bulk scan'\n };\n this.payment_status ={\n description: 'bulk scan payment completed',\n name: 'success'\n }\n this.payment_method = unAllocatedPayment.payment_method;\n this.case_type= caseType;\n if(allocatedRequest) {\n this.payment_allocation_dto = allocatedRequest;\n }\n\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {BulkScaningPaymentService} from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { UnidentifiedPaymentsRequest } from '../../interfaces/UnidentifiedPaymentsRequest';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\n\n@Component({\n selector: 'app-mark-unidentified-payment',\n template: `<div class=\"mkpay-unidentified\" >\n <div *ngIf=\"viewStatus === 'mainForm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='MARKUNIDENTIFIED'>\n <h1 class=\"heading-large\">Mark payment as unidentified</h1>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n \n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{unassignedRecord.dcn_reference}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n </table>\n </div>\n <form [formGroup]=\"markPaymentUnidentifiedForm\" novalidate>\n <div class=\"govuk-form-group\">\n <p class=\"unidentifiedSubText\">\n Give a reason for marking this payment as unidentified.\n <br/>\n Include any investigations you've made.\n </p>\n <label class=\"heading-small\" for=\"investicationDetail\">\n\n </label>\n <textarea class=\"form-control form-control-3-4\" [ngClass]=\"{'inline-error-class': isInvesticationDetailEmpty || investicationDetailHasError || investicationDetailMinHasError || investicationDetailMaxHasError}\" name=\"investicationDetail\" id=\"investicationDetail\" rows=\"5\" formControlName=\"investicationDetail\">\n </textarea>\n <p class=\"inline-error-message\" *ngIf=\"isInvesticationDetailEmpty || investicationDetailHasError || investicationDetailMinHasError || investicationDetailMaxHasError\">\n <span *ngIf=\"isInvesticationDetailEmpty\">Enter a reason for marking this payment as unidentified.</span>\n <span *ngIf=\"investicationDetailHasError\">Enter a vaild reason</span>\n <span *ngIf=\"investicationDetailMinHasError\">Reason should be at least 3 characters.</span>\n <span *ngIf=\"investicationDetailMaxHasError\">Reason should be 255 characters or under.</span>\n </p>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"saveAndContinue()\">\n Continue\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments('cancel')\">\n Cancel\n </button>\n </div>\n </form>\n </div>\n <ng-container *ngIf=\"viewStatus === 'unidentifiedContinueConfirm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='UNIDENTIFIEDCONFIRMATION'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n <h1 class=\"heading-small\"> Are you sure you want to mark this payment as unidentified? </h1>\n \n </strong>\n\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Investigations</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{investigationComment}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" [disabled]=\"isConfirmButtondisabled\" (click)=\"confirmPayments()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments()\">\n Cancel\n </button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'unidentifiedCancelConfirm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CANCELUNIDENTIFIED'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to cancel?\n </strong>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"gotoCasetransationPage()\">\n Yes\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnidentifiedPayments()\">\n No\n </button>\n </div>\n </ng-container>\n</div>\n`,\n styles: [`.mkpay-unidentified{margin:10px 0 20px}.mkpay-unidentified .govuk-button--group .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.mkpay-unidentified .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.mkpay-unidentified .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.govuk-grid-column-full{padding:0}.unidentifiedSubText{line-height:45px}.govuk-warning-text__text{font-size:19px}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}`]\n})\nexport class MarkUnidentifiedPaymentComponent implements OnInit {\n @Input() caseType: string;\n markPaymentUnidentifiedForm: FormGroup;\n viewStatus: string;\n ccdCaseNumber: string;\n bspaymentdcn: string;\n isInvesticationDetailEmpty: boolean = false;\n investicationDetailHasError: boolean = false;\n investicationDetailMinHasError: boolean = false;\n investicationDetailMaxHasError: boolean = false;\n errorMessage = this.getErrorMessage(false);\n unassignedRecord:IBSPayments;\n siteID: string = null;\n investigationComment: string;\n isConfirmButtondisabled:Boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n isStrategicFixEnable: boolean = true;\n\n constructor(private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.getUnassignedPayment();\n\n this.markPaymentUnidentifiedForm = this.formBuilder.group({\n investicationDetail: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ]))\n });\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n this.errorMessage = this.getErrorMessage(false);\n this.unassignedRecord = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n saveAndContinue() {\n this.resetForm([false, false, false, false]);\n const investicationField = this.markPaymentUnidentifiedForm.controls.investicationDetail;\n const formerror = investicationField.errors;\n if (this.markPaymentUnidentifiedForm.dirty && this.markPaymentUnidentifiedForm.valid) {\n this.investigationComment = this.markPaymentUnidentifiedForm.controls.investicationDetail.value;\n this.viewStatus = 'unidentifiedContinueConfirm';\n }else {\n if(investicationField.value == '' ) {\n this.resetForm([true, false, false, false]);\n }\n if(investicationField.value != '' && investicationField.invalid ) {\n this.resetForm([false, true, false, false]);\n }\n if(formerror && formerror.minlength && formerror.minlength.actualLength < 3 ) {\n this.resetForm([false, false, true, false]);\n }\n if(formerror && formerror.maxlength && formerror.maxlength.actualLength > 255 ) {\n this.resetForm([false, false, false, true]);\n }\n }\n }\n resetForm(val) {\n this.isInvesticationDetailEmpty = val[0];\n this.investicationDetailHasError = val[1];\n this.investicationDetailMinHasError = val[2];\n this.investicationDetailMaxHasError = val[3];\n }\n confirmPayments() {\n this.isConfirmButtondisabled = true;\n const reason = this.markPaymentUnidentifiedForm.get('investicationDetail').value;\n\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n allocation_status:'Unidentified',\n payment_allocation_status: {\n description: '',\n name: 'Unidentified'\n },\n unidentified_reason: reason,\n user_id: this.caseType,\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.caseType, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSWoPGStrategic(postStrategicBody).subscribe(\n res => {\n this.errorMessage = this.getErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n });\n } else {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.getErrorMessage(false);\n const requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference)\n this.paymentViewService.postBSPayments(requestBody).subscribe(\n res2 => {\n this.errorMessage = this.getErrorMessage(false);\n const response2 = JSON.parse(res2),\n reqBody = new UnidentifiedPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, reason);\n if (response2.success) {\n this.paymentViewService.postBSUnidentifiedPayments(reqBody).subscribe(\n res3 => {\n this.errorMessage = this.getErrorMessage(false);\n const response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n }\n cancelMarkUnidentifiedPayments(type?:string){\n if(type && type === 'cancel') {\n if(this.markPaymentUnidentifiedForm.get('investicationDetail').value!==\"\"){\n this.viewStatus = 'unidentifiedCancelConfirm';\n } else {\n this.gotoCasetransationPage();\n }\n } else {\n this.viewStatus = 'mainForm';\n }\n }\n\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n getErrorMessage(isErrorExist) {\n return {\n title: \"There is a problem with the service\",\n body: \"Try again later\",\n showError: isErrorExist\n };\n }\n}\n","\nexport class UnsolicitedPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n receiving_office: string;\n receiving_email_address: string;\n sending_email_address: string;\n unidentified_reason: string;\n constructor(payment_group_reference: string, payment_reference : string, reason: string,responsible_office: string, responsible_person:string,email_id: string) {\n this.payment_allocation_status = {\n description: '',\n name: \"Transferred\"\n };\n this.payment_group_reference = payment_group_reference;\n this.payment_reference= payment_reference;\n this.unidentified_reason= reason;\n this.receiving_office= responsible_office;\n this.receiving_email_address= email_id;\n this.sending_email_address= responsible_person;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport { UnsolicitedPaymentsRequest } from '../../interfaces/UnsolicitedPaymentsRequest';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { AllocatePaymentRequest } from '../../interfaces/AllocatePaymentRequest';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\n\n\n@Component({\n selector: 'app-mark-unsolicited-payment',\n template: `<div class=\"mkpay-unidentified\">\n <div *ngIf=\"viewStatus === 'mainForm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <h1 class=\"heading-large\">Mark payment as transferred</h1>\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{unassignedRecord.dcn_reference}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <form [formGroup]=\"markPaymentUnsolicitedForm\" novalidate>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='MARKTRANSFERRED'>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label custom-govuk-label custom-govuk-label\" for=\"reason\">\n Reason for payment being marked as transferred \n </label>\n <textarea class=\"form-control form-control-3-4\" [ngClass]=\"{'inline-error-class': reasonHasError || reasonMinHasError || reasonMaxHasError}\" name=\"reason\" id=\"reason\" rows=\"5\" formControlName=\"reason\">\n </textarea>\n <p class=\"inline-error-message\" *ngIf=\"isReasonEmpty || reasonHasError || reasonMinHasError || reasonMaxHasError\">\n <span *ngIf=\"isReasonEmpty\">Enter a reason for marking this payment as transferred.</span>\n <span *ngIf=\"reasonHasError\">Enter a valid reason</span>\n <span *ngIf=\"reasonMinHasError\">Reason should be at least 3 characters.</span>\n <span *ngIf=\"reasonMaxHasError\">Reason should be 255 characters or under.</span>\n </p>\n </div>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label custom-govuk-label\" for=\"responsibleOffice\">\n Receiving Site ID (Receiving court/Bulk centre site ID) \n </label>\n <select class=\"form-control short-input\" id=\"responsibleOffice\" formControlName=\"responsibleOffice\" (change)=\"selectchange($event)\">\n <option value=\"\" selected='selected'>Please select</option>\n <option *ngFor=\"let siteID of siteIDList;\" value=\"{{siteID.siteId}}\">{{siteID.siteName}} ({{siteID.siteId}})</option>\n </select>\n <p class=\"inline-error-message\" *ngIf=\"isResponsibleOfficeEmpty || responsibleOfficeHasError\">\n <span *ngIf=\"isResponsibleOfficeEmpty\">Please select Receiving Site ID</span>\n <span *ngIf=\"responsibleOfficeHasError\">Please select a valid Receiving Site ID</span>\n </p>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" [disabled]=\"isContinueButtondisabled\" class=\"button\" (click)=\"saveAndContinue()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments('cancel')\">\n Cancel\n </button>\n </div>\n </form>\n \n</div>\n <ng-container *ngIf=\"viewStatus === 'unsolicitedContinueConfirm'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n <h1 class=\"heading-small\"> Are you sure you want to mark this payment as transferred? </h1>\n </strong>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='TRANSFERREDCONFIRMATION'>\n <div class=\"govuk-grid-column-full govuk-!-padding-bottom-3\">\n <hr class=\"govuk-section-break govuk-section-break--visible\">\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Reason</td>\n <td class=\"govuk-table__header\" scope=\"col\">Receiving site ID</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">{{reason}}</td>\n <td class=\"govuk-table__cell\">{{selectedSiteName}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" [disabled]=\"isConfirmButtondisabled\" (click)=\"confirmPayments()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments()\">\n Cancel\n </button>\n </div>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'unsolicitedCancelConfirm'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CANCELTRANSFERRED'>\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to cancel?\n </strong>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" class=\"button\" (click)=\"gotoCasetransationPage()\">\n Yes\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelMarkUnsolicitedPayments()\">\n No\n </button>\n </div>\n </ng-container>\n</div>`,\n styles: [`.mkpay-unidentified{margin:10px 0 20px}.mkpay-unidentified .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.mkpay-unidentified .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.mkpay-unidentified .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.custom-govuk-label,.govuk-warning-text__text{font-size:19px}#responsibleOffice{color:#000;width:75%;font-weight:#fff}select option{background:#fff}`]\n})\nexport class MarkUnsolicitedPaymentComponent implements OnInit {\n @Input() caseType: string;\n markPaymentUnsolicitedForm: FormGroup;\n viewStatus: string;\n reasonHasError: boolean = false;\n isReasonEmpty: boolean = false;\n reasonMinHasError: boolean = false;\n reasonMaxHasError: boolean = false;\n responsibleOfficeHasError: boolean = false;\n isResponsibleOfficeEmpty: boolean = false;\n errorMessage = this.getErrorMessage(false);\n ccdCaseNumber: string;\n bspaymentdcn: string;\n unassignedRecord: IBSPayments;\n siteID: string = null;\n reason: string;\n responsiblePerson: string;\n responsibleOffice: string;\n emailId: string;\n isConfirmButtondisabled: Boolean = false;\n isContinueButtondisabled: Boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n selectedSiteId: string;\n selectedSiteName: string;\n isStrategicFixEnable: boolean = true;\n siteIDList;\n\n constructor(private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.resetForm([false,false,false,false,false,false], 'all');\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.getUnassignedPayment();\n\n this.paymentViewService.getSiteID().subscribe(\n siteids => {\n this.isContinueButtondisabled = false;\n this.errorMessage = this.getErrorMessage(false);\n this.siteIDList = JSON.parse(siteids);\n },\n err => {\n window.scrollTo(0, 0);\n this.isContinueButtondisabled = true;\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n \n this.markPaymentUnsolicitedForm = this.formBuilder.group({\n reason: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ])),\n responsibleOffice: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9\\\\s\\\\n,\\\\.-:]*)$')\n ])),\n responsiblePerson: new FormControl(''),\n emailId: new FormControl('')\n });\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n confirmPayments() {\n this.isConfirmButtondisabled = true;\n const controls = this.markPaymentUnsolicitedForm.controls;\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n allocation_status:'Transferred',\n payment_allocation_status: {\n description: '',\n name: 'Transferred'\n },\n unidentified_reason: controls.reason.value,\n receiving_office: this.selectedSiteId,\n user_id: this.caseType,\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.caseType, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSWoPGStrategic(postStrategicBody).subscribe(\n res => {\n this.errorMessage = this.getErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n });\n } else {\n // controls.responsibleOffice.setValue('P219');\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.getErrorMessage(false);\n const response1 = JSON.parse(res1),\n requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unassignedRecord, this.siteID, this.exceptionReference)\n this.paymentViewService.postBSPayments(requestBody).subscribe(\n res2 => {\n this.errorMessage = this.getErrorMessage(false);\n const response2 = JSON.parse(res2),\n reqBody = new UnsolicitedPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, controls.reason.value, this.selectedSiteId, controls.responsiblePerson.value, controls.emailId.value);\n if (response2.success) {\n this.paymentViewService.postBSUnsolicitedPayments(reqBody).subscribe(\n res3 => {\n this.errorMessage = this.getErrorMessage(false);\n const response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unassignedRecord.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n }\n saveAndContinue() {\n this.resetForm([false,false,false,false,false,false], 'all');\n const formerror = this.markPaymentUnsolicitedForm.controls.reason.errors;\n const reasonField = this.markPaymentUnsolicitedForm.controls.reason;\n //const officeIdField = this.selectedSiteId;\n const officeIdField = this.markPaymentUnsolicitedForm.controls.responsibleOffice;\n if (this.markPaymentUnsolicitedForm.dirty && this.markPaymentUnsolicitedForm.valid) {\n const controls = this.markPaymentUnsolicitedForm.controls;\n this.emailId = controls.emailId.value;\n this.responsibleOffice = officeIdField.value;\n this.responsiblePerson = controls.responsiblePerson.value;\n this.reason = controls.reason.value;\n this.viewStatus = 'unsolicitedContinueConfirm';\n }else {\n if( reasonField.value == '' ) {\n this.resetForm([true,false,false,false,false,false], 'reason');\n }\n if(reasonField.value != '' && this.markPaymentUnsolicitedForm.controls.reason.invalid ) {\n this.resetForm([false,true,false,false,false,false], 'reason');\n }\n if(formerror && formerror.minlength && formerror.minlength.actualLength < 3 ) {\n this.resetForm([false,false,true,false,false,false], 'reason');\n }\n if(formerror && formerror.maxlength && formerror.maxlength.actualLength > 255 ) {\n this.resetForm([false,false,false,true,false,false], 'reason');\n }\n if(officeIdField.value == '') {\n this.resetForm([false,false,false,false,true,false], 'responsibleOffice');\n }\n if(officeIdField.value != '' && officeIdField.invalid) {\n this.resetForm([false,false,false,false,false,true],'responsibleOffice');\n }\n }\n }\n resetForm(val, field) {\n if(field==='reason' || field==='all') {\n this.isReasonEmpty = val[0];\n this.reasonHasError = val[1];\n this.reasonMinHasError = val[2];\n this.reasonMaxHasError = val[3];\n }\n if(field==='responsibleOffice' || field==='all') {\n this.isResponsibleOfficeEmpty = val[4];\n this.responsibleOfficeHasError = val[5];\n }\n }\n\ncancelMarkUnsolicitedPayments(type?:string){\n if(type && type === 'cancel') {\n if(this.checkingFormValue()){\n this.viewStatus = 'unsolicitedCancelConfirm';\n } else {\n this.gotoCasetransationPage();\n }\n } else {\n this.markPaymentUnsolicitedForm.controls.responsibleOffice.setValue('');\n this.viewStatus = 'mainForm';\n }\n }\n checkingFormValue(){\n const formFields = this.markPaymentUnsolicitedForm.value;\n let valueExists = false;\n\n for (var field in formFields) {\n if (formFields.hasOwnProperty(field) && formFields[field] !==\"\") {\n valueExists = true;\n break;\n }\n }\n return valueExists;\n }\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n \n this.unassignedRecord = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n },\n (error: any) => {\n this.errorMessage = this.getErrorMessage(true);\n }\n );\n }\n\n getErrorMessage(isErrorExist) {\n return {\n title: \"Something went wrong.\",\n body: \"Please try again later.\",\n showError: isErrorExist\n };\n }\n\n selectchange(args){ \n this.selectedSiteId = args.target.value; \n this.selectedSiteName = args.target.options[args.target.selectedIndex].text; \n } \n\n}\n","import { Component, OnInit, Output,Input, EventEmitter } from '@angular/core';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { IBSPayments } from '../../interfaces/IBSPayments';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'ccpay-app-unprocessed-payments',\n template: `<div class=\"unprocessed-payments govuk-grid-column-full govuk-!-padding-bottom-3\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='CASETRANSACTION'>\n <h3 class=\"heading-medium\" *ngIf=\"!IS_BUTTON_ENABLE\">Unprocessed payments</h3>\n <h3 class=\"heading-medium\" *ngIf=\"IS_BUTTON_ENABLE\">Unallocated payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\" *ngIf=\"IS_BUTTON_ENABLE && !isTurnOff\">Select</td>\n <td class=\"govuk-table__header\" scope=\"col\" *ngIf=\"IS_BUTTON_ENABLE && isTurnOff\"><a href=\"#\" (click)=\"unprocessedPaymentUnSelectEvent($event)\">Unselect</a></td>\n\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let unassignedRecord of unassignedRecordList; let i of index;\">\n <td class=\"govuk-table__cell\" *ngIf=\"IS_BUTTON_ENABLE\">\n <div class=\"multiple-choice unprocessed-payments--radio-button\">\n <input id=\"'unpaiedFee'+i+''\"\n aria-label=\"unassignedRecord\"\n name=\"unassignedRecord\"\n type=\"radio\"\n [(ngModel)]=\"recordId\"\n (click)=\"unprocessedPaymentSelectEvent(unassignedRecord.dcn_reference)\"\n value=\"{{unassignedRecord.dcn_reference}}\" />\n <label for=\"radio-inline-1\"></label>\n </div>\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\">\n {{unassignedRecord.dcn_reference}}\n </td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{unassignedRecord.date_banked | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell whitespace-inherit\"> {{unassignedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell whitespace-inherit\"> {{ trimUnderscore(unassignedRecord.payment_method) | lowercase}} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"upPaymentErrorMessage !== null\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No unallocated payments record available</td>\n </tbody>\n </table>\n <div class=\"button-grb\" *ngIf=\"IS_BUTTON_ENABLE && !isTurnOff\">\n <button type=\"button\"\n [disabled]=\"!isAllocatedToNewFeebtnEnabled\"\n [ngClass]=\"!isAllocatedToNewFeebtnEnabled ? 'button govuk-button--secondary button--disabled govuk-!-margin-right-1' : 'button govuk-button--secondary govuk-!-margin-right-1'\" (click)=\"redirectToFeeSearchPage($event)\">\n Allocate to a new fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isAllocateToExistingFeebtnEnabled\"\n [ngClass]='!isAllocateToExistingFeebtnEnabled ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"goToAllocatePage()\">\n Allocate to an existing fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isMarkAsUnidentifiedbtnEnabled\"\n [ngClass]='!isMarkAsUnidentifiedbtnEnabled ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unidentifiedPage')\">\n Mark as unidentified\n </button>\n <button type=\"button\" \n [disabled]=\"!isUnprocessedRecordSelected\"\n [ngClass]='!isUnprocessedRecordSelected ? \"button govuk-button--secondary button--disabled govuk-!-margin-right-1\" : \"button govuk-button--secondary govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unsolicitedPage')\">\n Mark as transferred\n </button> \n </div>\n\n <div class=\"button-grb\" *ngIf=\"IS_BUTTON_ENABLE && isTurnOff\">\n <button type=\"button\"\n [disabled]=\"!isAllocatedToNewFeebtnEnabled\"\n [ngClass]=\"!isAllocatedToNewFeebtnEnabled ? 'button button--disabled govuk-!-margin-right-1' : 'button govuk-!-margin-right-1'\" (click)=\"redirectToFeeSearchPage($event)\">\n Allocate to a new fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isAllocateToExistingFeebtnEnabled\"\n [ngClass]='!isAllocateToExistingFeebtnEnabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"goToAllocatePage()\">\n Allocate to an existing fee\n </button>\n <button type=\"button\" \n [disabled]=\"!isMarkAsUnidentifiedbtnEnabled\"\n [ngClass]='!isMarkAsUnidentifiedbtnEnabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unidentifiedPage')\">\n Mark as unidentified\n </button>\n <button type=\"button\" \n [disabled]=\"!isUnprocessedRecordSelected\"\n [ngClass]='!isUnprocessedRecordSelected ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"' (click)=\"loadUnsolicitedPage('unsolicitedPage')\">\n Mark as transferred\n </button> \n </div>\n</div>\n\n`,\n styles: [`.unprocessed-payments .unprocessed-payments--radio-button{bottom:10px}.disable{text-decoration:none;padding:.526315em .789473em .263157em;cursor:default;color:#fff;background-color:#00823b;pointer-events:none;font-size:1em;line-height:1.25;outline:transparent solid 1px;outline-offset:-1px;-webkit-appearance:none;box-shadow:0 2px 0 #003618}.button.disabled,.button[disabled=disabled],.button[disabled]{zoom:1;opacity:.5}.button.disabled:active,.button[disabled=disabled]:active,.button[disabled]:active{top:0;box-shadow:0 2px 0 #003618}.button[disabled=disabled]{background:#00823b}.lowercase{text-transform:lowercase}.capitalize::first-letter{text-transform:uppercase}.whitespace-inherit{white-space:inherit!important}`]\n})\nexport class UnprocessedPaymentsComponent implements OnInit {\n\n @Input('FEE_RECORDS_EXISTS') FEE_RECORDS_EXISTS: boolean;\n @Input('PAYMENTREF') PAYMENTREF: string;\n @Input('ISTURNOFF') ISTURNOFF: boolean;\n @Input('IS_BUTTON_ENABLE') IS_BUTTON_ENABLE: boolean;\n @Input('IS_OS_AMT_AVAILABLE') IS_OS_AMT_AVAILABLE: boolean;\n @Input('ISSFENABLE') ISSFENABLE: boolean;\n\n @Output() selectedUnprocessedFeeEvent: EventEmitter<string> = new EventEmitter();\n @Output() getUnprocessedFeeCount: EventEmitter<string> = new EventEmitter();\n\n viewStatus = 'main';\n unassignedRecordList: IBSPayments;\n upPaymentErrorMessage: string = null;\n ccdCaseNumber: string;\n recordId: string = null;\n isRecordExist: boolean = false;\n dcnNumber: string = null;\n selectedOption: string;\n isUnprocessedRecordSelected: boolean = false;\n isAllocateToExistingFeebtnEnabled: boolean = false;\n isMarkAsUnidentifiedbtnEnabled: boolean = false;\n isAllocatedToNewFeebtnEnabled: boolean = false;\n isExceptionCase: boolean = false;\n serviceId: string = null;\n isBulkScanEnable;\n isTurnOff: boolean = true;\n isStFixEnable;\n\n constructor(private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n // Todo ...\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION.toLocaleLowerCase();\n this.dcnNumber = this.paymentLibComponent.DCN_NUMBER;\n this.isBulkScanEnable = this.paymentLibComponent.ISBSENABLE;\n this.isTurnOff = this.paymentLibComponent.ISTURNOFF;\n this.isStFixEnable = this.paymentLibComponent.ISSFENABLE;\n\n this.getUnassignedPaymentlist();\n }\n\n getUnassignedPaymentlist() {\n if (this.selectedOption === 'dcn') {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.dcnNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'] && unassignedPayments['data'].payments) {\n this.setValuesForUnassignedRecord(unassignedPayments['data']);\n } else if(unassignedPayments['payments']) {\n this.setValuesForUnassignedRecord(unassignedPayments);\n } else {\n this.upPaymentErrorMessage = 'error';\n this.getUnprocessedFeeCount.emit('0');\n }\n },\n (error: any) => {\n this.upPaymentErrorMessage = error;\n this.getUnprocessedFeeCount.emit('0');\n }\n );\n } else {\n this.bulkScaningPaymentService.getBSPaymentsByCCD(this.ccdCaseNumber).subscribe(\n unassignedPayments => {\n if(unassignedPayments['data'] && unassignedPayments['data'].payments) {\n this.setValuesForUnassignedRecord(unassignedPayments['data']);\n } else if(unassignedPayments['payments']) {\n this.setValuesForUnassignedRecord(unassignedPayments);\n } else {\n this.upPaymentErrorMessage = 'error';\n this.getUnprocessedFeeCount.emit('0');\n }\n },\n (error: any) => {\n this.upPaymentErrorMessage = error;\n this.getUnprocessedFeeCount.emit('0');\n }\n );\n }\n\n }\n setValuesForUnassignedRecord(unassignedPayments) {\n this.unassignedRecordList = unassignedPayments.payments;\n this.serviceId = unassignedPayments.responsible_service_id;\n if (unassignedPayments['ccd_reference'] === undefined) {\n this.isExceptionCase = true;\n }\n this.isRecordExist = this.unassignedRecordList.length === 0;\n this.getUnprocessedFeeCount.emit(<any>this.unassignedRecordList.length);\n }\n formatUnassignedRecordId(ID: Number) {\n return `unassignrecord-${ID}`;\n }\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n redirectToFeeSearchPage(event: any) {\n event.preventDefault();\n let url = this.isBulkScanEnable ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n url += this.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n url += this.isStFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n url +=`&caseType=${this.paymentLibComponent.CASETYPE}`;\n\n this.router.navigateByUrl(`/fee-search?selectedOption=${this.selectedOption}&ccdCaseNumber=${this.ccdCaseNumber}&dcn=${this.recordId}${url}`);\n }\n loadUnsolicitedPage(viewName: string) {\n this.paymentLibComponent.bspaymentdcn = this.recordId;\n this.paymentLibComponent.viewName = viewName;\n }\n unprocessedPaymentSelectEvent(selectedRecordReference: any) {\n this.isUnprocessedRecordSelected = true;\n this.validateButtons();\n this.selectedUnprocessedFeeEvent.emit(selectedRecordReference);\n }\n goToAllocatePage() {\n this.paymentLibComponent.bspaymentdcn = this.recordId;\n this.paymentLibComponent.unProcessedPaymentServiceId = this.serviceId\n this.paymentLibComponent.isTurnOff = this.ISTURNOFF;\n this.paymentLibComponent.ISSFENABLE = this.isStFixEnable;\n\n if(!this.ISTURNOFF) {\n this.paymentLibComponent.paymentGroupReference = this.PAYMENTREF;\n this.paymentLibComponent.viewName = 'fee-summary';\n }else {\n this.paymentLibComponent.paymentGroupReference = null;\n this.paymentLibComponent.viewName = 'allocate-payments';\n }\n\n }\n\n validateButtons() {\n if ( this.isUnprocessedRecordSelected && this.isExceptionCase) {\n this.isMarkAsUnidentifiedbtnEnabled = true;\n } else if ( this.isUnprocessedRecordSelected && !this.isExceptionCase && !this.FEE_RECORDS_EXISTS) {\n this.isAllocateToExistingFeebtnEnabled = false;\n this.isAllocatedToNewFeebtnEnabled = true;\n } else if( this.isUnprocessedRecordSelected && !this.isExceptionCase && this.FEE_RECORDS_EXISTS ) {\n if(!this.ISTURNOFF) {\n this.isAllocateToExistingFeebtnEnabled = true;\n this.isAllocatedToNewFeebtnEnabled = false;\n } else {\n this.isAllocateToExistingFeebtnEnabled = this.IS_OS_AMT_AVAILABLE;\n this.isAllocatedToNewFeebtnEnabled = true;\n }\n }\n }\n unprocessedPaymentUnSelectEvent(event: any) {\n event.preventDefault();\n this.recordId = null;\n this.isUnprocessedRecordSelected = false;\n this.isAllocateToExistingFeebtnEnabled = false;\n this.isAllocatedToNewFeebtnEnabled = false;\n this.isMarkAsUnidentifiedbtnEnabled = false;\n //this.validateButtons();\n this.selectedUnprocessedFeeEvent.emit('');\n }\n\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport {IPayment} from '../../interfaces/IPayment';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'ccpay-app-processed-payments',\n template: `<div class=\"processed-payments govuk-grid-column-full govuk-!-padding-bottom-3\">\n <h3 class=\"heading-medium\">Processed payments</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Payment asset number (DCN)</td>\n <td class=\"govuk-table__header\" scope=\"col\">Banked date</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Method</td>\n <td class=\"govuk-table__header\" scope=\"col\">Allocation status</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\" >\n <tr class=\"govuk-table__row\" *ngFor=\"let processedRecord of NONPAYMENTS\">\n <td class=\"govuk-table__cell\">\n <a href=\"javascript:void(0)\" (click)=\"redirectToPaymentViewPage(processedRecord.paymentGroupReference, processedRecord.reference, processedRecord.method)\">{{processedRecord.document_control_number}}</a>\n </td>\n <td class=\"govuk-table__cell\"> {{processedRecord.banked_date | date:'dd MMM yyyy'}}</td>\n <td class=\"govuk-table__cell\"> {{processedRecord.amount | currency :'GBP':'symbol':'1.2-2'}}</td>\n <td class=\"capitalize govuk-table__cell\"> {{ trimUnderscore(processedRecord.method) | lowercase}} </td>\n <td class=\"capitalize govuk-table__cell\"> {{ processedRecord.payment_allocation[0] ? processedRecord.payment_allocation[0].allocation_status : '-' }} </td>\n\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"NONPAYMENTS.length === 0\">\n <td class=\"govuk-table__cell\" colspan=\"5\">\n No processed payments\n </td>\n\n </tr>\n\n </tbody>\n </table>\n</div>\n`,\n styles: [`.lowercase{text-transform:lowercase}.capitalize::first-letter{text-transform:uppercase}`]\n})\nexport class ProcessedPaymentsComponent implements OnInit {\n\n @Input('NONPAYMENTS') NONPAYMENTS: IPayment[];\n @Output() goToPaymentViewComponent: EventEmitter<any> = new EventEmitter();\n\n constructor(\n private router: Router,\n private bulkScaningPaymentService: BulkScaningPaymentService\n ) { }\n ngOnInit() {\n }\n\n trimUnderscore(method: string){\n return this.bulkScaningPaymentService.removeUnwantedString(method,' ');\n }\n redirectToPaymentViewPage(paymentGroupReference: string, paymentReference: string, paymentMethod: string) {\n this.goToPaymentViewComponent.emit({paymentGroupReference, paymentReference, paymentMethod});\n }\n}\n","\nexport class IAllocationPaymentsRequest {\n payment_allocation_status: any;\n payment_group_reference: string;\n payment_reference: string;\n reason: string;\n explanation: string;\n user_name: string;\n constructor(payment_group_reference: string, payment_reference : string, reason? : string, explanation? : string, userName? : string) {\n this.payment_allocation_status = {\n description: '',\n name: \"Allocated\"\n };\n this.payment_group_reference = payment_group_reference;\n this.payment_reference= payment_reference;\n this.reason = reason ? reason : null;\n this.explanation = explanation ? explanation : null;\n this.user_name = userName ? userName : null;\n }\n}\n","import { Component, OnInit, Input } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { PaymentLibComponent } from '../../payment-lib.component';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {CaseTransactionsService} from '../../services/case-transactions/case-transactions.service'; \nimport {BulkScaningPaymentService} from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport {IBSPayments} from '../../interfaces/IBSPayments';\nimport {AllocatePaymentRequest} from '../../interfaces/AllocatePaymentRequest';\nimport {IAllocationPaymentsRequest} from '../../interfaces/IAllocationPaymentsRequest';\n\n@Component({\n selector: 'app-allocate-payments',\n template: `<div class=\"allocate-payments\">\n <div *ngIf=\"viewStatus==='mainForm' && isTurnOff\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ALLOCATEPAYMENTS'>\n <div class=\"govuk-breadcrumbs\" *ngIf=\"paymentRef\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a href=\"#\" (click)=\"gotoSummaryPage($event)\" class=\"govuk-back-link\">Back</a>\n </li>\n </ol>\n </div>\n <div class=\"govuk-heading-section\">\n <h1 class=\"govuk-heading-xl\">Allocate payment to fee group</h1>\n <h2 class=\"govuk-heading-l\">Amount left to be allocated:\n {{ unAllocatedPayment.amount | currency:'GBP':'symbol-narrow':'1.2-2' }}</h2>\n </div>\n <div class=\"payment-group-section\" *ngFor=\"let paymentGroup of paymentGroups\">\n <h3 class=\"govuk-heading-m\">Group reference: {{paymentGroup.payment_group_reference}}</h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\"></td>\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Group amount outstanding</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1 govuk-table__custom--col1\"\n [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n <div class=\"multiple-choice\">\n <input id=\"unpaiedFee-{{i}}\" name=\"unassignedRecord\" type=\"radio\"\n (click)=\"selectedPaymentGroup(paymentGroup)\" />\n <label for=\"unpaiedFee-{{i}}\"></label>\n </div>\n </td>\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\">\n {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\">\n {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6 govuk-table__custom--col6\"\n [attr.rowspan]=\"paymentGroup.fees.length\" *ngIf=\"i==0\">\n {{getGroupOutstandingAmount(paymentGroup) | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n\n </tr>\n\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length==0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-button-group-allocate\">\n <button type=\"button\" class=\"button govuk-!-margin-right-1\" [disabled]=\"isContinueButtondisabled\"\n (click)=\"saveAndContinue()\">\n Continue\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"gotoCasetransationPage()\">\n Cancel\n </button>\n </div>\n </div>\n\n <ng-container *ngIf=\"(viewStatus === 'mainForm' && !isTurnOff) || viewStatus === 'allocatePaymentConfirmation'\">\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='{{feedbackUrlLabel}}'>\n <h1 class=\"govuk-heading-xl\">Confirm association</h1>\n <h2 class=\"govuk-heading-l govuk-heading-l--custom\">\n Amount to be allocated: {{amountForAllocation | currency:'GBP':'symbol-narrow':'1.2-2'}}\n </h2>\n <div class=\"payment-group-section\" *ngIf=\"paymentGroup\">\n <h3 class=\"govuk-heading-m--custom\" *ngIf=\"isTurnOff\">Group reference: {{paymentGroup.payment_group_reference}}\n </h3>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__header\" scope=\"col\">Code</td>\n <td class=\"govuk-table__header\" scope=\"col\">Description</td>\n <td class=\"govuk-table__header\" scope=\"col\">Volume</td>\n <td class=\"govuk-table__header\" scope=\"col\">Fee amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Calculated amount</td>\n <td class=\"govuk-table__header\" scope=\"col\">Amount Due</td>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let fee of paymentGroup.fees; let i = index;\">\n <td class=\"govuk-table__cell govuk-table__cell--col1\">{{fee.code}}</td>\n <td class=\"govuk-table__cell govuk-table__cell--col2\"> {{fee.description}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col3\"> {{fee.volume? fee.volume : '-'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col4\">\n {{ fee.fee_amount | currency:'GBP':'symbol-narrow':'1.2-2' }} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col5\">\n {{fee.calculated_amount | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n <td class=\"govuk-table__cell govuk-table__cell--col6\" [attr.rowspan]=\"paymentGroup.fees.length\"\n *ngIf=\"i==0\"> {{afterFeeAllocateOutstanding | currency:'GBP':'symbol-narrow':'1.2-2'}} </td>\n </tr>\n </tbody>\n <tbody class=\"govuk-table__body\" *ngIf=\"paymentGroup.fees.length == 0\">\n <td class=\"govuk-table__cell\" colspan=\"6\">No payments recorded</td>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"isRemainingAmountGtZero || isRemainingAmountLtZero || remainingAmount === 0\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text govuk-warning-text__custom\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n {{paymentSectionLabel.title}} {{ remainingAmount | currency:'GBP':'symbol-narrow':'1.2-2' }}\n </strong>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"isRemainingAmountGtZero || isRemainingAmountLtZero\">\n <div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"how-contacted-conditional-hint\">\n <span id=\"how-contacted-conditional-hint\" class=\"govuk-hint\"\n [ngClass]=\"{'inline-error-message': paymentReasonHasError}\">\n {{paymentSectionLabel.reason}}\n </span>\n <div\n [ngClass]=\"paymentReasonHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountGtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let reason of reasonList.overPayment | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{reason.key}}\" name=\"paymentReason\" type=\"radio\"\n [(ngModel)]=\"paymentReason\" value={{reason.value}}>\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{reason.value}}\n </label>\n </div>\n </div>\n <div\n [ngClass]=\"paymentReasonHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountLtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let reason of reasonList.shortFall | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{reason.key}}\" name=\"paymentReason\" type=\"radio\"\n [(ngModel)]=\"paymentReason\" value={{reason.value}}>\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{reason.value}}\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n <div class=\"govuk-form-group\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"how-contacted-conditional-hint\">\n <span id=\"how-contacted-conditional-hint\" class=\"govuk-hint\"\n [ngClass]=\"{'inline-error-message': paymentExplanationHasError}\">\n Provide an explanatory note\n </span>\n <div\n [ngClass]=\"paymentExplanationHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountGtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let explanation of explanationList.overPayment | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{explanation.key}}\" name=\"paymentExplanation\" type=\"radio\"\n [(ngModel)]=\"paymentExplanation\" value={{explanation.value}}\n (click)=\"selectRadioButton(explanation.key, 'explanation')\">\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{explanation.value}}\n </label>\n </div>\n </div>\n\n <div\n [ngClass]=\"paymentExplanationHasError ? 'govuk-radios govuk-radios--conditional form-group-error' : 'govuk-radios govuk-radios--conditional'\"\n data-module=\"govuk-radios\" *ngIf=\"isRemainingAmountLtZero\">\n <div class=\"govuk-radios__item\" *ngFor=\"let explanation of explanationList.shortFall | keyValue\">\n <input class=\"govuk-radios__input\" id=\"{{explanation.key}}\" name=\"paymentExplanation\" type=\"radio\"\n [(ngModel)]=\"paymentExplanation\" value={{explanation.value}}\n (click)=\"selectRadioButton(explanation.key, 'explanation')\">\n <label class=\"govuk-label govuk-radios__label govuk-font__custom\" for=\"how-contacted-conditional\">\n {{explanation.value}}\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n\n <form [formGroup]=\"overUnderPaymentForm\" novalidate>\n <div\n [ngClass]=\"isMoreDetailsBoxHide ? 'govuk-radios__conditional govuk-radios__conditional--hidden' : isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError ? 'govuk-radios__conditional inline-error-border' : 'govuk-radios__conditional'\"\n id=\"conditional-how-contacted-conditional-3\">\n <div class=\"govuk-form-group\">\n <span id=\"more-detail-hint\" class=\"govuk-hint govuk-font__custom\">\n Please enter details\n </span>\n <textarea class=\"govuk-textarea\"\n [ngClass]=\"{'inline-error-class': isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError}\"\n id=\"moreDetails\" name=\"moreDetails\" rows=\"5\" formControlName=\"moreDetails\">\n </textarea>\n <p class=\"inline-error-message\"\n *ngIf=\"isPaymentDetailsEmpty || isPaymentDetailsInvalid || paymentDetailsMinHasError || paymentDetailsMaxHasError\">\n <span *ngIf=\"isPaymentDetailsEmpty\">Enter a explanation</span>\n <span *ngIf=\"isPaymentDetailsInvalid\">Enter a valid explanation</span>\n <span *ngIf=\"paymentDetailsMinHasError\">Explanation should be at least 3 characters.</span>\n <span *ngIf=\"paymentDetailsMaxHasError\">Explanation should be 255 characters or under.</span>\n </p>\n </div>\n </div>\n <div class=\"govuk-button--group\">\n <button type=\"submit\" [disabled]=\"isConfirmButtondisabled\"\n [ngClass]=\"isConfirmButtondisabled ? 'button button--disabled' : 'button'\"\n (click)=\"confirmAllocatePayement()\">\n Confirm\n </button>\n <button type=\"button\" class=\"button govuk-button--secondary\" (click)=\"cancelAllocatePayment($event)\">\n Cancel\n </button>\n </div>\n </form>\n </ng-container>\n</div>`,\n styles: [`.allocate-payments{margin:20px 0}.allocate-payments .govuk-table__cell--col1,.allocate-payments .govuk-table__cell--col3{width:10%}.allocate-payments .govuk-table__cell--col2,.allocate-payments .govuk-table__cell--col6{width:25%}.allocate-payments .govuk-table__cell--col4,.allocate-payments .govuk-table__cell--col5{width:15%}.allocate-payments .govuk-button-group-allocate{display:flex;justify-content:flex-start}.allocate-payments .govuk-button--secondary{margin-left:10px;background-color:#b3b8bdf2}.allocate-payments .govuk-custom-warning__message{font-size:30px;position:relative;top:12px;font-weight:700}.allocate-payments .govuk-warning-text-custom{margin-bottom:0!important;padding:10px 0 5px}.allocate-payments .govuk-table__custom--col1{padding-top:0;padding-bottom:20px;padding-left:15px}.allocate-payments .govuk-table__custom--col6{text-align:center}.allocate-payments .govuk-list__custom{padding-left:20px}.allocate-payments .govuk-font__custom,.allocate-payments .govuk-heading-m--custom,.allocate-payments .govuk-hint,.allocate-payments .govuk-label--m,.allocate-payments .govuk-list__custom,.allocate-payments .govuk-radios__item,.allocate-payments .govuk-warning-text__custom{font-size:19px}.allocate-payments .govuk-radios__conditional--hidden{display:none}.allocate-payments .form-group-error{border-left:5px solid #b10e1e;padding-left:15px}.allocate-payments .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.allocate-payments .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}.allocate-payments .inline-error-border{border-color:#a71414}`]\n})\nexport class AllocatePaymentsComponent implements OnInit {\n @Input() isTurnOff: boolean;\n @Input() caseType: string;\n\n overUnderPaymentForm: FormGroup;\n viewStatus: string;\n ccdCaseNumber: string;\n bspaymentdcn: string;\n feedbackUrlLabel:string;\n unAllocatedPayment: IBSPayments = {\n amount: 0\n };\n siteID: string = null;\n errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n paymentGroup: IPaymentGroup;\n paymentGroups: IPaymentGroup[] = [];\t\n remainingAmount: number;\n isRemainingAmountGtZero: boolean;\n isMoreDetailsBoxHide: boolean = true;\n isRemainingAmountLtZero: boolean;\n afterFeeAllocateOutstanding: number;\n amountForAllocation: number;\n isConfirmButtondisabled: boolean = false;\n isContinueButtondisabled: boolean = true;\n otherPaymentExplanation: string = null;\n selectedOption: string = null;\n isFeeAmountZero: boolean = false;\t\n\n paymentReasonHasError: boolean = false;\n paymentExplanationHasError: boolean = false;\n isPaymentDetailsEmpty: boolean = false;\n isPaymentDetailsInvalid: boolean = false;\n paymentDetailsMinHasError: boolean = false;\n paymentDetailsMaxHasError: boolean = false;\n isUserNameEmpty: boolean = false;\n isUserNameInvalid: boolean = false;\n ccdReference: string = null;\n exceptionReference: string = null;\n paymentReason: string = null;\n paymentExplanation: string = null;\n userName: string = null;\n paymentSectionLabel: any;\n paymentRef: string = null;\n isStrategicFixEnable: boolean = true;\n cookieUserName: string[] = [];\n enCookieUserName: any;\n userNameField: string = null;\n\n reasonList: { [key: string]: { [key: string]: string } }= {\n overPayment: {\n hwfReward: 'Help with Fees (HWF) awarded. Please include the HWF reference number in the explanatory note',\n wrongFee: 'Incorrect payment received',\n notIssueCase: 'Unable to issue case',\n otherDeduction: 'Other'\n },\n shortFall: {\n helpWithFee: 'Help with Fees (HWF) application declined',\n wrongFee: 'Incorrect payment received',\n other: 'Other'\n }\n }\n explanationList = {\n overPayment: {\n referRefund: 'Details in case notes. Refund due',\n noRefund: 'Details in case notes. No refund due',\n noCase: 'No case created. Refund due',\n other: 'Other'\n },\n shortFall: {\n holdCase: 'I have put a stop on the case and contacted the applicant requesting the balance of payment',\n heldCase: 'I have put a stop on the case. The applicant needs to be contacted to request the balance of payment',\n other: 'Other'\n }\n }\n\n\n constructor(\n private errorHandlerService: ErrorHandlerService,\n private caseTransactionsService: CaseTransactionsService,\n private formBuilder: FormBuilder,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent,\n private bulkScaningPaymentService: BulkScaningPaymentService) { }\n\n ngOnInit() {\n this.viewStatus = 'mainForm';\n this.ccdCaseNumber = this.paymentLibComponent.CCD_CASE_NUMBER;\n this.bspaymentdcn = this.paymentLibComponent.bspaymentdcn;\n this.paymentRef = this.paymentLibComponent.paymentGroupReference;\n this.selectedOption = this.paymentLibComponent.SELECTED_OPTION;\n this.isStrategicFixEnable = this.paymentLibComponent.ISSFENABLE;\n this.isTurnOff = this.paymentLibComponent.isTurnOff;\n this.overUnderPaymentForm = this.formBuilder.group({\n moreDetails: new FormControl('', Validators.compose([\n Validators.required,\n Validators.minLength(3),\n Validators.maxLength(255),\n Validators.pattern('^([a-zA-Z0-9\\\\s,\\\\.]*)$')\n ])),\n userName: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9\\\\s]*)$')\n ])),\n });\n this.getUnassignedPayment();\n }\n getGroupOutstandingAmount(paymentGroup: IPaymentGroup): number {\n return this.bulkScaningPaymentService.calculateOutStandingAmount(paymentGroup);\n }\n\n getPaymentGroupDetails(){\n\n if(!this.isTurnOff){\n this.paymentViewService.getPaymentGroupDetails(this.paymentRef).subscribe(\n paymentGroup => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.paymentGroup = paymentGroup;\n this.saveAndContinue();\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }else {\n this.caseTransactionsService.getPaymentGroups(this.ccdCaseNumber).subscribe(\n paymentGroups => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.paymentGroups = paymentGroups['payment_groups'].filter(paymentGroup => {\n paymentGroup.fees.forEach(fee => {\n if(fee.calculated_amount === 0) {\n this.isFeeAmountZero = true\n }\n });\n let fstCon = this.getGroupOutstandingAmount(<IPaymentGroup>paymentGroup),\n scndCn = fstCon > 0 || (fstCon == 0 && this.isFeeAmountZero) && paymentGroup.payment_group_reference === this.paymentRef;\n return this.paymentRef ? scndCn : fstCon > 0 || (fstCon == 0 && this.isFeeAmountZero);\n });\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }\n\n }\n\n selectedPaymentGroup(paymentGroup: IPaymentGroup) {\t\n this.isContinueButtondisabled = false;\t\n this.paymentGroup = paymentGroup;\t\n }\t\n\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n\n gotoSummaryPage(event: any) { \n event.preventDefault();\n this.paymentLibComponent.viewName = 'fee-summary';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n }\n\n cancelAllocatePayment(event: any){\n event.preventDefault();\n this.resetForm([false, false, false, false, false, false, false, false], 'all');\n if(!this.isTurnOff){\n this.paymentLibComponent.viewName = 'fee-summary';\n this.paymentLibComponent.isTurnOff = this.isTurnOff;\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISBSENABLE = true;\n } else {\n this.viewStatus = 'mainForm';\t\n }\n }\n confirmAllocatePayement(){\n this.enCookieUserName = document.cookie.split(\";\").find(row => row.includes(\"user-info\")).split(\"=\")[1].split(\";\");\n this.cookieUserName = JSON.parse(decodeURIComponent(this.enCookieUserName));\n \n const fullName = this.cookieUserName['forename'] + ' ' + this.cookieUserName['surname'];\n\n const paymentDetailsField = this.overUnderPaymentForm.controls.moreDetails,\n paymentFormError = this.overUnderPaymentForm.controls.moreDetails.errors,\n userNameField = fullName,\n isEmptyCondtion = this.paymentReason && this.paymentExplanation,\n isOtherOptionSelected = this.paymentExplanation === 'Other';\n\n this.resetForm([false, false, false, false, false, false, false, false], 'all');\n if ( (!this.isRemainingAmountGtZero && !this.isRemainingAmountLtZero) || isEmptyCondtion && (!isOtherOptionSelected && userNameField.length > 0 || isOtherOptionSelected && userNameField.length > 0 && paymentDetailsField.valid)) {\n this.isConfirmButtondisabled = true;\n this.otherPaymentExplanation = this.paymentExplanation === 'Other' ? paymentDetailsField.value : this.paymentExplanation;\n this.userName = userNameField;\n this.finalServiceCall();\n }else {\n if(!this.paymentReason) {\n this.resetForm([true, false, false, false, false, false, false, false], 'reason');\n }\n if(!this.paymentExplanation) {\n this.resetForm([false, true, false, false, false, false, false, false], 'explanation');\n }\n if(this.paymentExplanation && isOtherOptionSelected) {\n if(paymentDetailsField.value == '' ) {\n this.resetForm([false, false, true, false, false, false, false, false], 'other');\n }\n if(paymentDetailsField.value != '' && paymentDetailsField.invalid ) {\n this.resetForm([false, false, false, true, false, false, false, false], 'other');\n }\n if(paymentFormError && paymentFormError.minlength && paymentFormError.minlength.actualLength < 3 ) {\n this.resetForm([false, false, false, false, true, false, false, false], 'other');\n }\n if(paymentFormError && paymentFormError.maxlength && paymentFormError.maxlength.actualLength > 255 ) {\n this.resetForm([false, false, false, false, false, true, false, false], 'other');\n }\n }\n if(userNameField.length === 0) {\n this.resetForm([false, false, false, false, false, false, true, false], 'username');\n }\n }\n }\n resetForm(vals, field) {\n if(field==='reason' || field==='all') {\n this.paymentReasonHasError = vals[0];\n }\n if(field==='explanation' || field==='all') {\n this.paymentExplanationHasError = vals[1];\n }\n if(field==='other' || field==='all') {\n this.isPaymentDetailsEmpty = vals[2];\n this.isPaymentDetailsInvalid = vals[3];\n this.paymentDetailsMinHasError = vals[4];\n this.paymentDetailsMaxHasError = vals[5];\n }\n if(field==='username' || field==='all') {\n this.isUserNameEmpty = vals[6];\n this.isUserNameInvalid = vals[7];\n }\n }\n finalServiceCall() {\n if(!this.isStrategicFixEnable) {\n let allocatedRequest = {\n reason: this.paymentReason,\n allocation_status:'Allocated',\n explanation: this.otherPaymentExplanation,\n payment_allocation_status: {\n description: '',\n name: 'Allocated'\n },\n payment_group_reference: this.paymentGroup.payment_group_reference,\n case_type: this.caseType,\n user_name: this.userName\n }\n const postStrategicBody = new AllocatePaymentRequest\n (this.ccdReference, this.unAllocatedPayment, this.caseType, this.exceptionReference, allocatedRequest);\n this.bulkScaningPaymentService.postBSPaymentStrategic(postStrategicBody , this.paymentGroup.payment_group_reference).subscribe(\n res => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response = JSON.parse(res);\n if (response.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n });\n\n } else {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'PROCESSED').subscribe(\n res1 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response1 = JSON.parse(res1);\n if (response1.success) {\n const requestBody = new AllocatePaymentRequest\n (this.ccdReference, this.unAllocatedPayment, this.siteID, this.exceptionReference);\n this.bulkScaningPaymentService.postBSAllocatePayment(requestBody, this.paymentGroup.payment_group_reference).subscribe(\n res2 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response2 = JSON.parse(res2);\n const reqBody = new IAllocationPaymentsRequest\n (response2['data'].payment_group_reference, response2['data'].reference, this.paymentReason, this.otherPaymentExplanation, this.userName);\n if (response2.success) {\n this.paymentViewService.postBSAllocationPayments(reqBody).subscribe(\n \n res3 => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n let response3 = JSON.parse(res3);\n if (response3.success) {\n this.gotoCasetransationPage();\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.bulkScaningPaymentService.patchBSChangeStatus(this.unAllocatedPayment.dcn_reference, 'COMPLETE').subscribe();\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n );\n }\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n window.scrollTo(0, 0);\n this.isConfirmButtondisabled = false;\n }\n ); \n }\n }\n\n saveAndContinue(){\n if(this.paymentGroup) {\n this.isMoreDetailsBoxHide = true;\n this.overUnderPaymentForm.get('moreDetails').reset();\n this.overUnderPaymentForm.get('moreDetails').setValue('');\n this.overUnderPaymentForm.get('userName').reset();\n this.overUnderPaymentForm.get('userName').setValue('');\n this.paymentReason = '';\n this.paymentExplanation = '';\n let GroupOutstandingAmount = this.getGroupOutstandingAmount(this.paymentGroup);\n const remainingToBeAssigned = this.unAllocatedPayment.amount - GroupOutstandingAmount;\n this.isRemainingAmountGtZero = remainingToBeAssigned > 0;\n this.isRemainingAmountLtZero = remainingToBeAssigned < 0;\n this.paymentSectionLabel = this.isRemainingAmountGtZero ? { \n title: 'There is an Over payment of',\n reason: 'Provide a reason. This will be used in the Refund process.',\n }: this.isRemainingAmountLtZero ? { \n title: 'There is an Under payment of',\n reason: 'Provide a reason',\n }: { \n title:'Amount left to be allocated',\n reason:'',\n };\n this.feedbackUrlLabel = this.isRemainingAmountGtZero ? 'CONFIRMALLOCATION_SURPLUS' : this.isRemainingAmountLtZero ? 'CONFIRMALLOCATION_SHORTFALL' : 'CONFIRMALLOCATION';\n this.remainingAmount = this.isRemainingAmountGtZero ? remainingToBeAssigned : this.isRemainingAmountLtZero ? remainingToBeAssigned * -1 : 0;\n this.afterFeeAllocateOutstanding = remainingToBeAssigned >= 0 ? 0 : (remainingToBeAssigned * -1);\n this.amountForAllocation = GroupOutstandingAmount >= this.unAllocatedPayment.amount ? this.unAllocatedPayment.amount : GroupOutstandingAmount;\n if(this.isTurnOff){\n this.viewStatus = 'allocatePaymentConfirmation';\t\n }\n }\n }\n getUnassignedPayment() {\n this.bulkScaningPaymentService.getBSPaymentsByDCN(this.bspaymentdcn).subscribe(\n unassignedPayments => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n this.unAllocatedPayment = unassignedPayments['data'].payments.filter(payment => {\n return payment && payment.dcn_reference == this.bspaymentdcn;\n })[0];\n this.siteID = unassignedPayments['data'].responsible_service_id;\n const beCcdNumber = unassignedPayments['data'].ccd_reference,\n beExceptionNumber = unassignedPayments['data'].exception_record_reference,\n exceptionReference = beCcdNumber ? beCcdNumber === this.ccdCaseNumber ? null : this.ccdCaseNumber : this.ccdCaseNumber;\n this.ccdReference = beCcdNumber ? beCcdNumber : null;\n this.exceptionReference = beExceptionNumber ? beExceptionNumber : exceptionReference;\n this.getPaymentGroupDetails();\n },\n (error: any) => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n }\n );\n }\n selectRadioButton(key, type) {\n this.isMoreDetailsBoxHide = true;\n if( type === 'explanation' && key === 'other' ){\n this.isPaymentDetailsEmpty = false;\n this.isPaymentDetailsInvalid = false;\n this.paymentDetailsMinHasError = false;\n this.paymentDetailsMaxHasError = false;\n this.isMoreDetailsBoxHide = false;\n }\n }\n}\n","import { IFee } from './IFee';\n\nexport class AddRemissionRequest {\n beneficiary_name: string;\n ccd_case_number: string;\n fee: IFee;\n hwf_amount: number;\n hwf_reference: string;\n payment_group_reference: string;\n case_type: string;\n\n constructor(ccd_case_number: string, fee: IFee, hwf_amount: number, hwf_reference: string, caseType: string) {\n this.ccd_case_number = ccd_case_number;\n this.fee = fee;\n this.hwf_amount = hwf_amount;\n this.hwf_reference = hwf_reference;\n this.case_type = caseType;\n }\n}\n","import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';\nimport { IFee } from '../../interfaces/IFee';\nimport {Router} from '@angular/router';\nimport { AddRemissionRequest } from '../../interfaces/AddRemissionRequest';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport { PaymentLibComponent } from '../../payment-lib.component';\n\nconst BS_ENABLE_FLAG = 'bulk-scan-enabling-fe';\n\n@Component({\n selector: 'ccpay-add-remission',\n template: `<div class=\"add-remission\">\n <div *ngIf=\"errorMessage\">\n <div class=\"error-summary\" role=\"group\" aria-labelledby=\"failure-error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-medium error-summary-heading\" id=\"failure-error-summary-heading\">\n Error in processing the request\n </h2>\n <div class=\"govuk-error-summary__body\">\n {{ errorMessage }}\n </div>\n </div>\n </div>\n <ng-container *ngIf=\"viewStatus === 'main'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ADDREMISSION'>\n <h1 class=\"heading-large\">Add remission</h1>\n <form novalidate>\n <div class=\"govuk-form-group\">\n <form [formGroup]=\"remissionForm\" novalidate>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--s\" for=\"remission-code\">\n Add remission to {{ fee.code }}:{{ fee.description }}\n <span class=\"form-hint\">Enter remission for reference. For example: HWF-A1B-23C</span>\n </label>\n <input [ngClass]=\"{'inline-error-class': isRemissionCodeEmpty || remissionCodeHasError}\" class=\"govuk-input govuk-input--width-20 govuk-!-margin-right-1\" id=\"remissionCode\" aria-label=\"remissionCode\" name=\"remissionCode\" type=\"text\" formControlName=\"remissionCode\">\n <p class=\"inline-error-message\" *ngIf=\"isRemissionCodeEmpty || remissionCodeHasError\">\n <span *ngIf=\"isRemissionCodeEmpty\">Enter a remission code</span>\n <span *ngIf=\"remissionCodeHasError\">Enter a vaild remission code</span>\n </p>\n </div>\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-label--s\" for=\"amount\">\n How much does the applicant need to pay?\n </label>\n\n <div id=\"amount-currency\" class=\"govuk-visually-hidden\">in pounds</div>\n <div class=\"hmcts-currency-input\">\n <div class=\"hmcts-currency-input__symbol\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input govuk-input--width-10\" [ngClass]=\"{'inline-error-class': isAmountEmpty || amountHasError || isRemissionLessThanFeeError}\" id=\"amount\" aria-label=\"amount\" name=\"amount\" type=\"text\" aria-describedby=\"amount-currency\" formControlName=\"amount\">\n <p class=\"inline-error-message\" *ngIf=\"isAmountEmpty || amountHasError || isRemissionLessThanFeeError\">\n <span *ngIf=\"isAmountEmpty\">Enter a amount</span>\n <span *ngIf=\"amountHasError\">Enter a vaild amount</span>\n <span *ngIf=\"isRemissionLessThanFeeError\">The remission amount must be less than the total fee</span>\n </p>\n </div>\n </div>\n </form>\n <button class=\"button\" type=\"submit\" (click)=\"addRemission()\">\n Submit\n </button>\n </div>\n </form>\n </ng-container>\n <ng-container *ngIf=\"viewStatus === 'confirmation'\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='ADDREMISSIONCONFIRMATION'> \n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">Warning</span>\n Are you sure you want to add remission to this fee?\n </strong>\n </div>\n <table class=\"govuk-table\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Remission code:</td>\n <td class=\"govuk-table__cell\">{{ remissionForm.controls.remissionCode.value }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Fee code:</td>\n <td class=\"govuk-table__cell\">{{ fee.code }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Fee description:</td>\n <td class=\"govuk-table__cell\">{{ fee.description }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell govuk-!-font-weight-bold\">Amount the applicant must pay:</td>\n <td class=\"govuk-table__cell\">{{ remissionForm.controls.amount.value | currency:'GBP':'symbol-narrow':'1.2-2' }}</td>\n </tr>\n </table>\n\n <button type=\"submit\" class=\"button govuk-button--secondary\" (click)=\"cancelRemission.emit()\">\n Cancel\n </button>\n <button type=\"submit\"\n [disabled]=\"isConfirmationBtnDisabled\"\n [ngClass]='isConfirmationBtnDisabled ? \"button button--disabled govuk-!-margin-right-1\" : \"button govuk-!-margin-right-1\"'\n (click)=\"confirmRemission()\">\n Confirm\n </button>\n\n </ng-container>\n\n</div>\n\n`,\n styles: [`.add-remission .button{margin:20px 2px}.add-remission td.govuk-table__cell{width:50%}.add-remission .govuk-button--secondary{background-color:#dee0e2;box-shadow:0 2px 0 #858688;color:#0b0c0c;margin-right:.5em}.add-remission .govuk-label--s,.add-remission .govuk-warning-text__text,.add-remission .hmcts-currency-input__symbol{font-size:19px}.add-remission .inline-error-class{outline:#a71414 solid 3px;outline-offset:0}.add-remission .inline-error-message{color:#a71414;font-weight:700;margin-top:10px}`]\n})\nexport class AddRemissionComponent implements OnInit {\n @Input() fee: IFee;\n @Input() ccdCaseNumber: string;\n @Input() caseType: string;\n @Input() paymentGroupRef: string;\n @Input() isTurnOff: boolean;\n @Input() isStrategicFixEnable: boolean;\n @Output() cancelRemission: EventEmitter<void> = new EventEmitter();\n\n remissionForm: FormGroup;\n hasErrors = false;\n viewStatus = 'main';\n errorMessage = null;\n option: string = null;\n isConfirmationBtnDisabled: boolean = false;\n bsPaymentDcnNumber: string;\n\n isRemissionCodeEmpty: boolean = false;\n remissionCodeHasError: boolean = false;\n isAmountEmpty: boolean = false;\n amountHasError: boolean = false;\n isRemissionLessThanFeeError: boolean = false;\n\n constructor(private formBuilder: FormBuilder,\n private router: Router,\n private paymentViewService: PaymentViewService,\n private paymentLibComponent: PaymentLibComponent) { }\n\n ngOnInit() {\n this.option = this.paymentLibComponent.SELECTED_OPTION;\n this.bsPaymentDcnNumber = this.paymentLibComponent.bspaymentdcn;\n this.remissionForm = this.formBuilder.group({\n remissionCode: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^([a-zA-Z0-9]{3})-([a-zA-Z0-9]{3})-([a-zA-Z0-9]{3})$')\n ])),\n amount: new FormControl('', Validators.compose([\n Validators.required,\n Validators.pattern('^[0-9]+(\\\\.[0-9]{2})?$')\n ]))\n });\n this.viewStatus = 'main';\n }\n\n addRemission() {\n this.resetRemissionForm([false, false, false, false, false], 'All');\n const remissionctrls=this.remissionForm.controls,\n isRemissionLessThanFee = this.fee.calculated_amount > remissionctrls.amount.value;\n if (this.remissionForm.dirty && this.remissionForm.valid && isRemissionLessThanFee) {\n this.viewStatus = 'confirmation';\n }else {\n\n if(remissionctrls['remissionCode'].value == '' ) {\n this.resetRemissionForm([true, false, false, false, false], 'remissionCode');\n }\n if(remissionctrls['remissionCode'].value != '' && remissionctrls['remissionCode'].invalid ) {\n this.resetRemissionForm([false, true, false, false, false], 'remissionCode');\n }\n if(remissionctrls['amount'].value == '' ) {\n this.resetRemissionForm([false, false, true, false, false], 'amount');\n }\n if(remissionctrls['amount'].value != '' && remissionctrls['amount'].invalid ) {\n this.resetRemissionForm([false, true, false, true, false], 'amount');\n }\n if(remissionctrls.amount.valid && !isRemissionLessThanFee){\n this.resetRemissionForm([false, false, false, false, true], 'amount');\n }\n }\n }\n\n resetRemissionForm(val, field){\n if(field==='remissionCode' || field==='All') {\n this.isRemissionCodeEmpty = val[0];\n this.remissionCodeHasError = val[1];\n } else if (field==='amount' || field==='All'){\n this.isAmountEmpty = val[2];\n this.amountHasError = val[3];\n this.isRemissionLessThanFeeError = val[4];\n }\n }\n\n confirmRemission() {\n this.isConfirmationBtnDisabled = true;\n const newNetAmount = this.remissionForm.controls.amount.value,\n remissionAmount = this.fee.net_amount - newNetAmount,\n requestBody = new AddRemissionRequest\n (this.ccdCaseNumber, this.fee, remissionAmount, this.remissionForm.controls.remissionCode.value, this.caseType);\n this.paymentViewService.postPaymentGroupWithRemissions(decodeURIComponent(this.paymentGroupRef).trim(), this.fee.id, requestBody).subscribe(\n response => {\n if (JSON.parse(response).success) {\n let LDUrl = this.isTurnOff ? '&isTurnOff=Enable' : '&isTurnOff=Disable'\n LDUrl += `&caseType=${this.caseType}`\n if (this.paymentLibComponent.bspaymentdcn) {\n this.router.routeReuseStrategy.shouldReuseRoute = () => false;\n this.router.onSameUrlNavigation = 'reload';\n this.router.navigateByUrl(`/payment-history/${this.ccdCaseNumber}?view=fee-summary&selectedOption=${this.option}&paymentGroupRef=${this.paymentGroupRef}&dcn=${this.paymentLibComponent.bspaymentdcn}${LDUrl}`);\n }else {\n this.gotoCasetransationPage();\n }\n\n }\n },\n (error: any) => {\n this.errorMessage = error;\n this.isConfirmationBtnDisabled = false;\n }\n );\n }\n gotoCasetransationPage() {\n this.paymentLibComponent.viewName = 'case-transactions';\n this.paymentLibComponent.TAKEPAYMENT = true;\n this.paymentLibComponent.ISTURNOFF = this.isTurnOff;\n\n this.paymentViewService.getBSfeature().subscribe(\n features => {\n let result = JSON.parse(features).filter(feature => feature.uid === BS_ENABLE_FLAG);\n this.paymentLibComponent.ISBSENABLE = result[0] ? result[0].enable : false;\n },\n err => {\n this.paymentLibComponent.ISBSENABLE = false;\n }\n );\n\n let partUrl = this.bsPaymentDcnNumber ? `&dcn=${this.bsPaymentDcnNumber}` : '';\n partUrl += this.paymentLibComponent.ISBSENABLE ? '&isBulkScanning=Enable' : '&isBulkScanning=Disable';\n partUrl += this.paymentLibComponent.ISTURNOFF ? '&isTurnOff=Enable' : '&isTurnOff=Disable';\n partUrl += this.isStrategicFixEnable ? '&isStFixEnable=Enable' : '&isStFixEnable=Disable';\n partUrl += `&caseType=${this.caseType}`;\n\n const url = `/payment-history/${this.ccdCaseNumber}?view=case-transactions&takePayment=true&selectedOption=${this.option}${partUrl}`;\n this.router.navigateByUrl(url);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n@Pipe({\n name: 'ccdHyphens'\n})\nexport class CcdHyphensPipe implements PipeTransform {\n constructor() {}\n transform(value: any, args?: any): any {\n const pattern = /^([0-9]{4})+([0-9]{4})+([0-9]{4})+([0-9]{4})$/;\n if ( value.match(pattern)) {\n return value.replace(pattern,'$1-$2-$3-$4') \n }\n return value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n@Pipe({\n name: 'keyValue'\n})\nexport class keyValuePipe implements PipeTransform {\n constructor() {}\n transform(input: any): any {\n let keys = [];\n for (let key in input) {\n if (input.hasOwnProperty(key)) {\n keys.push({ key: key, value: input[key]});\n }\n }\n return keys;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Pipe({ name: 'sanitizeHtml' })\nexport class SanitizeHtmlPipe implements PipeTransform {\n constructor(private sanitizer: DomSanitizer) {}\n transform(value: any): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as FileSaver from 'file-saver';\nimport * as XLSX from 'xlsx';\nimport * as XLSXStyle from 'xlsx-style';\n\n\nconst EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';\nconst EXCEL_EXTENSION = '.xlsx';\n\n@Injectable()\nexport class XlFileService {\n\n constructor() { }\n\n public exportAsExcelFile(json: any[], excelFileName: string): void {\n let worksheet: XLSX.WorkSheet; \n let workbook: XLSX.WorkBook; \n\n if(excelFileName.match('Data_Loss')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['loss_resp','payment_asset_dcn','env_ref','env_item','resp_service_id','resp_service_name','date_banked','bgc_batch','payment_method','amount']});\n worksheet = this.setDataLossReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else if(excelFileName.match('Unprocessed')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','exception_ref','ccd_ref','date_banked','bgc_batch','payment_asset_dcn','env_ref','env_item','payment_method','amount']});\n worksheet = this.setUnprocessedReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else if(excelFileName.match('Processed_Unallocated')!== null){\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','allocation_status','receiving_office','allocation_reason','ccd_exception_reference','ccd_case_reference','payment_asset_dcn','env_ref','env_item','date_banked','bgc_batch','payment_method','amount']});\n worksheet = this.setProcessedUnallocatedReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n } else {\n worksheet = XLSX.utils.json_to_sheet(json,{header:['resp_service_id','resp_service_name','surplus_shortfall','balance','payment_amount','ccd_case_reference', 'ccd_exception_reference', 'processed_date', 'reason', 'explanation', 'user_name']});\n worksheet = this.setShortFallReportHeaders(worksheet);\n worksheet = this.autoFitColumns(worksheet,json);\n }\n workbook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });\n this.saveAsExcelFile(excelBuffer, excelFileName);\n }\n\n\nprivate autoFitColumns (worksheet: XLSX.WorkSheet,json:any) : XLSX.WorkSheet {\n let objectMaxLength = []; \n let ColWidth = [];\n let obj = <any>Object;\n for (let i = 0; i < json.length; i++) {\n let value = obj.values(json[i]);\n let key = obj.keys(json[i]);\n for (let j = 0; j < value.length; j++) {\n if(value[j] === null){\n value[j] = '';\n }\n objectMaxLength[j] =\n key[j].length >= value[j].length\n ? key[j].length+2\n : value[j].length+1;\n if( value[j].length === undefined){\n objectMaxLength[j] = key[j].length+2;\n }\n ColWidth.push({'width': +objectMaxLength[j]});\n }\n }\n worksheet['!cols'] = ColWidth;\n return worksheet;\n}\n\n\nprivate setDataLossReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Loss_Resp\";\n worksheet.B1.v = \"Payment_Asset_DCN\";\n worksheet.C1.v = \"Envelope_Ref\";\n worksheet.D1.v = \"Envelope_Item\";\n worksheet.E1.v = \"Resp_Service ID\";\n worksheet.F1.v = \"Resp_Service Name\";\n worksheet.G1.v = \"Date_Banked\";\n worksheet.H1.v = \"BGC_Batch\";\n worksheet.I1.v = \"Payment_Method\";\n worksheet.J1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setUnprocessedReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Exception_Ref\";\n worksheet.D1.v = \"CCD_Ref\";\n worksheet.E1.v = \"Date_Banked\";\n worksheet.F1.v = \"BGC_Batch\";\n worksheet.G1.v = \"Payment_Asset_DCN\";\n worksheet.H1.v = \"Envelope_Ref\";\n worksheet.I1.v = \"Envelope_Item\";\n worksheet.J1.v = \"Payment_Method\";\n worksheet.K1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setProcessedUnallocatedReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Allocation_Status\";\n worksheet.D1.v = \"Receiving_Office\";\n worksheet.E1.v = \"Allocation_Reason\";\n worksheet.F1.v = \"CCD_Exception_Ref\";\n worksheet.G1.v = \"CCD_Case_Ref\";\n worksheet.H1.v = \"Payment_Asset_DCN\";\n worksheet.I1.v = \"Envelope_Ref\";\n worksheet.J1.v = \"Envelope_Item\";\n worksheet.K1.v = \"Date_Banked\";\n worksheet.L1.v = \"BGC_Batch\";\n worksheet.M1.v = \"Payment_Method\";\n worksheet.N1.v = \"Amount\";\n return worksheet;\n}\n\nprivate setShortFallReportHeaders (worksheet: XLSX.WorkSheet): XLSX.WorkSheet {\n worksheet.A1.v = \"Resp_Service ID\";\n worksheet.B1.v = \"Resp_Service Name\";\n worksheet.C1.v = \"Over Payment_Under Payment\";\n worksheet.D1.v = \"Balance\";\n worksheet.E1.v = \"Payment_Amount\";\n worksheet.F1.v = \"CCD_Case_Ref\";\n worksheet.G1.v = \"Exception_Ref\";\n worksheet.H1.v = \"Processed_Date\";\n worksheet.I1.v = \"Reason\";\n worksheet.J1.v = \"Explanation\";\n worksheet.K1.v = \"Updated Name\";\n return worksheet;\n}\n\nprivate saveAsExcelFile(buffer: any, fileName: string): void {\n const data: Blob = new Blob([buffer], {\n type: EXCEL_TYPE\n });\n FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);\n }\n}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, FormControl } from '@angular/forms';\nimport { formatDate } from \"@angular/common\";\nimport {IPaymentGroup} from '../../interfaces/IPaymentGroup';\nimport { BulkScaningPaymentService } from '../../services/bulk-scaning-payment/bulk-scaning-payment.service';\nimport { ErrorHandlerService } from '../../services/shared/error-handler.service';\nimport { PaymentViewService } from '../../services/payment-view/payment-view.service';\nimport {XlFileService} from '../../services/xl-file/xl-file.service';\n\n@Component({\n selector: 'ccpay-reports',\n template: `<div class=\"header\">\n <input #myInput type='hidden' id='iFrameDrivenImageValue' value='REPORTS'>\n <ccpay-error-banner *ngIf=\"errorMessage.showError\" [errorMessage]=\"errorMessage\"></ccpay-error-banner>\n <legend class=\"govuk-fieldset__legend--xl\">\n <h1 class=\"govuk-fieldset__heading\"> Choose the report type and date range</h1>\n </legend>\n</div>\n<form [formGroup]=\"reportsForm\">\n <div class=\"govuk-form-group\">\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\">\n <div class=\"govuk-radios__item\">\n <input \n required\n id=\"DataLoss\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('DATA_LOSS')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"DATA_LOSS\" \n data-aria-controls=\"DataLoss\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"DataLoss\">Data loss</label>\n <span class=\"form-hint\">Missing transactions where data has been received from only either of Exela or Bulk scan</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"UnprocessedTransactions\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n (click)=\"validateDates('UNPROCESSED')\"\n name=\"selectedreport\"\n type=\"radio\"\n value=\"UNPROCESSED\" \n data-aria-controls=\"UnprocessedTransactions\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"UnprocessedTransactions\">Unprocessed transactions</label>\n <span class=\"form-hint\">Transaction records that are still unprocessed by staff.</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ProcessedUnallocated\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('PROCESSED_UNALLOCATED')\"\n type=\"radio\"\n value=\"PROCESSED_UNALLOCATED\" \n data-aria-controls=\"ProcessedUnallocated\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ProcessedUnallocated\">Processed unallocated</label>\n <span class=\"form-hint\">Payments that are marked as âUnidentifiedâ or âTransferredâ (Unsolicited requests)</span>\n </div>\n\n <div class=\"govuk-radios__item\">\n <input \n id=\"ShortfallsandSurplus\"\n class=\"govuk-radios__input\"\n formControlName=\"selectedreport\"\n name=\"selectedreport\"\n (click)=\"validateDates('SURPLUS_AND_SHORTFALL')\"\n type=\"radio\"\n value=\"SURPLUS_AND_SHORTFALL\" \n data-aria-controls=\"ShortfallsandSurplus\"/>\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"ShortfallsandSurplus\">Under payment and Over payment</label>\n <span class=\"form-hint\">Requests where balances are marked as Under payment/Over payment further case management.\n E.g: Refund approval, Customer contact</span>\n </div>\n \n </div>\n </div>\n <div class=\"govuk-form-group\">\n <div class=\"datefrom\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-from\">Date from</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-from\" name=\"date-from\" type=\"date\" formControlName=\"startDate\" required/>\n </div>\n\n <div class=\"dateto\">\n <label class=\"govuk-label govuk-radios__label govuk-label--m\" for=\"date-to\">Date to</label>\n <input (change)=\"getSelectedFromDate()\" [max]=\"getToday()\" class=\"form-control\" id=\"date-to\" name=\"search\" type=\"date\" formControlName=\"endDate\" required/>\n </div>\n </div>\n <p class=\"inline-error-message\" *ngIf=\"isStartDateLesthanEndDate || isDateRangeBetnWeek\">\n <span *ngIf=\"isStartDateLesthanEndDate\">Please select 'Date From' less than or equal to 'Date To'</span>\n <span *ngIf=\"isDateRangeBetnWeek\"> Please select the date range between 7 days</span>\n </p>\n <div class=\"btnsubmit\">\n <button type=\"submit\" (click)=\"downloadReport()\" class=\"button\" [disabled]=\"!reportsForm.valid || isDownLoadButtondisabled || isStartDateLesthanEndDate || isDateRangeBetnWeek\">Download report</button>\n </div>\n </form>\n \n`,\n styles: [`.govuk-radios__input:focus+.govuk-radios__label::before{border-width:4px;box-shadow:0 0 0 4px #ffaf00}.datefrom{width:50%;float:left}.dateto{width:50%;float:right}.govuk-label--m{font-size:large}.form-hint{padding-left:.7em}.header{margin-top:10px;margin-bottom:15px}.btnsubmit{margin-bottom:30px}.inline-error-message{color:#a71414;font-weight:700;margin-top:10px}`]\n})\nexport class ReportsComponent implements OnInit {\n reportsForm: FormGroup;\n startDate: string;\n endDate: string;\n ccdCaseNumber: string;\n isDownLoadButtondisabled:Boolean = false;\n isStartDateLesthanEndDate: Boolean = false;\n isDateRangeBetnWeek: Boolean = false;\n errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n paymentGroups: IPaymentGroup[] = [];\n\n constructor(\n private xlFileService: XlFileService,\n private errorHandlerService: ErrorHandlerService,\n private formBuilder: FormBuilder,\n private bulkScaningPaymentService: BulkScaningPaymentService,\n private paymentViewService: PaymentViewService) { }\n \n\n ngOnInit() {\n this.fromValidation();\n\n }\n\n getToday(): string {\n return new Date().toISOString().split('T')[0];\n }\n\n getSelectedFromDate(): void {\n this.validateDates(this.reportsForm.get('selectedreport').value);\n }\n\n validateDates(reportName){\n const selectedStartDate = this.tranformDate(this.reportsForm.get('startDate').value),\n selectedEndDate = this.tranformDate(this.reportsForm.get('endDate').value);\n const isDateRangeMoreThanWeek = (<any>new Date(selectedStartDate) - <any>new Date(selectedEndDate))/(1000 * 3600 * -24) > 7;\n if(new Date(selectedStartDate) > new Date(selectedEndDate) && selectedEndDate !== ''){\n this.reportsForm.get('startDate').setValue('');\n this.isDateRangeBetnWeek = false;\n this.isStartDateLesthanEndDate = true;\n } else if(reportName && reportName ==='SURPLUS_AND_SHORTFALL' && isDateRangeMoreThanWeek ) {\n this.isDateRangeBetnWeek = true;\n this.isStartDateLesthanEndDate = false;\n } else {\n this.isDateRangeBetnWeek = false;\n this.isStartDateLesthanEndDate = false;\n }\n\n }\n\n fromValidation() {\n this.reportsForm = this.formBuilder.group({\n selectedreport: new FormControl('') ,\n startDate: new FormControl(''),\n endDate: new FormControl('') \n });\n}\n\ndownloadReport(){\n this.isDownLoadButtondisabled = true;\n const dataLossRptDefault = [{loss_resp:'',payment_asset_dcn:'',env_ref:'',env_item:'',resp_service_id:'',resp_service_name:'',date_banked:'',bgc_batch:'',payment_method:'',amount:''}],\n unProcessedRptDefault = [{resp_service_id:'',resp_service_name:'',exception_ref:'',ccd_ref:'',date_banked:'',bgc_batch:'',payment_asset_dcn:'',env_ref:'',env_item:'',payment_method:'',amount:''}],\n processedUnallocated =[{resp_service_id:'',resp_service_name:'',allocation_status:'',receiving_office:'',allocation_reason:'',ccd_exception_ref:'',ccd_case_ref:'',payment_asset_dcn:'',env_ref:'',env_item:'',date_banked:'',bgc_batch:'',payment_method:'',amount:'',updated_by:''}],\n shortFallsRptDefault = [{resp_service_id:'',resp_service_name:'',surplus_shortfall:'',balance:'',payment_amount:'',ccd_case_reference:'',ccd_exception_reference:'',processed_date:'', reason:'', explanation:'', user_name:''}],\n selectedReportName = this.reportsForm.get('selectedreport').value,\n selectedStartDate = this.tranformDate(this.reportsForm.get('startDate').value),\n selectedEndDate = this.tranformDate(this.reportsForm.get('endDate').value);\n\n if(selectedReportName === 'PROCESSED_UNALLOCATED' || selectedReportName === 'SURPLUS_AND_SHORTFALL' ){\n this.paymentViewService.downloadSelectedReport(selectedReportName,selectedStartDate,selectedEndDate).subscribe(\n response => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n const result = JSON.parse(response);\n let res= {data: this.applyDateFormat(result)};\n if(res['data'].length === 0 && selectedReportName === 'PROCESSED_UNALLOCATED' ){\n res.data= processedUnallocated;\n } else if(res['data'].length === 0 && selectedReportName === 'SURPLUS_AND_SHORTFALL' ) {\n res.data= shortFallsRptDefault;\n } \n if(result['data'].length > 0) {\n for( var i=0; i< res['data'].length; i++) {\n if(res['data'][i][\"payment_asset_dcn\"] !== undefined) {\n res['data'][i]['env_ref'] = res['data'][i][\"payment_asset_dcn\"].substr(0,13);\n res['data'][i]['env_item'] = res['data'][i][\"payment_asset_dcn\"].substr(13,21);\n }\n if(res['data'][i][\"amount\"] !== undefined) {\n res['data'][i]['amount'] = this.convertToFloatValue(res['data'][i]['amount']);\n }\n if(res['data'][i][\"balance\"] !== undefined) {\n res['data'][i]['balance'] = this.convertToFloatValue(res['data'][i][\"balance\"]);\n }\n let Op = res['data'][i][\"surplus_shortfall\"];\n if(Op !== undefined) {\n res['data'][i]['surplus_shortfall'] = Op ==\"Surplus\" ? \"Over payment\":\"Under payment\";\n }\n if(res['data'][i][\"payment_amount\"] !== undefined) {\n res['data'][i]['payment_amount'] = this.convertToFloatValue(res['data'][i]['payment_amount']);\n }\n }\n } \n this.isDownLoadButtondisabled = false;\n this.xlFileService.exportAsExcelFile(res['data'], this.getFileName(this.reportsForm.get('selectedreport').value, selectedStartDate, selectedEndDate));\n },\n (error: any) => {\n this.isDownLoadButtondisabled = false;\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n })\n } else {\n this.bulkScaningPaymentService.downloadSelectedReport(selectedReportName,selectedStartDate,selectedEndDate).subscribe(\n response => {\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(false);\n const result = JSON.parse(response);\n let res = {data: this.applyDateFormat(result)};\n if(res['data'].length === 0 && selectedReportName === 'DATA_LOSS' ){\n res.data= dataLossRptDefault;\n } else if(res['data'].length === 0 && selectedReportName === 'UNPROCESSED'){\n res.data = unProcessedRptDefault;\n }\n if(result['data'].length > 0) {\n for( var i=0; i< res['data'].length; i++) {\n if(res['data'][i][\"amount\"] !== undefined) {\n res['data'][i]['amount'] = this.convertToFloatValue(res['data'][i]['amount']);\n }\n if(res['data'][i][\"payment_asset_dcn\"] !== undefined) {\n res['data'][i]['env_ref'] = res['data'][i][\"payment_asset_dcn\"].substr(0,13);\n res['data'][i]['env_item'] = res['data'][i][\"payment_asset_dcn\"].substr(13,21);\n }\n }\n }\n this.isDownLoadButtondisabled = false;\n this.xlFileService.exportAsExcelFile(res['data'], this.getFileName(this.reportsForm.get('selectedreport').value, selectedStartDate, selectedEndDate ));\n },\n (error: any) => {\n this.isDownLoadButtondisabled = false;\n this.errorMessage = this.errorHandlerService.getServerErrorMessage(true);\n })\n }\n }\n\n getFileName(selectedOption: string, startDate: string, endDate: string ) {\n const loc = 'en-US',\n stDt = formatDate(startDate, 'ddMMyy', loc),\n enDt = formatDate(endDate, 'ddMMyy', loc),\n now = new Date(),\n currentDate = formatDate(now, 'ddMMyy', loc),\n timestamp = `${currentDate}_${this.getTwodigit(now.getHours())}${this.getTwodigit(now.getMinutes())}${this.getTwodigit(now.getSeconds())}`,\n selectedOptionTxt = this.getCamelCaseString(selectedOption);\n \n return selectedOptionTxt+'_'+stDt+'_To_'+enDt+'_Run_'+ timestamp;\n } \n tranformDate(strDate: string) {\n let result = '';\n if (strDate) {\n let parts = strDate.split('-');\n result = `${parts[1]}/${parts[2]}/${parts[0]}`;\n }\n return result;\n }\n getTwodigit(input: number){\n return (\"0\" + input).slice(-2);\n }\n getCamelCaseString(selectedOption) {\n let result;\n switch(selectedOption) { \n case 'UNPROCESSED': { \n result = 'Unprocessed';\n break; \n } \n case 'DATA_LOSS': { \n result = 'Data_Loss';\n break; \n } \n case 'PROCESSED_UNALLOCATED': { \n result = 'Processed_Unallocated';\n break; \n } \n case 'SURPLUS_AND_SHORTFALL': { \n result = 'Over Payment_Under Payment';\n break; \n } \n default: { \n result = selectedOption;\n break; \n } \n } \n return result;\n }\n applyDateFormat(res) {\n const fmt = 'dd/MM/yyyy',\n loc = 'en-US';\n return res['data'].map(value => {\n if (value['date_banked']) {\n value['date_banked'] = formatDate(value['date_banked'], fmt, loc);\n }\n return value;\n });\n }\n \n convertToFloatValue(amt) {\n return amt ? Number.parseFloat(amt).toFixed(2): '0.00';\n }\n}\n","import { NgModule } from '@angular/core';\nimport {HttpClientModule} from '@angular/common/http';\nimport { CommonModule } from '@angular/common';\n\nimport {PaymentListComponent} from './components/payment-list/payment-list.component';\nimport {PaymentViewComponent} from './components/payment-view/payment-view.component';\nimport {CardDetailsComponent} from './components/card-details/card-details.component';\nimport {PageNotFoundComponent} from './components/page-not-found.component';\nimport {PaymentLibComponent} from './payment-lib.component';\nimport { StatusHistoryComponent } from './components/status-history/status-history.component';\nimport { PbaDetailsComponent } from './components/pba-details/pba-details.component';\nimport { LoggerService } from './services/shared/logger/logger.service';\nimport { ConsoleLoggerService } from './services/shared/logger/console-logger.service';\nimport { WebComponentHttpClient } from './services/shared/httpclient/webcomponent.http.client';\nimport { CaseTransactionsComponent } from './components/case-transactions/case-transactions.component';\nimport { FeeSummaryComponent } from './components/fee-summary/fee-summary.component';\nimport { ErrorBannerComponent } from './components/error-banner/error-banner.component';\nimport { MarkUnidentifiedPaymentComponent } from './components/mark-unidentified-payment/mark-unidentified-payment.component';\nimport { MarkUnsolicitedPaymentComponent } from './components/mark-unsolicited-payment/mark-unsolicited-payment.component';\nimport { UnprocessedPaymentsComponent } from './components/unprocessed-payments/unprocessed-payments.component';\nimport { ProcessedPaymentsComponent } from './components/processed-payments/processed-payments.component';\nimport { AllocatePaymentsComponent } from './components/allocate-payments/allocate-payments.component';\nimport { AddRemissionComponent } from './components/add-remission/add-remission.component';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CcdHyphensPipe } from './pipes/ccd-hyphens.pipe';\nimport { keyValuePipe } from './pipes/key-value.pipe';\nimport { SanitizeHtmlPipe } from './pipes/sanitize-html.pipe';\nimport { ReportsComponent } from './components/reports/reports.component';\nimport { XlFileService } from './services/xl-file/xl-file.service';\n\n\n@NgModule({\n imports: [\n CommonModule,\n HttpClientModule,\n FormsModule,\n ReactiveFormsModule\n ],\n declarations: [\n PaymentLibComponent,\n PaymentListComponent,\n PaymentViewComponent,\n CardDetailsComponent,\n PageNotFoundComponent,\n StatusHistoryComponent,\n MarkUnidentifiedPaymentComponent,\n MarkUnsolicitedPaymentComponent,\n UnprocessedPaymentsComponent,\n ProcessedPaymentsComponent,\n AllocatePaymentsComponent,\n PbaDetailsComponent,\n CaseTransactionsComponent,\n FeeSummaryComponent,\n AddRemissionComponent,\n CcdHyphensPipe,\n keyValuePipe,\n SanitizeHtmlPipe,\n ReportsComponent,\n ErrorBannerComponent\n ],\n exports: [ PaymentLibComponent ],\n providers: [ \n { provide: LoggerService, useClass: ConsoleLoggerService },\n XlFileService,\n WebComponentHttpClient\n ]\n})\n\nexport class PaymentLibModule { }\n"]}
|