{"version":3,"sources":["page/Dashboard/components/ConsolidatedLoans/Table/index.module.scss","page/UserManagement/index.module.scss","components/Loading/index.module.scss","page/Dashboard/index.module.scss","page/Dashboard/components/ConsolidatedLoans/index.module.scss","page/Dashboard/components/ConsolidatedFactoring/index.module.scss","page/Factoring/components/ViewEditNotes/factoring.module.scss","page/Factoring/ClientStatement/index.module.scss","page/Factoring/CustomerPayment/ReceiptDetail/index.module.scss","page/Factoring/CustomerPayment/CreditNoteDetail/index.module.scss","page/Loan/LoanStatement/index.module.scss","page/Loan/InstalmentSchedule/index.module.scss","page/Loan/TransactionReport/index.module.scss","page/Factoring/FundingAvailablity/index.module.scss","utils/message-helper.tsx","utils/config.ts","services/CacheService.ts","services/axiosInterceptorsSet.ts","services/requestIdentityApi.ts","services/IdentityApi.ts","services/request.ts","services/userService.ts","locales/en-US.ts","components/CustomForm/index.tsx","page/ChangePassword/index.tsx","services/requestFactoring.ts","services/factoring/index.ts","utils/enums.ts","utils/consts/commons.ts","utils/render-helper.tsx","utils/common-helper.ts","page/Dashboard/components/ConsolidatedLoans/Table/data.d.ts","components/Loading/index.tsx","utils/loading-animation.ts","components/CustomTableFilter/DateFilter/index.tsx","components/CustomTableFilter/MultiSelectFilter/index.tsx","components/CustomTableFilter/NumberFilter/index.tsx","page/Dashboard/components/ConsolidatedLoans/Table/index.tsx","page/Dashboard/components/ConsolidatedLoans/index.tsx","utils/consts/icon-consts.ts","page/Factoring/utils/index.tsx","page/Dashboard/components/ConsolidatedFactoring/ConsolidatedFactoringTable/index.tsx","page/Dashboard/components/ConsolidatedFactoring/index.tsx","page/Dashboard/index.tsx","services/user.ts","page/Logout.tsx","utils/print-helper.ts","page/Factoring/components/PrintStatement.tsx","utils/common-contents.tsx","page/Factoring/components/ClientStatementBanner.tsx","page/Factoring/components/ClientTransactionsTable/index.tsx","page/Factoring/components/ViewEditNotes/index.tsx","page/Factoring/CustomerPayment/ReceiptsTable.tsx","page/Factoring/ClientStatement/index.tsx","page/Factoring/CustomerPayment/ActionButtons.tsx","components/CustomTable.tsx","page/Factoring/CustomerPayment/ReceiptDetail/CreditTable.tsx","page/Factoring/CustomerPayment/ReceiptDetail/InvoiceTable.tsx","page/Factoring/CustomerPayment/ReceiptDetail/TranscationTable.tsx","page/Factoring/ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-utils.tsx","page/Factoring/CustomerPayment/ReceiptDetail/index.tsx","page/Factoring/CustomerPayment/CreditNote.tsx","page/Factoring/CustomerPayment/CreditNoteDetail/InvoiceTable.tsx","page/Factoring/CustomerPayment/CreditNoteDetail/TranscationTable.tsx","page/Factoring/CustomerPayment/CreditNoteDetail/index.tsx","page/Factoring/CustomerPayment/index.tsx","services/factoring/customerStatement/index.ts","page/Factoring/CustomerStatement/ActionButtons.tsx","page/Factoring/CustomerStatement/CustomerStatementTable.tsx","page/Factoring/CustomerStatement/index.tsx","page/UserManagement/UserDetailModal/index.tsx","page/UserProfile/index.tsx","page/UserManagement/UserDetailModal/UserDetail.tsx","page/Factoring/ScheduleOfInvoices/components/ViewReceivables/index.tsx","page/UserManagement/UserDetailModal/UpdatePassword.tsx","page/UserManagement/index.tsx","page/Factoring/ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-grid-body.tsx","page/Factoring/ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-grid-filters.tsx","page/Factoring/ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-grid-header.tsx","page/Factoring/ScheduleOfInvoices/components/ViewReceivablesTransactions/index.tsx","page/Factoring/ScheduleOfInvoices/components/ViewReceivablesTags/index.tsx","page/Factoring/ScheduleOfInvoices/components/ViewCreditNotes/index.tsx","page/Factoring/ScheduleOfInvoices/components/ViewCreditNoteTransactions/index.tsx","page/Factoring/ScheduleOfInvoices/components/ReceiveableTable/ReceivableTable.tsx","utils/message-hub-helper.ts","page/Loan/LoanStatement/components/SelectAccountAndMonth.tsx","page/Factoring/ScheduleOfInvoices/index.tsx","page/Loan/InstalmentSchedule/components/SelectAccount.tsx","page/Loan/LoanStatement/components/LoanStatementTable/index.tsx","page/Loan/LoanStatement/index.tsx","page/Loan/TransactionReport/components/SelectAccount.tsx","page/Loan/InstalmentSchedule/components/InstalmentScheduleTable/index.tsx","page/Loan/InstalmentSchedule/index.tsx","components/CustomDateRangeSelector/index.tsx","page/SignInV2/SignInForm/index.tsx","page/Loan/TransactionReport/components/TransactionReportTable/index.tsx","page/Loan/TransactionReport/index.tsx","page/Factoring/OverdueAnalysis/OverdueAnalysisTable.tsx","page/Factoring/OverdueAnalysis/index.tsx","page/Factoring/FundingAvailablity/index.tsx","Routes.tsx","layout/BaseLayout.tsx","page/SignInV2/RowGap/index.tsx","page/SignInV2/index.tsx","App.tsx","reportWebVitals.js","index.js","page/Factoring/ScheduleOfInvoices/factoring.module.scss","layout/index.module.scss","page/SignInV2/index.module.scss","page/SignInV2/SignInForm/index.module.scss","page/Factoring/CustomerPayment/index.module.scss","page/Factoring/CustomerStatement/index.module.scss","page/UserManagement/UserDetailModal/index.module.scss","components/CustomForm/index.module.scss","components/CustomTableFilter/NumberFilter/index.module.scss","page/Factoring/components/ClientTransactionsTable/index.module.scss","page/UserProfile/index.module.scss","page/Factoring/ScheduleOfInvoices/index.module.scss","page/Factoring/OverdueAnalysis/index.module.scss"],"names":["module","exports","messageRef","React","createRef","messageHelper","detail","current","show","severity","summary","life","options","header","onAccept","onReject","acceptLabel","rejectLabel","hideAcceptButton","hideRejectButton","confirmDialog","message","icon","footer","confirmOptions","accept","reject","type","className","onClick","autoFocus","process","REACT_APP_CLIENT_ID","REACT_APP_CLIENT_SECRET","REACT_APP_SCOPE","REACT_APP_IDENTITY_API_URL","config","identityServerURL","REACT_APP_IDENTITY_SERVER_URL","identityApi","factoringApi","REACT_APP_FACTORING_API_URL","clientId","clientSecret","scope","adminString","REACT_APP_ADMIN_STRING","userString","REACT_APP_USER_STRING","gbfsAdminString","REACT_APP_GBSF_ADMIN","AUTH_USER","TOKEN","USER_ROLE","storeAuthUser","user","sessionStorage","setItem","JSON","stringify","removeItem","setToken","token","getCurrentUserRole","roleString","getItem","parse","getToken","hasRole","roles","userRole","currentUserHasRole","some","role","map","i","name","includes","getCurrentUserCompanyId","currentUser","decode","companyID","getCurrentUserCompany","company","getCurrentUser","axios","interceptors","request","use","headers","Authorization","error","Promise","response","resolve","status","data","isCancel","success","errorMessages","errors","Object","keys","key","getErrorMessages","window","location","pathname","href","requestIdentityApi","params","url","cloneData","cloneDeep","baseURL","then","statusText","result","Blob","statusCode","catch","msg","String","finally","changeCurrentUserPassword","method","changePassword","getUsers","getUsersByRoles","roleId","searchText","page","pageSize","getUserDetail","userId","DeleteUser","GetUserRoles","SetUserClaims","claims","DeleteUserClaims","claimId","SetUserRoles","DeleteUserRoles","GetAdminRoleId","GetUserRoleId","GetGBFSAdminRoleId","GetUserClaims","getUserInfo","logout","loginByPassword","Lang","CustomForm","props","formik","fieldsArray","title","saving","submitText","isFormFieldValid","touched","getFormErrorMessage","styles","pageWrap","fromWrap","fromContainer","onSubmit","handleSubmit","string","renderItem","field","id","value","values","undefined","onChange","handleChange","rows","feedback","rules","label","htmlFor","style","whiteSpace","renderFormItems","loading","initialValues","password","confirmPassword","required","ChangePassword","setSaving","useFormik","validate","length","match","a","userInfoRes","sub","res","resetForm","warn","requestFactoring","getFactoringLineStatement","factoringLineId","getFactoringLineActivationDate","GetFactoringLines","getCustomerPayment","getReceiptTransactions","depositAccountEncodedKey","getCreditNotesTransactions","GetViewDaysAgeingReportTaskStatus","taskId","RunBorrowerInvestmentSummaryTask","GetBorrowerInvestmentSummaryTaskStatus","Date","getTime","getInvoiceRepaymentTransactions","loanAccountEncodedKey","GetLoanModuleDropdownSource","GetLoanStatement","loanAccountId","month","RunLoadReceivablesTask","connectionId","GBFSDataType","StatementPrintType","FactoringPreFilterType","ReceivableTypeEnums","ReceivableBulkActionType","InvoiceStatusEnums","conditionFilterSelectors","TIME_FORMAT","gbfsTextAreaEncode","text","convertMambuErrorMessage","toString","split","join","toLowerCase","convertStrToDate","str","moment","toDate","getMonthBeginDate","year","getMonthEndDate","beginDate","add","toGBFSCurrencyNumberFormatStr","n","keepZero","numeral","format","toGBFSCurrencyNumberFormatStrWithBracket","toGBFSPercentageNumberFormatStr","toGBFSNumberFormatStr","toGBFSNumberFormatStrWithBracket","toGBFSDynamicNumberFormatStr","toGBFSIntegerNumberFormatStr","toGBFSDateWithoutDayFormatStr","d","toGBFSDateFormatStr","toOrignalDateFormatStr","toOrignalDateOnlyFormatStr","toDateTimesNumber","oStr","getDateTimesNumberList","from","to","days","diff","index","timeNumber","push","formatItemValueByFieldType","dType","keepMinusSign","emptySign","getEmptyValueSign","Currency","Percentage","IntegerNumber","DecimalNumber","DynamicDecimalNumber","checkNumber","Number","toFixed","None","Text","TextArea","defatuleMask","getFilterMatchModel","condition","filterMatch","getYearMonthDropdownOptions","endDate","resOptions","beginYr","getFullYear","beginMo","getMonth","endYr","endMo","y","mEnd","m","dStr","item","monthBeginDate","monthEndDate","getLastMonth","today","getLastMonthBeginDate","lastmonth","getLastMonthEndDate","renderMoney","isNaN","toLocaleString","currency","replace","renderMoneyWithCurrencyCode","fundingSymbol","isNegativeNumber","renderPercent","getTodayDate","getDate","getCalendarYearRange","curYr","DateTypeEnum","Loading","wrap","alt","src","LoadingAnimation","this","showLoadingIcon","hideLoadingIcon","document","getElementById","div","createElement","top","position","backgroundColor","opacity","zIndex","body","appendChild","ReactDOM","render","removeChild","DateFilter","tableRef","reset","selectedMonth","onDateChange","defaultMonth","selectedToDate","setSelectedToDate","selectedFromDate","setSelectedFromDate","viewDate","setViewDate","selectedMonthMoment","timesArry","filter","paddingTop","paddingLeft","marginRight","width","paddingRight","appendTo","inputId","maxDate","event","dateFormat","lineHeight","minDate","onViewDateChange","e","MultiSelectFilter","selectedOptions","setSelectedOptions","panelClassName","optionLabel","optionValue","defaultCondition","NumberFilter","doFilterNumber","selectedCondition","setSelectedCondition","filterValue","setFilterValue","conditionDropdown","valueInput","mode","maxFractionDigits","minFractionDigits","getValue","state","statusWrap","date","ConsilidatedLoansTable","tableData","displayedData","setDisplayData","clearFilter","setClearFilter","setOptions","total","reduce","preValue","currentItem","totalBalance","loanBalance","totalLoanAmount","loanAmount","compareFunction","b","accountId","stateDisplay","product","stateSet","Set","accountNameSet","productSet","forEach","has","productName","sort","getOptions","filterNumber","fm","tableFields","sortable","filterElement","textAlign","target","content","hideDelay","marginTop","marginLeft","tableWrap","footerColumnGroup","colSpan","footerStyle","scrollable","scrollHeight","ref","onValueChange","rowData","headerStyle","ConsolidatedLoans","consolidatedLoansTableData","pendingVerificationIcon","expiredIcon","postdatedIcon","tagIcon","currencyExchangeIcon","getFundingCurrencyOptions","currencySet","fundingCurrencyCode","getCurrencyOptions","currencyCode","renderExchangeContentForDetailTable","isBaseCurrency","symbol","exchangeRate","forexInfo","marginBottom","tooltip","tooltipOptions","showDelay","height","ConsolidatedFactoringTable","consolidatedFactoringData","choosenCurreny","displayTableData","setDisplayTableData","filteredTableData","setFilteredTableData","newDisplayTableData","accountNo","accountReference","accountNoSet","accountRefSet","initTotalValue","totalDebts","totalEligible","fundsInUse","clientAccountLimit","currencyFundingSymbol","ConsolidatedFactoring","currencyOptions","setCurrencyOptions","newCurrencyOptions","multiple","activeIndex","retryAfter","Dashboard","setConsolidatedLoansTableData","borrowerInvestmentSummary","setBorrowerInvestmentSummary","mountedRef","someError","getConsolidatedLoanList","activationDate","closedDate","getBorrowerInvestmentSummaryTaskStatus","maxRetryAfter","taskRes","taskStatus","sourceRes","isFactoringLine","setTimeout","getBorrowerInvestmentSummaryData","allSettled","hide","loadData","User","_isAdmin","_isGBFSAdmin","_initialized","init","Logout","FormData","append","logoutService","resetUser","history","GBFSPrint","printId","docTitle","base64","printHeader","printJS","printable","documentTitle","targetStyles","maxWidth","onLoadingStart","onLoadingEnd","PrintStatement","onClose","printType","customerDropList","activedFactoringLineId","valueDateYearMonthValue","setValueDateYearMonthValue","customerBranchValue","setCustomerBranchValue","isCustomerStatement","CustomerStatement","getFilterBody","dItem","find","f","filterBody","customerEncodedKey","branch","printData","includePreview","printContents","clsx","Client","CustomerPayment","getTitle","showClear","filterBy","placeholder","gbfsContentWithNone","s","buildFacliSubTitleByExtra","activedFactoringLineName","companyName","currentFilterDropdownColumnType","FilterDropdownColumnType","filterBeginDate","ClientStatementBanner","source","isInitCompleted","setIsInitCompleted","getClientAccountLimitStr","fiuFacility","fLimit","getClientOverallLimitStr","overallFundsInUse","clientOverallLimit","overallFiu","cTotalLimit","display","accountOfficer","initialPaymentPercentage","overdraftInterestRateDisplay","loReference","factoringChargePercentage","bank","loDate","financingPeriodDays","bankAccountNo","alignItems","accountGrade","gradingNextReviewDate","dangerouslySetInnerHTML","__html","notes","ViewEditNotes","unmount","notesValue","setNotesValue","initData","handleCancel","minHeight","yearMonthFilterDropdownSource","balancesBroughtForwardItemId","ClientTransactionsTable","accountTransactionSourceRef","isResetFilter","setIsResetFilter","accountTransactionSource","setAccountTransactionSource","transactionFilteredSource","setTransactionFilteredSource","valueDateYearMonthFilterValue","setValueDateYearMonthFilterValue","valueDateFromFilterValue","setValueDateFromFilterValue","valueDateToFilterValue","setValueDateToFilterValue","fromViewDate","setFromViewDate","toViewDate","setToViewDate","selFilterTransactionSubType","setSelFilterTransactionSubType","selFilterSalesLedgerTransactionCondition","setSelFilterSalesLedgerTransactionCondition","filterSalesLedgerTransaction","setFilterSalesLedgerTransaction","selFilterAmountCondition","setSelFilterAmountCondition","filterAmount","setFilterAmount","selFilterBalanceCondition","setSelFilterBalanceCondition","filterBalance","setFilterBalance","transactionSubTypeDropdownSource","setTransactionSubTypeDropdownSource","showViewEditNotes","setShowViewEditNotes","viewEditNotesSource","setViewEditNotesSource","bottomSumStatementSource","setBottomSumStatementSource","selFilterSalesLedgerBalanceCondition","setSelFilterSalesLedgerBalanceCondition","filterSalesLedgerBalance","setFilterSalesLedgerBalance","bannerData","setBannerData","showPrintPreview","setShowPrintPreview","factoringLines","setFactoringLines","setActivedFactoringLineId","setCurrency","monthOptions","setMonthOptions","setYearMonthFilterDropdownSource","getStatement","statementRes","topBannerInfo","tranSource","transactions","setDropdownSource","getActivationDate","getMonthOptions","all","getFactoringLine","dValue","setValueDateFilter","setDefaultDateFilter","bottomSumStatementTotalSource","gstRateSet","gstRateMap","Map","sIdentify","summationIdentify","slTranAmount","salesLedgerTransaction","fiuAmount","amount","isCustomerPayment","customerPaymentFilteredTotal","isScheduleOfOffer","scheduleOfOfferFilteredTotal","isCreditNote","creditNotesFilteredTotal","isInitialPaymentAdvance","fundingToClientFilteredTotal","isFactoringCharge","factoringChargeFilteredTotal","isOtherCharge","otherChargeFilteredTotal","isGst","gstFilteredTotal","isGstStandardRatedCharge","gstRateInPercent","newGstAmount","get","set","isGstZeroRatedCharge","gstZrcFilteredTotal","gstSrcFilteredTotals","Array","rate","isDefinedGstRateInPercent","findIndex","TransactionSubType","dropdownSource","ts","transactionSubType","localeCompare","getTransactionSubTypeSource","getOriginalSource","fromDate","doFilterForBottomSumSource","calDateFromFilterInput","calDateToFilterInput","orignalSource","dFromTimesNumber","dToTimesNumber","bottomSource","valueDateFilter","buttonContainer","factoringLinesContainer","actionButton","emptyMessage","filteredData","fDate","dTimesNumber","prevFilteredItems","bbfSlt","bbfRes","reservesTransaction","prevBalance","balance","balancesBroughtForwardItem","filterDate","salesLedgerBalance","pre","bIndex","splice","dBfFilteredIndex","setBroughtForwardItem","getSalesLedgerTransactionTotalAmount","dFilteredSource","dSource","footerGroup","rowHover","float","valueDate","forexReference","reference","referenceExtra","margin","padding","filterMatchMode","filterHeaderStyle","enableNotesEditor","viewEditNoteSource","transactionEncodedKey","ClientStatement","ActionButtons","showPrintButton","activedFactoringLine","onActivedFactoringLineChange","CustomTable","columns","columnKey","CreditTable","dateFilterCondition","setDateFilterCondition","dateFilterValue","setDateFilterValue","amountFilterCondition","setAmountFilterCondition","amountFilterValue","setAmountFilterValue","doOCNFilterNumber","OCNDateFilter","filterTimesNumber","yearNavigator","monthNavigator","yearRange","crditNoteAmountBeforeApplied","dueAmountInCurrency","min","InvoiceTable","setDateCondition","dueDateFilterCondition","setDueDateFilterCondition","dueDateFilterValue","setDueDateFilterValue","selFilterINUnappliedAmountCondition","setSelFilterINUnappliedAmountCondition","filterINUnappliedAmount","setFilterINUnappliedAmount","doINFilterNumber","INDateFilter","INDueDateFilter","invoiceAmountBeforeApplied","TranscationTable","transactionSource","setTransactionSource","setLoading","loadSource","transactionType","transactionReferenceTypeDesc","val","amountInCurrency","dueAmount","renderExchangeContent","fields","customer","branchValue","customRender","branchName","receiptId","paymentMethod","receiptDate","paymentSource","chequeReference","receiptAmount","unappliedAmount","accountStateDisplay","fieldArray","exchangeContent","justifyContent","dateString","renderDate","ReceiptDetail","receiptFormData","setReceiptFormData","customerId","creditNoteSource","creditNotesFormSource","creditNoteId","creditNoteDate","applyToCreditNoteId","invoiceTableData","invoicesFormSource","invoiceId","invoiceDate","invoiceDueDate","applyToInvoiceId","getInitData","isLongField","minWidth","receiptAmountForexReference","unappliedAmountForexReference","paddingBottom","customTableWrap","currentFilterOAPDropdownColumnType","ReceiptsTable","setSelecteMonth","openDetail","setOpenDetail","selectedDetail","setSelectedDetail","accountPaymentFilteredSource","setAccountPaymentFilteredSource","selFilterOAPBranch","setSelFilterOAPBranch","selFilterOAPCustomers","setSelFilterOAPCustomers","selFilterOAPReceiptAmountCondition","setSelFilterOAPReceiptAmountCondition","filterOAPReceiptAmount","setFilterOAPReceiptAmount","selFilterOAPUnappliedAmountCondition","setSelFilterOAPUnappliedAmountCondition","filterOAPUnappliedAmount","setFilterOAPUnappliedAmount","OAPCustomerSource","setOAPCustomerSource","OAPBranchsSource","setOAPBranchsSource","selFilterOAPStatus","setSelFilterOAPStatus","OAPStatusSource","setOAPStatusSource","troggleSetDefaultFilter","setTroggleSetDefaultFilter","setOAPDropdownSource","Customer","customers","getCustomerSource","Branch","bSource","getBranchSource","Status","getStatusSource","setDate","newfromDate","newtoDate","doOAPFilterNumber","newSelectedMonth","receiptAmountForTablePresent","valReceiptAmount","valRes","paginator","rowsPerPageOptions","Dialog","visible","modal","onHide","documentId","scheduleNo","creditNoteAmount","CreditNoteDetail","setTableData","loadReceiptFormData","creditNoteAmountForexReference","tabType","CreditNote","creditNoteAmountForTablePresent","valcnAmount","getPrintMonthOptions","setActivedFactoringLine","printMonthOptions","setPrintMonthOptions","receipts","setActiveIndex","statement","setStatement","creditNote","setCreditNote","setChoosenCurreny","accountCreditNotes","accountPayments","newActivedFactoringLine","model","onTabChange","getPrintStatementCustomersDropdownList","RunLoadCustomerStatementTask","GetLoadCustomerStatementTaskStatus","statementFields","activedCustomer","setActiveCustomer","setCustomerDropList","getCustomerDropList","newMonthOptions","currentTaskId","UserClaimValue","valueSet","CustomerStatementTable","setfilteredTableData","dueDate","debit","credit","balanceInCurrency","color","fontWeight","currencyMapStatement","setCurrencyMapStatement","getLoadCustomerStatementTaskStatus","dataMap","currencyCodeSet","customerStatementPrintData","handleData","documentDateFilter","documentDate","dueDateFilter","creditInCurrency","Math","abs","defaultCurrencyCode","runLoadCustomerStatementTask","newCurrency","UserProfile","setDetail","email","getDetail","root","background","pos","isAdmin","userName","emailConfirmed","phoneNumber","phoneNumberConfirmed","lockoutEnabled","twoFactorEnabled","accessFailedCount","lockoutEnd","companyId","UserDetail","test","isGBFSAdmin","rej","formikRef","setFieldValue","submit","submitForm","console","log","isCreate","disabled","checked","errorMessage","canView","FieldItemType","updateCompany","formValue","userClaimMap","claimValue","claimType","setUserRole","currentUserRoleIds","userRoleId","adminRoleId","gbfsAdminRoleId","admin","gbfsAdmin","UserDetailModal","modalVisible","setModalVisible","refreshPage","userDetail","setUserDetail","setAdminRoleId","setGbfsAdminRoleId","setUserRoleId","setCurrentUserRoleIds","setUserClaimMap","modalRef","hasError","getUserDetailData","userDetailRes","userRolesRes","userClaimsRes","userClaims","getAdminRoleId","totalCount","getGbfsAdminRoleId","getUserRoleId","roleIds","updateUser","userInfo","setIsAdmin","createUser","setCompany","setPassword","validateUser","userRes","users","overflow","isMobile","matchMedia","matches","UserManagement","setUsers","globalFilter","setGlobalFilter","selectedUserId","setSelectedUserId","updatePasswordModalVisible","setUpdatePasswordModalVisible","rolesMap","setRolesMap","timer","getUsersService","adminRoleRes","userRoleRes","gbfsAdminRoleRes","getRolesId","clearTimeout","tableStyle","showUpdatePasswordModal","showUserDetailModal","removeUser","removeUserRoles","userRoles","removeUserClaims","haveError","removeUserRolesByActiveIndex","activeIndex2String","Roles2Delete","restRoles","acceptClassName","openConfirmDialog","UpdatePassword","customerBodyTemplate","branchNameBodyTemplate","createdDateBodyTemplate","createdDateFilter","createdDate","documentDateBodyTemplate","dueDateBodyTemplate","documentAmountBodyTemplate","documentAmount","documentAmountForTablePresent","handledValue","receivableType","CN","documentAmountForexReference","dueAmountBodyTemplate","valDocumentAmount","dueAmountForexReference","paymentStatusBodyTemplate","isOverDue","invoiceStatusDisplyArray","PendingVerification","Others","PastFinancingPeriod","Postdated","invoiceStatusBodyTemplate","invoiceTags","invoiceCustomTags","isOpen","isInvoiceClosed","accountState","statusList","invoiceStatusList","Eligible","maxHolderCount","renderedHolderCount","otherTags","tagType","tooltipWith","maxCharLength","tLength","tag","getSuitableTagToolTipWidth","rowKey","tagItem","imgSrc","cursor","visibility","tagOpenDateBodyTemplate","tagOpenDateFilter","tagOpenDate","settingOverlayPanel","viewCustomerBranchSettingSource","op","noMargin","cbSetting","showCloseIcon","customerLimit","creditTermDays","invoiceVerificationLimit","showBranchNameCol","showPwoCol","showCreditTermCol","receivablesFilteredSource","showOpenDateCol","prevColSpan","nextColSpan","getDocumentAmountTotalFooterValue","getDueAmountTotalFooterValue","invoicesSource","IN","creditNotesSource","onInvoiceStatusCustomFilter","indexOf","renderCustomerFilter","receivablesSourceRef","selFilterCustomers","setSelFilterCustomers","customerSource","callback","renderCreditTermFilter","filterCreditTerm","selFilterCreditTermCondition","setSelFilterCreditTermCondition","setFilterCreditTerm","renderOverDueDaysFilter","filterOverDueDays","selFilterOverDueDaysCondition","setSelFilterOverDueDaysCondition","setFilterOverDueDays","renderDocumentAmountFilter","filterDocumentAmount","selFilterDocumentAmountCondition","setSelFilterDocumentAmountCondition","setFilterDocumentAmount","renderDueAmountFilter","filterDueAmount","selFilterDueAmountCondition","setSelFilterDueAmountCondition","setFilterDueAmount","renderBranchFilter","selFilterBranch","setSelFilterBranch","branchsSource","renderTypeFilter","selFilterType","setSelFilterType","typesSource","ReceivableType","renderStatusFilter","selFilterStatus","setSelFilterStatus","statusSource","PaymentStatus","renderInvoiceStatusFilter","selFilterInvoiceStatus","setSelFilterInvoiceStatus","invoiceStatusSource","InvoicesStatus","renderClearFilter","setReceivablesFilteredSource","currentFilterDropdownColumnTypeCallback","clearFilters","calCreatedDateFilterInput","calDocumentDateFilterInput","calDueDateFilterInput","calTagOpenDateFilterInput","branchHeader","setShowBranchNameCol","scheduleNoHeader","setShowPwoCol","documentDateHeader","setShowCreditTermCol","invoiceStatusHeader","setShowOpenDateCol","ViewReceivablesTransactions","transactionSourceRef","invoiceTagCellItem","oldValue","showRequired","emptyInvoiceTagItem","S4","random","substring","guid","tagStatus","tagRemarks","openDate","resolvedDate","patchPathIndex","isNew","enterResult","ViewReceivablesTags","viewItemTagsSource","receivableTagsSource","setReceivableTagsSource","t","inEdit","ViewReceivables","viewItemSource","receivableItemSource","setReceivableItemSource","setLoanAccountId","tagsSource","setTagsSource","showTransactionsView","setShowTransactionsView","subTitle","addPartialItemStyle","itemType","DueAmount","checkIsPartiallyApplied","isPartiallyPaid","formatedValue","renderPaymentStatusItem","fistColWith","secondColWith","DocumentId","CreateDate","purchaseWorkOrder","PurchaseWorkOrder","ScheduleNo","DocumentDate","DueDate","creditTerm","CreditTerm","DocumentAmount","flexGrow","renderItems","paymentStatus","ViewCreditNoteTransactions","showAtPage","narrowFirstCol","ViewCreditNotes","renderStatusItem","runLongRequestMethod","receiveMsgHandler","doActionHandler","protocol","signalR","sr","withUrl","withHubProtocol","withAutomaticReconnect","build","on","stop","start","err","onreconnected","FieldEnum","mounted","ReceivableTable","receivablesSource","setReceivablesSource","setStatusSource","setCustomerSource","setBranchsSource","setTypesSource","setInvoiceStatusSource","setViewCustomerBranchSettingSource","viewEditItemSource","setViewEditItemSource","setSelectedMonth","setPage","invoiceFilterTags","handleSouce","rUtils","invoiceStatus","invoiceTagsList","si","sortValue","tSource","typeName","receivableTypeDisplay","settingsViewOp","rGridBodys","currentPageReportTemplate","paginatorTemplate","sortField","sortOrder","first","onPage","dom","getElementsByClassName","scrollTop","tryScrollToTop","customerBranchSetting","aria-haspopup","aria-controls","toggle","rGridFilters","o","rGridHeaders","filterFunction","getFactoringLinesName","factoringLineName","getFactoringLinesNameExcludeId","ScheduleOfInvoices","setActivedFactoringLineName","productEnum","SelectAccountAndMonth","onSearch","productOptions","setProductOptions","accountOptions","setAccountOptions","chooseProduct","setChooseProduct","chooseAccount","setChooseAccount","chooseMonth","setChooseMonth","setMonth","object","productDropdownList","accountDropdownList","newAccountOptions","productEncodedKey","getLoanModuleDropdownSource","trySetMonth","newChooseAccount","loanProduct","newChooseProduct","trySetAccount","accountNumber","statementMonth","downloadLoanStatement","flexWrap","flexShrink","alignSelf","justifySelf","LoanStatementTable","setDisplayedData","transactionTypeSet","clearBeforeFilters","totalDebit","outstandingBalance","feeAppliedName","LoanStatement","fontSize","SelectAccount","InstalmentScheduleTable","statusOptions","setStatusOptions","totalExpected","totalPaid","totalDue","paidDate","InstalmentSchedule","CustomDateRangeSelector","grantType","getDateRangeStr","dateRange","startDate","lastFriday","weekday","setDateRange","updateDefaultDateRange","aMounthAgo","isSameOrBefore","defaultAccount","getMCALoanAccountsSource","startDateStr","endDateStr","chooseAccountObj","newDateRange","TransactionReportTable","autoLayout","transactionDescription","paidDetails","deposit","withdrawal","runningBalance","TransactionReport","account","getRowKey","clientEncodedKey","clientAccountId","initTableData","tableDataMapCache","setTableDataMapCache","showLastPayment","setShowLastPayment","currentTableDataMap","accountData1Map","newTableData","currentRowIndex","showAccount","showExpendBranchIcon","handleTableData","textOverflow","branchExpand","preTableData","tableDataMap","rowIndex","shrinkRows","newCurrentTableData","shinkRowsTotal","sum","totalAmount","notDue","dayRange1Amount","dayRange2Amount","dayRange3Amount","dayRange4Amount","dayRange5Amount","getShinkTableData","expandRows","newData","getExpandTableData","borderLeft","lastPayment","lastPaymentDate","headerColumnGroup","rowSpan","totalCustomerLimit","totalLastPayment","totalArray","OverdueAnalysis","lastUpdatedTime","setLastUpdatedTime","getAgeing","getViewDaysAgeingReportTaskStatus","getReport","getReportTaskId","runGetReportWork","report","currentResult","clientExpand","defaultBranch","OverdueAnalysisTable","protectedRoutes","path","component","accountReferenceSet","currentAvailability","adminRoute","requireLogin","_from","next","redirect","authUser","BaseLayout","mobileOpen","setMobileOpen","useHistory","topItems","command","itemIsNull","items","bottomItems","baseItems","adminOnlyItems","drawer","menuWrap","topbar","aria-label","mobileCustomSider","customSider","guards","fallback","route","exact","SignInForm","setHasError","onFinish","username","client_id","grant_type","client_secret","qs","access_token","getUserRoles","staff","fieldContainer","fieldContainerHasError","loginWrap","forgotPassword","preventDefault","onForgotPassword","RowGap","baseHeight","SignInV2","left","logo","bottom","partnerLogos","hideOnMobile","hideOnPC","rel","right","man","man_mobile","createBrowserHistory","App","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","StrictMode"],"mappings":"yGACAA,EAAOC,QAAU,CAAC,UAAY,yBAAyB,WAAa,0BAA0B,YAAc,2BAA2B,UAAY,2B,oBCAnJD,EAAOC,QAAU,CAAC,KAAO,6BAA6B,IAAM,4BAA4B,eAAe,uC,oBCAvGD,EAAOC,QAAU,CAAC,KAAO,sBAAsB,QAAU,2B,oBCAzDD,EAAOC,QAAU,CAAC,KAAO,wBAAwB,YAAc,+BAA+B,QAAU,6B,oBCAxGD,EAAOC,QAAU,CAAC,KAAO,kC,oBCAzBD,EAAOC,QAAU,CAAC,KAAO,sC,mBCAzBD,EAAOC,QAAU,CAAC,cAAgB,iCAAiC,YAAY,6BAA6B,UAAU,2BAA2B,kBAAkB,mCAA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,8BAA8B,eAAiB,qC,mBCAvQD,EAAOC,QAAU,CAAC,KAAO,8BAA8B,gBAAkB,yCAAyC,wBAA0B,iDAAiD,eAAiB,wCAAwC,OAAS,gCAAgC,aAAe,wC,mBCA9SD,EAAOC,QAAU,CAAC,KAAO,gCAAgC,gBAAkB,2CAA2C,wBAA0B,mDAAmD,eAAiB,0CAA0C,OAAS,kCAAkC,aAAe,0C,mBCAxTD,EAAOC,QAAU,CAAC,cAAgB,uCAAuC,aAAe,wC,mBCAxFD,EAAOC,QAAU,CAAC,SAAW,6BAA6B,SAAW,6BAA6B,cAAgB,oC,mBCAlHD,EAAOC,QAAU,CAAC,KAAO,2BAA2B,kBAAoB,wCAAwC,WAAa,mC,mBCA7HD,EAAOC,QAAU,CAAC,gBAAkB,iDAAiD,wBAA0B,yDAAyD,eAAiB,gDAAgD,OAAS,wCAAwC,aAAe,gD,mBCAzSD,EAAOC,QAAU,CAAC,KAAO,0BAA0B,IAAM,2B,mBCAzDD,EAAOC,QAAU,CAAC,KAAO,iCAAiC,gBAAkB,4CAA4C,wBAA0B,sD,mBCAlJD,EAAOC,QAAU,CAAC,KAAO,8BAA8B,gBAAkB,yCAAyC,wBAA0B,oD","file":"static/js/main.8dac7d4c.chunk1743469705751.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"tableWrap\":\"Table_tableWrap__1L8zj\",\"statusWrap\":\"Table_statusWrap__3zPHV\",\"activePoint\":\"Table_activePoint__1uLbM\",\"inArrears\":\"Table_inArrears__1oEGR\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"UserManagement_root__mrjZl\",\"pos\":\"UserManagement_pos__2ll3Z\",\"table-header\":\"UserManagement_table-header__38Jv1\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"Loading_wrap__2E9Wt\",\"loading\":\"Loading_loading__1q-Of\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"Dashboard_wrap__Ur3xT\",\"contentCard\":\"Dashboard_contentCard__1PXlu\",\"content\":\"Dashboard_content__3vA5I\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"ConsolidatedLoans_wrap__2gUjM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"ConsolidatedFactoring_wrap__32MAQ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"menuStatement\":\"factoring_menuStatement__SNicE\",\"a-r-title\":\"factoring_a-r-title__2n8yi\",\"no-data\":\"factoring_no-data__1WIK6\",\"g-wrapper-mb-50\":\"factoring_g-wrapper-mb-50__1Tur-\",\"fs\":\"factoring_fs__3qVVL\",\"f-top\":\"factoring_f-top__3wvOR\",\"l-lab\":\"factoring_l-lab__1wRcN\",\"g-wrapper\":\"factoring_g-wrapper__3O6Gl\",\"l-value\":\"factoring_l-value__VJiGI\",\"edit-link-list\":\"factoring_edit-link-list__1NI_C\",\"edit-s-link-cu-wrapper-detail\":\"factoring_edit-s-link-cu-wrapper-detail__VbMIm\",\"edit-s-link-cu-wrapper-detail-tran-show\":\"factoring_edit-s-link-cu-wrapper-detail-tran-show__1OzIy\",\"edit-s-link-cu-wrapper-detail-tran-hide\":\"factoring_edit-s-link-cu-wrapper-detail-tran-hide__2FXsN\",\"edit-img\":\"factoring_edit-img__34Ob6\",\"f-prev-edit-input\":\"factoring_f-prev-edit-input__dtjEy\",\"prev-show-edit-btn\":\"factoring_prev-show-edit-btn__5jjTm\",\"l-text-area\":\"factoring_l-text-area__UXl-z\",\"funding-wrapper\":\"factoring_funding-wrapper__3StIG\",\"g-title\":\"factoring_g-title__1WIsS\",\"l-place-holder\":\"factoring_l-place-holder__2h7RV\",\"ec\":\"factoring_ec__19TBo\",\"l-lab-prev\":\"factoring_l-lab-prev__8HE5W\",\"l-value-percent\":\"factoring_l-value-percent__2byNz\",\"req-amount\":\"factoring_req-amount__1KP0K\",\"p-item\":\"factoring_p-item__3YGi6\",\"total-row\":\"factoring_total-row__2cCsB\",\"op-wrapper-detail\":\"factoring_op-wrapper-detail__NPTMc\",\"op-wrapper-ineligible-breakdown-tran-show\":\"factoring_op-wrapper-ineligible-breakdown-tran-show__3FZuf\",\"op-wrapper-ineligible-breakdown-tran-hide\":\"factoring_op-wrapper-ineligible-breakdown-tran-hide__3gQn3\",\"op-wrapper-ineligible-detail-tran-show\":\"factoring_op-wrapper-ineligible-detail-tran-show__dcGMX\",\"op-wrapper-ineligible-detail-tran-hide\":\"factoring_op-wrapper-ineligible-detail-tran-hide__1M33l\",\"op-wrapper-ineligible-detail-sub-tran-show\":\"factoring_op-wrapper-ineligible-detail-sub-tran-show__2pN1o\",\"op-wrapper-ineligible-detail-sub-tran-hide\":\"factoring_op-wrapper-ineligible-detail-sub-tran-hide__4PBHZ\",\"op-wrapper-calculator-tran-show\":\"factoring_op-wrapper-calculator-tran-show__3Wz-e\",\"op-wrapper-calculator-tran-hide\":\"factoring_op-wrapper-calculator-tran-hide__2gK3R\",\"l-lab-ava\":\"factoring_l-lab-ava__1qA78\",\"cu-wrapper\":\"factoring_cu-wrapper__OgJd7\",\"fver\":\"factoring_fver__M0UrV\",\"o-tag\":\"factoring_o-tag__rYtUL\",\"facs\":\"factoring_facs__riL8f\",\"facsbr\":\"factoring_facsbr__4f1jp\",\"f-receipt\":\"factoring_f-receipt__25MV0\",\"c-item\":\"factoring_c-item__3drGe\",\"l-col\":\"factoring_l-col__2SnEE\",\"r-col\":\"factoring_r-col__uYleF\",\"f-conact\":\"factoring_f-conact__RVFvZ\",\"add-btn-bar-wrapper\":\"factoring_add-btn-bar-wrapper__2Z6Cm\",\"command-tool-tip\":\"factoring_command-tool-tip__2R7pQ\",\"text-area-tran-show\":\"factoring_text-area-tran-show__3YqMJ\",\"text-area-tran-hide\":\"factoring_text-area-tran-hide__dkyzv\",\"grid-text-area-tran-show\":\"factoring_grid-text-area-tran-show__8q1Di\",\"grid-text-area-tran-hide\":\"factoring_grid-text-area-tran-hide__Q-nZK\",\"text-area-arrow\":\"factoring_text-area-arrow__3CV-9\",\"top-info\":\"factoring_top-info__E7fX-\",\"row\":\"factoring_row__1vL3w\",\"first-col\":\"factoring_first-col__oYbhv\",\"last-col\":\"factoring_last-col__1HE6q\",\"last-col-end\":\"factoring_last-col-end__25sjM\",\"upload-wrapper\":\"factoring_upload-wrapper__1RfYv\",\"notes\":\"factoring_notes__2-qNS\",\"page-sub-title\":\"factoring_page-sub-title__3Rnbe\",\"notes-container\":\"factoring_notes-container__3-Tf8\",\"f-b-b\":\"factoring_f-b-b__1RcdA\",\"add-client\":\"factoring_add-client__3CpHc\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"ClientStatement_wrap__2fWOL\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"customTableWrap\":\"ReceiptDetail_customTableWrap__1Ua5-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"customTableWrap\":\"CreditNoteDetail_customTableWrap__1isBM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"LoanStatement_wrap__1rTmF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"InstalmentSchedule_wrap__33jzh\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"TransactionReport_wrap__1vfaN\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"FundingAvailablity_wrap__3SfSO\"};","import React from \"react\";\r\nimport { confirmDialog, ConfirmDialogOptions } from \"primereact/confirmdialog\";\r\nimport { Button } from \"primereact/button\";\r\n\r\nexport const messageRef = React.createRef();\r\n\r\nexport class messageHelper {\r\n public static success(detail: string): void {\r\n if (!detail) {\r\n return;\r\n }\r\n messageRef.current.show({ severity: \"success\", summary: \"Success Message\", detail, life: 3000 });\r\n }\r\n public static info(detail: string): void {\r\n if (!detail) {\r\n return;\r\n }\r\n messageRef.current.show({ severity: \"info\", summary: \"Info Message\", detail, life: 3000 });\r\n }\r\n public static warn(detail: string): void {\r\n if (!detail) {\r\n return;\r\n }\r\n messageRef.current.show({ severity: \"warn\", summary: \"Warn Message\", detail, life: 3000 });\r\n }\r\n public static error(detail: string): void {\r\n if (!detail) {\r\n return;\r\n }\r\n messageRef.current.show({ severity: \"error\", summary: \"Error Message\", detail, life: 3000 });\r\n }\r\n public static confirmDialog(detail: string, options: any = {}): void {\r\n const { header = \"Error\", onAccept, onReject, acceptLabel = \"OK\", rejectLabel = \"NO\", hideAcceptButton, hideRejectButton } = options;\r\n confirmDialog({\r\n message: detail,\r\n header,\r\n icon: \"pi pi-exclamation-triangle\",\r\n footer: (confirmOptions: ConfirmDialogOptions) => {\r\n const { accept, reject } = confirmOptions;\r\n return (\r\n
\r\n {!hideRejectButton && (\r\n {\r\n onReject && onReject();\r\n reject();\r\n }}\r\n autoFocus\r\n >\r\n {rejectLabel}\r\n \r\n )}\r\n {!hideAcceptButton && (\r\n {\r\n onAccept && onAccept();\r\n accept();\r\n }}\r\n autoFocus\r\n >\r\n {acceptLabel}\r\n \r\n )}\r\n
\r\n );\r\n },\r\n });\r\n }\r\n}\r\n","const {\r\n REACT_APP_CLIENT_ID,\r\n REACT_APP_CLIENT_SECRET,\r\n REACT_APP_SCOPE,\r\n\r\n REACT_APP_IDENTITY_API_URL,\r\n REACT_APP_IDENTITY_SERVER_URL,\r\n\r\n REACT_APP_FACTORING_API_URL,\r\n\r\n // to do: huangxu, need add this to pipeline variables\r\n REACT_APP_ADMIN_STRING,\r\n REACT_APP_USER_STRING,\r\n REACT_APP_GBSF_ADMIN,\r\n} = process.env;\r\n\r\nconst config = {\r\n identityServerURL: REACT_APP_IDENTITY_SERVER_URL as string,\r\n identityApi: REACT_APP_IDENTITY_API_URL as string,\r\n\r\n factoringApi: REACT_APP_FACTORING_API_URL as string,\r\n\r\n clientId: REACT_APP_CLIENT_ID as string,\r\n clientSecret: REACT_APP_CLIENT_SECRET as string,\r\n scope: REACT_APP_SCOPE as string,\r\n adminString: REACT_APP_ADMIN_STRING as string,\r\n userString: REACT_APP_USER_STRING as string,\r\n gbfsAdminString: REACT_APP_GBSF_ADMIN as string,\r\n};\r\n\r\nexport default config;\r\n","import decode from \"jwt-decode\";\r\n\r\nconst AUTH_USER = \"AUTH_USER\";\r\nconst TOKEN = \"USER_TOKEN\";\r\nconst USER_ROLE = \"USER_ROLE\";\r\n\r\nexport function authUser(): any {\r\n const user = sessionStorage.getItem(AUTH_USER);\r\n if (user) {\r\n return JSON.parse(user);\r\n }\r\n return null;\r\n}\r\n\r\nexport function storeAuthUser(user: any) {\r\n if (!user) {\r\n sessionStorage.removeItem(AUTH_USER);\r\n } else {\r\n sessionStorage.setItem(AUTH_USER, JSON.stringify(user));\r\n }\r\n}\r\n\r\nexport function setToken(token: any) {\r\n if (!token) {\r\n sessionStorage.removeItem(TOKEN);\r\n sessionStorage.removeItem(USER_ROLE);\r\n } else {\r\n sessionStorage.setItem(TOKEN, token);\r\n }\r\n}\r\n\r\nexport const setCurrentUserRole = function (roles: any) {\r\n if (!roles) {\r\n return;\r\n }\r\n if (typeof roles === \"string\") {\r\n sessionStorage.setItem(USER_ROLE, JSON.stringify([roles]));\r\n } else {\r\n sessionStorage.setItem(USER_ROLE, JSON.stringify(roles));\r\n }\r\n};\r\n\r\nexport const getCurrentUserRole = function () {\r\n let roleString = sessionStorage.getItem(USER_ROLE) as string;\r\n if (!roleString) {\r\n return null;\r\n }\r\n\r\n return JSON.parse(roleString) as any[];\r\n};\r\n\r\nexport function getToken() {\r\n return sessionStorage.getItem(TOKEN);\r\n}\r\n\r\nexport function getStorage(key: string) {\r\n const currentStorage = sessionStorage.getItem(key);\r\n if (currentStorage) {\r\n return JSON.parse(currentStorage);\r\n }\r\n return null;\r\n}\r\n\r\nexport function saveStorage(key: string, value: any) {\r\n sessionStorage.setItem(key, JSON.stringify(value));\r\n}\r\n\r\nexport function clear() {\r\n sessionStorage.clear();\r\n}\r\n\r\nexport const hasRole = function (roles: any[] = []) {\r\n const userRole = getCurrentUserRole();\r\n\r\n if (!userRole) {\r\n return false;\r\n }\r\n\r\n const currentUserHasRole = roles.some((role) => {\r\n return userRole?.map(i=>i.name)?.includes(role);\r\n });\r\n\r\n return currentUserHasRole;\r\n};\r\n\r\nexport const getCurrentUserCompanyId = () => {\r\n const token = getToken();\r\n if (token) {\r\n const currentUser = decode(token);\r\n return currentUser?.companyID;\r\n }\r\n return \"\";\r\n};\r\n\r\nexport const getCurrentUserCompany = () => {\r\n const token = getToken();\r\n if (token) {\r\n const currentUser = decode(token);\r\n return currentUser?.company;\r\n }\r\n return \"\";\r\n};\r\n\r\nexport const getCurrentUser = () => {\r\n const token = getToken();\r\n if (token) {\r\n return decode(token);\r\n }\r\n return {};\r\n};\r\n","import { messageHelper } from \"@/utils/message-helper\";\r\nimport axios from \"axios\";\r\nimport { getToken, setToken, storeAuthUser } from \"./CacheService\";\r\n\r\naxios.interceptors.request.use(\r\n (config) => {\r\n if (!config.headers.Authorization) {\r\n config.headers.Authorization = `Bearer ${getToken()}`;\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.log(`Url requested: ${config.url}`);\r\n console.log(\"Request Params\");\r\n console.log(config.params);\r\n console.log(\"Request Body\");\r\n console.log(config.data);\r\n }\r\n return config;\r\n },\r\n (error) => {\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\naxios.interceptors.response.use(\r\n (response) => {\r\n return Promise.resolve(response);\r\n },\r\n (error) => {\r\n const { status, data } = error?.response || {};\r\n if (axios.isCancel(error)) {\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n isCancel: true,\r\n });\r\n }\r\n if (!error?.response) {\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Network Error!\",\r\n });\r\n }\r\n if (status === 400) {\r\n const getErrorMessages = () => {\r\n const errors = data?.errors || {};\r\n return Object.keys(errors).map((key) => {\r\n return errors[key];\r\n });\r\n };\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Connection timeout\",\r\n errorMessages: getErrorMessages(),\r\n });\r\n }\r\n if (status === 401) {\r\n const onAccept = () => {\r\n setToken(null);\r\n storeAuthUser(null);\r\n if (window.location.pathname === \"/signIn\" || window.location.pathname === \"/\") {\r\n window.location.href = \"/signIn\";\r\n } else {\r\n window.location.href = `/signIn`;\r\n }\r\n };\r\n\r\n messageHelper.confirmDialog(\"Session timed out, please log in again\", {\r\n header: \"Timeout\",\r\n onAccept,\r\n });\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Unauthorized\",\r\n });\r\n }\r\n if (status === 403) {\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Forbidden\",\r\n });\r\n }\r\n if (status === 422) {\r\n messageHelper.confirmDialog(\r\n \"Invalid Company ID detected: Please refer this error to your GBHelios Contact Person\",\r\n { hideRejectButton: true }\r\n );\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Request failed\",\r\n });\r\n }\r\n if (status === 504) {\r\n return Promise.reject({\r\n success: false,\r\n status,\r\n data: {},\r\n message: \"Connection timeout\",\r\n });\r\n }\r\n return Promise.reject(error?.response);\r\n }\r\n);\r\n","import axios from \"axios\";\r\nimport { cloneDeep } from \"lodash\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { getToken } from './CacheService';\r\nimport config from \"../utils/config\";\r\n\r\nimport \"./axiosInterceptorsSet\";\r\n\r\nconst CANCEL_REQUEST_MESSAGE = \"cancel request\";\r\n\r\n\r\nexport default function requestIdentityApi(options: AxiosRequestConfig) {\r\n let { params, url = \"\" } = options;\r\n const cloneData = cloneDeep(params);\r\n let { baseURL = config.identityApi } = options\r\n\r\n options.url = baseURL + url;\r\n options.params = cloneData;\r\n options.headers = {\r\n Authorization: `Bearer ${getToken()}`,\r\n };\r\n\r\n return axios(options)\r\n .then(response => {\r\n const { statusText, status, data } = response;\r\n\r\n let result: any = {};\r\n if (data instanceof Blob) {\r\n result.data = data;\r\n } else {\r\n result = data;\r\n }\r\n // print url and result only under development\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.log(\"Result returned:\");\r\n console.log({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result\r\n });\r\n }\r\n if (typeof (result) === 'string') {\r\n return Promise.resolve({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n result\r\n });\r\n }\r\n return Promise.resolve({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result\r\n });\r\n })\r\n .catch(error => {\r\n const { response, message, errorMessages } = error || {};\r\n\r\n if (String(message) === CANCEL_REQUEST_MESSAGE) {\r\n return {\r\n success: false\r\n };\r\n }\r\n\r\n let msg;\r\n let statusCode;\r\n\r\n if (response && response instanceof Object) {\r\n const { data, statusText } = response;\r\n statusCode = response.status;\r\n msg = data.message || statusText;\r\n } else {\r\n statusCode = 600;\r\n msg = error?.message || \"Network Error\";\r\n }\r\n return Promise.resolve({\r\n success: false,\r\n statusCode,\r\n message: msg,\r\n errorMessages\r\n });\r\n })\r\n .finally(() => { });\r\n}\r\n","import config from \"../utils/config\";\r\nimport requestIdentityApi from \"./requestIdentityApi\";\r\n\r\nexport function changeCurrentUserPassword(data: any) {\r\n return requestIdentityApi({\r\n url: \"/api/Users/ChangeCurrentUserPassword\",\r\n method: \"post\",\r\n data,\r\n });\r\n}\r\n\r\nexport function changePassword(data: any) {\r\n return requestIdentityApi({\r\n url: \"/api/Users/ChangePassword\",\r\n method: \"post\",\r\n data,\r\n });\r\n}\r\n\r\nexport interface GetUserParamsType {\r\n searchText?: string;\r\n claimValue?: string;\r\n claimType?: string;\r\n}\r\n\r\nexport function getUsers(params?: GetUserParamsType) {\r\n return requestIdentityApi({\r\n url: \"/api/Users\",\r\n method: \"GET\",\r\n params,\r\n });\r\n}\r\n\r\nexport function getUsersByRoles(roleId: string, searchText?: string) {\r\n return requestIdentityApi({\r\n url: `/api/Roles/${roleId}/Users`,\r\n method: \"GET\",\r\n params: {\r\n page: 1,\r\n pageSize: 1000,\r\n searchText,\r\n },\r\n });\r\n}\r\n\r\nexport function getUserDetail(userId: string) {\r\n return requestIdentityApi({\r\n url: `/api/Users/${userId}`,\r\n method: \"GET\",\r\n });\r\n}\r\n\r\nexport interface UserObjct {\r\n userName: string;\r\n email: string;\r\n emailConfirmed: boolean;\r\n phoneNumber: string;\r\n phoneNumberConfirmed: boolean;\r\n lockoutEnabled: boolean;\r\n twoFactorEnabled: boolean;\r\n accessFailedCount: number;\r\n lockoutEnd: string;\r\n id: string;\r\n companyId: string;\r\n company?: string;\r\n isAdmin: boolean;\r\n password: string;\r\n}\r\nexport function CreateUser(user: UserObjct) {\r\n return requestIdentityApi({\r\n url: `/api/Users`,\r\n method: \"POST\",\r\n data: user,\r\n });\r\n}\r\n\r\nexport function UpdateUser(user: UserObjct) {\r\n return requestIdentityApi({\r\n url: `/api/Users`,\r\n method: \"PUT\",\r\n data: user,\r\n });\r\n}\r\n\r\nexport function DeleteUser(userId: string) {\r\n return requestIdentityApi({\r\n url: `/api/Users/${userId}`,\r\n method: \"DELETE\",\r\n });\r\n}\r\n\r\nexport function GetUserRoles(userId: string) {\r\n return requestIdentityApi({\r\n url: `/api/Users/${userId}/Roles`,\r\n method: \"GET\",\r\n params: {\r\n pageSize: 1000,\r\n page: 1,\r\n },\r\n });\r\n}\r\n\r\nexport interface ClaimsType {\r\n claimId?: string;\r\n userId: string;\r\n claimType: string;\r\n claimValue: string;\r\n}\r\nexport function SetUserClaims(claims: ClaimsType) {\r\n return requestIdentityApi({\r\n url: `/api/Users/Claims`,\r\n method: \"POST\",\r\n data: claims,\r\n });\r\n}\r\n\r\nexport function DeleteUserClaims(data: { userId: string; claimId: string }) {\r\n const { userId, claimId } = data;\r\n return requestIdentityApi({\r\n url: `/api/Users/${userId}/Claims`,\r\n method: \"DELETE\",\r\n params: {\r\n claimId,\r\n },\r\n });\r\n}\r\n\r\nexport function SetUserRoles(data: { userId: string; roleId: string }) {\r\n return requestIdentityApi({\r\n url: `/api/Users/Roles`,\r\n method: \"POST\",\r\n data,\r\n });\r\n}\r\n\r\nexport function DeleteUserRoles(data: { userId: string; roleId: string }) {\r\n return requestIdentityApi({\r\n url: `/api/Users/Roles`,\r\n method: \"DELETE\",\r\n data,\r\n });\r\n}\r\n\r\nexport function GetAdminRoleId() {\r\n return requestIdentityApi({\r\n url: `/api/Roles`,\r\n method: \"GET\",\r\n params: {\r\n searchText: config.adminString,\r\n },\r\n });\r\n}\r\n\r\nexport function GetUserRoleId() {\r\n return requestIdentityApi({\r\n url: `/api/Roles`,\r\n method: \"GET\",\r\n params: {\r\n searchText: config.userString,\r\n },\r\n });\r\n}\r\n\r\nexport function GetGBFSAdminRoleId() {\r\n return requestIdentityApi({\r\n url: `/api/Roles`,\r\n method: \"GET\",\r\n params: {\r\n searchText: config.gbfsAdminString,\r\n },\r\n });\r\n}\r\n\r\nexport function GetUserClaims(userId: string) {\r\n return requestIdentityApi({\r\n url: `/api/Users/${userId}/Claims`,\r\n method: \"GET\",\r\n });\r\n}\r\n\r\nexport function SearchUser(email: string) {\r\n return requestIdentityApi({\r\n url: `/api/Users`,\r\n method: \"GET\",\r\n params: {\r\n searchText: email,\r\n },\r\n });\r\n}","import axios from \"axios\";\r\nimport { cloneDeep } from \"lodash\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport config from \"../utils/config\";\r\nimport \"./axiosInterceptorsSet\";\r\n\r\nconst CANCEL_REQUEST_MESSAGE = \"cancel request\";\r\n\r\nexport default function request(options: AxiosRequestConfig) {\r\n let { params, url = \"\" } = options;\r\n const cloneData = cloneDeep(params);\r\n let { baseURL = config.identityServerURL } = options;\r\n\r\n options.url = baseURL + url;\r\n options.params = cloneData;\r\n\r\n return axios(options)\r\n .then((response) => {\r\n const { statusText, status, data } = response;\r\n\r\n let result: any = {};\r\n if (data instanceof Blob) {\r\n result.data = data;\r\n } else {\r\n result = data;\r\n }\r\n // print url and result only under development\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.log(\"Result returned:\");\r\n console.log({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result,\r\n });\r\n }\r\n return Promise.resolve({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result,\r\n });\r\n })\r\n .catch((error) => {\r\n const { response, message } = error || {};\r\n\r\n if (String(message) === CANCEL_REQUEST_MESSAGE) {\r\n return {\r\n success: false,\r\n };\r\n }\r\n\r\n let msg;\r\n let statusCode;\r\n\r\n if (response && response instanceof Object) {\r\n const { data, statusText } = response;\r\n statusCode = response.status;\r\n msg = data.message || statusText;\r\n } else {\r\n statusCode = 600;\r\n msg = error?.message || \"Network Error\";\r\n }\r\n return Promise.resolve({\r\n success: false,\r\n statusCode,\r\n message: msg,\r\n });\r\n })\r\n .finally(() => {});\r\n}\r\n","import request from './request';\r\n\r\nexport function getUserInfo() {\r\n return request({\r\n url: '/connect/userinfo',\r\n method: 'post',\r\n });\r\n}\r\n\r\nexport function logout(data: any) {\r\n return request({\r\n url: '/connect/revocation',\r\n method: 'post',\r\n data,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded'\r\n }\r\n });\r\n}\r\n\r\nexport function getToken(data: any) {\r\n return request({\r\n url: '/connect/token',\r\n method: 'post',\r\n data,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded'\r\n }\r\n });\r\n}\r\n\r\nexport function loginByPassword(data: any) {\r\n return request({\r\n url: '/connect/token',\r\n method: 'post',\r\n data,\r\n headers: {\r\n 'content-type': 'application/x-www-form-urlencoded'\r\n }\r\n });\r\n}","\r\nexport const Lang = {\r\n // Add user \r\n 'add.user.success': 'Add User success',\r\n 'update.user.success': 'Update User success',\r\n 'name.required': 'Name is required.',\r\n 'company.id.required': 'Company Id is required.',\r\n 'company.required': 'Company is required.',\r\n 'eamil.required': 'Email is required.',\r\n 'invalid.email': 'Invalid email address. E.g. example@email.com',\r\n 'uen.required': 'UEN is required',\r\n 'userType.required': 'User Type is required',\r\n\r\n // ChangePassword\r\n 'password.required': 'The Password field is required.',\r\n 'password.length.limit': 'The NewPassword must be at least 6 and at max 100 characters long.',\r\n 'password.required.[a-z]': `Passwords must have at least one lowercase ('a'-'z').`,\r\n 'password.required.[A-Z]': `Passwords must have at least one uppercase ('A'-'Z').`,\r\n 'password.required.non.alphanumeric': 'Passwords must have at least one non alphanumeric character.',\r\n\r\n 'confirm.password.required': 'The Confirm Password field is required.',\r\n 'confirm.password.different.with.password': 'The Password and Confirm Password do not match.',\r\n\r\n 'change.password.success': 'Change password success.',\r\n 'change.password.failed': 'Change password failed.',\r\n\r\n // Client Statement\r\n 'invalid.parameters': 'Invalid parameters.',\r\n 'result.empty': 'Result is empty!',\r\n 'factoring.line.required': 'Factoring line is required.',\r\n\r\n // print component\r\n 'month.required': 'Please select month.',\r\n 'customer.required': 'Please select customer.',\r\n\r\n // help\r\n 'submit.success': 'Submit success.',\r\n\r\n // invoice\r\n 'no.file.chose': \"No file chosen!\",\r\n 'upload.success': 'Upload successfully.',\r\n 'upload.failed': 'Upload failed.',\r\n 'upload.file.type.not.support': 'Please upload .xlsx file!',\r\n 'upload.file.size.exceed': 'File size should not exceed 10M!',\r\n\r\n // sign in\r\n 'forget.password.confirm.header': 'Forgot Password',\r\n 'forget.password.confirm.content': 'Please email your GBHelios Contact Person to reset your password',\r\n 'invalid.username.or.password': 'Invalid username or password!',\r\n\r\n // loan\r\n 'loanProduct.required': 'Loan Product is required.',\r\n 'accountNumber.required': 'Account Number is required.',\r\n\r\n // statement\r\n 'product.required': 'Product is required.',\r\n};\r\n","import { Button } from \"primereact/button\";\r\nimport * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport { InputText } from \"primereact/inputtext\";\r\nimport { InputTextarea } from \"primereact/inputtextarea\";\r\nimport { Password } from \"primereact/password\";\r\n\r\nexport type inputType = \"textarea\" | \"input\" | \"password\" | undefined;\r\n\r\nexport interface fieldType {\r\n field: string;\r\n label: string;\r\n rules?: any[];\r\n type?: inputType;\r\n}\r\n\r\nexport interface ICustomFormProps {\r\n formik: any;\r\n fieldsArray: fieldType[];\r\n title?: string;\r\n saving?: boolean;\r\n submitText?: string;\r\n}\r\n\r\nconst CustomForm: React.FunctionComponent = (props) => {\r\n const { formik, fieldsArray, title = \"Form\", saving = false, submitText = \"Submit\" } = props;\r\n\r\n const isFormFieldValid = (name: string) => !!(formik.touched[name] && formik.errors[name]);\r\n\r\n const getFormErrorMessage = (name: string) => {\r\n return isFormFieldValid(name) && {formik.errors[name]};\r\n };\r\n\r\n const renderFormItems = (string: fieldType[], options: any = {}) => {\r\n const renderItem = (type: inputType, field: string) => {\r\n switch (type) {\r\n case \"textarea\":\r\n return (\r\n \r\n );\r\n case \"password\":\r\n return (\r\n \r\n );\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n };\r\n\r\n return string.map((i: fieldType) => {\r\n const { field, rules, type, label } = i;\r\n return (\r\n
\r\n \r\n {renderItem(type, field)}\r\n
{getFormErrorMessage(field)}
\r\n
\r\n );\r\n });\r\n };\r\n\r\n return (\r\n
\r\n
\r\n
{title}
\r\n
\r\n
\r\n {renderFormItems(fieldsArray)}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default CustomForm;\r\n","import { useFormik } from \"formik\";\r\nimport * as React from \"react\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { changeCurrentUserPassword } from \"@/services/IdentityApi\";\r\nimport { getUserInfo } from \"@/services/userService\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport CustomForm, { fieldType } from \"@/components/CustomForm\";\r\n\r\nconst initialValues = {\r\n password: \"\",\r\n confirmPassword: \"\",\r\n};\r\n\r\nconst fieldsArray: fieldType[] = [\r\n {\r\n field: \"password\",\r\n label: \"New Password\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n type: \"password\",\r\n },\r\n {\r\n field: \"confirmPassword\",\r\n label: \"Confirm Password\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n type: \"password\",\r\n },\r\n];\r\n\r\ninterface IChangePasswordProps {}\r\n\r\nconst ChangePassword: React.FunctionComponent = (props) => {\r\n const [saving, setSaving] = React.useState(false);\r\n\r\n const formik = useFormik({\r\n initialValues,\r\n validate: (data) => {\r\n let errors: any = {};\r\n\r\n if (!data.password) {\r\n errors.password = Lang[\"password.required\"];\r\n } else {\r\n if (data.password.length < 6 || data.password.length > 100) {\r\n errors.password = Lang[\"password.length.limit\"];\r\n }\r\n if (!data.password.match(/[a-z]/)) {\r\n errors.password = Lang[\"password.required.[a-z]\"];\r\n }\r\n if (!data.password.match(/[A-Z]/)) {\r\n errors.password = Lang[\"password.required.[A-Z]\"];\r\n }\r\n if (!data.password.match(/[^a-zA-Z0-9]/)) {\r\n errors.password = Lang[\"password.required.non.alphanumeric\"];\r\n }\r\n }\r\n\r\n if (!data.confirmPassword) {\r\n errors.confirmPassword = Lang[\"confirm.password.required\"];\r\n } else if (data.confirmPassword !== data.password) {\r\n errors.confirmPassword = Lang[\"confirm.password.different.with.password\"];\r\n }\r\n\r\n return errors;\r\n },\r\n onSubmit: async (data) => {\r\n setSaving(true);\r\n const userInfoRes = await getUserInfo();\r\n if (userInfoRes && userInfoRes.sub) {\r\n const res = await changeCurrentUserPassword({\r\n ...data,\r\n userId: userInfoRes.sub,\r\n });\r\n setSaving(false);\r\n if (res.success) {\r\n messageHelper.success(Lang[\"change.password.success\"]);\r\n formik.resetForm();\r\n } else {\r\n messageHelper.warn(Lang[\"change.password.failed\"]);\r\n }\r\n } else {\r\n messageHelper.warn(Lang[\"change.password.failed\"]);\r\n setSaving(false);\r\n }\r\n },\r\n });\r\n return ;\r\n};\r\n\r\nexport default ChangePassword;\r\n","import axios from \"axios\";\r\nimport { cloneDeep } from \"lodash\";\r\nimport { AxiosRequestConfig } from \"axios\";\r\nimport { getToken } from \"./CacheService\";\r\nimport config from \"../utils/config\";\r\n\r\nimport \"./axiosInterceptorsSet\";\r\n\r\nconst CANCEL_REQUEST_MESSAGE = \"cancel request\";\r\n\r\nexport default function requestFactoring(options: AxiosRequestConfig) {\r\n let { params, url = \"\" } = options;\r\n const cloneData = cloneDeep(params);\r\n let { baseURL = config.factoringApi } = options;\r\n\r\n options.url = baseURL + url;\r\n options.params = cloneData;\r\n options.headers = {\r\n Authorization: `Bearer ${getToken()}`,\r\n };\r\n\r\n return axios(options)\r\n .then((response) => {\r\n const { statusText, status, data } = response;\r\n\r\n let result: any = {};\r\n if (data instanceof Blob) {\r\n result.data = data;\r\n } else {\r\n result = data;\r\n }\r\n // print url and result only under development\r\n if (process.env.NODE_ENV !== \"production\") {\r\n console.log(\"Result returned:\");\r\n console.log({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result,\r\n });\r\n }\r\n return Promise.resolve({\r\n success: true,\r\n message: statusText,\r\n statusCode: status,\r\n ...result,\r\n });\r\n })\r\n .catch((error) => {\r\n const { response, message } = error || {};\r\n\r\n if (String(message) === CANCEL_REQUEST_MESSAGE) {\r\n return {\r\n success: false,\r\n };\r\n }\r\n\r\n let msg;\r\n let statusCode;\r\n\r\n if (response && response instanceof Object) {\r\n const { data, statusText } = response;\r\n statusCode = response.status;\r\n msg = data.message || statusText;\r\n } else {\r\n statusCode = 600;\r\n msg = error?.message || error.statusText || \"Network Error\";\r\n }\r\n return Promise.resolve({\r\n success: false,\r\n statusCode,\r\n message: msg,\r\n error: {\r\n message: msg,\r\n },\r\n isCancel: error?.isCancel,\r\n });\r\n })\r\n .finally(() => {});\r\n}\r\n","import requestFactoring from \"../requestFactoring\";\r\n\r\nexport function getFactoringLineStatement(factoringLineId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetFactoringLineStatement\",\r\n method: \"get\",\r\n params: {\r\n factoringLineId,\r\n },\r\n });\r\n}\r\n\r\nexport function getFactoringLineActivationDate(factoringLineId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetFactoringLineActivationDate\",\r\n method: \"get\",\r\n params: {\r\n factoringLineId,\r\n },\r\n });\r\n}\r\n\r\nexport function GetFactoringLines() {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetFactoringLines\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function loadStatementPrintContent(\r\n body: any,\r\n factoringLineId: string,\r\n includePreview: boolean\r\n) {\r\n return requestFactoring({\r\n url: \"/api/EClient/LoadStatementPrintContent\",\r\n method: \"post\",\r\n data: body,\r\n params: {\r\n factoringLineId,\r\n includePreview,\r\n },\r\n });\r\n}\r\n\r\nexport function getFactoringFacilitySummaryList() {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetFactoringFacilitySummaryList\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function getCustomerPayment(factoringLineId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetReceiptsForFactoringLine\",\r\n method: \"get\",\r\n params: {\r\n factoringLineId,\r\n },\r\n });\r\n}\r\n\r\nexport function getBankAccountDropdownList() {\r\n return Promise.resolve(\r\n JSON.parse(\r\n '{\"result\":[{\"text\":\"DBS S$ (Factoring Account)\",\"value\":\"8a8e8687753f5645017540209d3b0a15\",\"object\":null},{\"text\":\"GBFS DBS Bank\",\"value\":\"8a8e87fa768a8ab201768d3024ee0e57\",\"object\":null}],\"success\":true,\"error\":null}'\r\n )\r\n );\r\n}\r\n\r\nexport function getReceiptTransactions(depositAccountEncodedKey: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetReceiptTransactions\",\r\n method: \"get\",\r\n params: {\r\n depositAccountEncodedKey,\r\n },\r\n });\r\n}\r\n\r\nexport function getApplyReceiptFormData(params: {\r\n factoringLineId: string;\r\n customerId: string;\r\n branch: string;\r\n currencyCode: string;\r\n}) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetApplyReceiptFormData\",\r\n method: \"get\",\r\n params,\r\n });\r\n}\r\n\r\nexport function getApplyCreditNoteFormData(params: {\r\n factoringLineId: string;\r\n customerId: string;\r\n branch: string;\r\n currencyCode: string;\r\n}) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetApplyCreditNoteFormData\",\r\n method: \"get\",\r\n params,\r\n });\r\n}\r\n\r\nexport function getCreditNotesTransactions(depositAccountEncodedKey: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetCreditNotesTransactions\",\r\n method: \"get\",\r\n params: {\r\n depositAccountEncodedKey,\r\n },\r\n });\r\n}\r\n\r\nexport function RunGetAgeingFundingCurrencyDropSourceTask(endDate?: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/RunGetAgeingFundingCurrencyDropSourceTask\",\r\n method: \"POST\",\r\n params: {\r\n ts: new Date().getTime(),\r\n endDate,\r\n },\r\n });\r\n}\r\nexport function GetAgeingFundingCurrencyDropSourceTaskStatus(taskId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetAgeingFundingCurrencyDropSourceTaskStatus\",\r\n method: \"GET\",\r\n params: {\r\n id: taskId,\r\n ts: new Date().getTime(),\r\n },\r\n });\r\n}\r\nexport function RunViewDaysAgeingReportTask() {\r\n return requestFactoring({\r\n url: \"/api/EClient/RunViewDaysAgeingReportTask\",\r\n method: \"POST\",\r\n params: {\r\n ts: new Date().getTime(),\r\n },\r\n data: {\r\n factoringLineId: \"\",\r\n },\r\n });\r\n}\r\nexport function GetViewDaysAgeingReportTaskStatus(taskId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetViewDaysAgeingReportTaskStatus\",\r\n method: \"get\",\r\n params: {\r\n id: taskId,\r\n },\r\n });\r\n}\r\n\r\nexport function GetAgeingReportActivationDate() {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetAgeingReportActivationDate\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function RunBorrowerInvestmentSummaryTask() {\r\n return requestFactoring({\r\n url: \"/api/EClient/RunBorrowerInvestmentSummaryTask\",\r\n method: \"post\",\r\n });\r\n}\r\n\r\nexport function GetBorrowerInvestmentSummaryTaskStatus(taskId: string) {\r\n return requestFactoring({\r\n url: `/api/EClient/GetBorrowerInvestmentSummaryTaskStatus?id=${taskId}&ts=${new Date().getTime()}`,\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function getReceivablesForFactoringLine(factoringLineId: any) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetReceivablesForFactoringLine\",\r\n method: \"get\",\r\n params: {\r\n factoringLineId,\r\n },\r\n });\r\n}\r\n\r\nexport function getInvoiceRepaymentTransactions(loanAccountEncodedKey: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetInvoiceRepaymentTransactions\",\r\n method: \"get\",\r\n params: {\r\n loanAccountEncodedKey,\r\n },\r\n });\r\n}\r\n\r\nexport function GetClients() {\r\n return new Promise((res) => {\r\n setTimeout(() => {\r\n res(\r\n JSON.parse(\r\n '{\"result\":[{\"groupEncodedKey\":\"8a8e8fe7728420d701729657ebf3015d\",\"uen\":\"199700495E\",\"companyName\":\"BBC Pte Ltd\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"8Q2V7H7A\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRC01\"},{\"groupEncodedKey\":\"8a8e8749767d942b01767e0beff3075b\",\"uen\":\"201609153D\",\"companyName\":\"EEZEE PTE. LTD.\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"Q2IP34H0\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRCF01\"},{\"groupEncodedKey\":\"8a8e8e3d730d680001730e2f07961754\",\"uen\":\"200615948H\",\"companyName\":\"Factoring Client (MT)\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"DBMYGG0A\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRC01\"},{\"groupEncodedKey\":\"8a8e872177dc9a160177dd9746a00280\",\"uen\":\"202019876A\",\"companyName\":\"Factoring Client (TFS)\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"7GX3U5FA\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRD01\"},{\"groupEncodedKey\":\"8a8e871c764984e401764a8c07ee0374\",\"uen\":\"200825738D\",\"companyName\":\"Factoring Client (TMQ)\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"JKJO1Z00\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRDE01\"},{\"groupEncodedKey\":\"8a8e871c764984e401764a3b713e0301\",\"uen\":\"200720572D\",\"companyName\":\"Factoring Client (TYY)\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"1B28QSD0\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRD01\"},{\"groupEncodedKey\":\"8a8e8777765158fd017651a603cd0045\",\"uen\":\"200816925N\",\"companyName\":\"GALLERY T PTE. LTD.\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"7I11GE0A\",\"defaultFactoringLineName\":\"Factoring Facility - MAS Prime Rate (SGD)\",\"defaultAccountReference\":\"FTG-M1\"},{\"groupEncodedKey\":\"8a8e863079ca8bb10179d152b7280fbe\",\"uen\":\"201220876N\",\"companyName\":\"Maru Engineering \",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"M30IE2D0\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"drd 01\"},{\"groupEncodedKey\":\"8a8e86a27b624913017b710a843d09dd\",\"uen\":\"222729640\",\"companyName\":\"NINJA LOGISTICS SDN BHD\",\"accountEntityKey\":\"8a8e86a27b624913017b70f12e770902\",\"accountEntityName\":\"Fornax Kin Pte. Ltd.\",\"defaultFactoringLineId\":\"43Y3QXGA\",\"defaultFactoringLineName\":\"Factoring Facility - MAS Prime Rate (SGD)\",\"defaultAccountReference\":\"MY1\"},{\"groupEncodedKey\":\"8a8e865579c4f78d0179d11bca4c2ee0\",\"uen\":\"CC5201314\",\"companyName\":\"NOOBCAKE\",\"accountEntityKey\":\"8a8e86a27b624913017b70f12e770902\",\"accountEntityName\":\"Fornax Kin Pte. Ltd.\",\"defaultFactoringLineId\":\"HV61K4GA\",\"defaultFactoringLineName\":\"Factoring Facility - MAS Prime Rate (SGD)\",\"defaultAccountReference\":\"DRD01\"},{\"groupEncodedKey\":\"8a8e864b76c7be4a0176cbd7a0c90bef\",\"uen\":\"201511444H\",\"companyName\":\"Ole Pte Ltd\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"UIY981D0\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRCF01\"},{\"groupEncodedKey\":\"8a8e867376df2fd70176dfda08cb0072\",\"uen\":\"202156789S\",\"companyName\":\"SU DYNASTY\",\"accountEntityKey\":\"8a8e8ea9725637220172594535bb3067\",\"accountEntityName\":\"Goldbell Financial Services Pte. Ltd.\",\"defaultFactoringLineId\":\"Z4526YDA\",\"defaultFactoringLineName\":\"Factoring Facility (SGD)\",\"defaultAccountReference\":\"DRC01\"},{\"groupEncodedKey\":\"8a8e87177b97f7f2017ba4667dc81543\",\"uen\":\"303812628\",\"companyName\":\"XXLL ACT\",\"accountEntityKey\":\"8a8e86a27b624913017b70f12e770902\",\"accountEntityName\":\"Fornax Kin Pte. Ltd.\",\"defaultFactoringLineId\":\"BOCPD4AA\",\"defaultFactoringLineName\":\"Factoring Facility - MAS Prime Rate\",\"defaultAccountReference\":\"MM\"}],\"success\":true,\"error\":null}'\r\n )\r\n );\r\n }, 500);\r\n });\r\n}\r\n\r\n/**\r\n * to do,\r\n */\r\nexport function GetFactoringLinesByClientId(clientId?: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetFactoringLines\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function GetViewFactoringSettings(factoringLineId: any) {\r\n return new Promise((res) => {\r\n setTimeout(() => {\r\n res(\r\n JSON.parse(\r\n '{\"result\":{\"fascliGroupEncodedKey\":\"8a8e874e77b2bd8c0177b3bce1993461\",\"factoringLineId\":\"8Q2V7H7A\",\"clientSetting\":{\"factoringLine\":\"8Q2V7H7A\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"additionalReserves\":0,\"reminderPeriod\":\"30;1;1\",\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"patchPathIndex\":0},\"minFactoringCharge\":{\"minFactoringChargeAmount\":2000.0,\"minFactoringChargeFrequency\":\"Quarterly\",\"minFactoringChargeStartDate\":\"2021-07-01T00:00:00\",\"minFactoringChargeGroup\":\"8Q2V7H7A\",\"patchPathIndex\":0,\"accountIdGroups\":[\"8Q2V7H7A\"],\"groupAccounts\":[{\"accountId\":\"8Q2V7H7A\",\"accountReference\":\"DRC01\"}],\"minFactoringChargeAccountsGroup\":\"8Q2V7H7A - DRC01\",\"mainAccount\":{\"accountId\":\"8Q2V7H7A\",\"accountReference\":\"DRC01\"}},\"customerBranchSettings\":[{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"202011736W\",\"customerEncodedKey\":\"8a8e86527495d9b50174961adbc400fe\",\"customerLimit\":1000,\"customerLimitExpiryDate\":\"2021-12-10T13:40:37\",\"customer\":\"AAA Pte Ltd\",\"branch\":\"03\",\"branchName\":\"Branch Novena\",\"creditTermDays\":15,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":60,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":0,\"branchPatchPathIndex\":0,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"200700888E\",\"customerEncodedKey\":\"8a8e871275874e9d01759115f1a60c83\",\"customerLimit\":500000,\"customerLimitExpiryDate\":null,\"customer\":\"ABC Pte Ltd\",\"branch\":\"00\",\"branchName\":\"ABC/0F\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":5,\"branchPatchPathIndex\":8,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"200700888E\",\"customerEncodedKey\":\"8a8e871275874e9d01759115f1a60c83\",\"customerLimit\":500000,\"customerLimitExpiryDate\":null,\"customer\":\"ABC Pte Ltd\",\"branch\":\"01\",\"branchName\":\"XYZ\",\"creditTermDays\":15,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":5,\"branchPatchPathIndex\":10,\"defaultBranch\":false},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"198600128G\",\"customerEncodedKey\":\"8a8e86d276a645b50176a74a587e0286\",\"customerLimit\":150000,\"customerLimitExpiryDate\":null,\"customer\":\"PRIME PRODUCTS PTE LTD\",\"branch\":\"00\",\"branchName\":\"Mb\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":1,\"branchPatchPathIndex\":1,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"198600128G\",\"customerEncodedKey\":\"8a8e86d276a645b50176a74a587e0286\",\"customerLimit\":150000,\"customerLimitExpiryDate\":null,\"customer\":\"PRIME PRODUCTS PTE LTD\",\"branch\":\"01\",\"branchName\":\"Senoko\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":1,\"branchPatchPathIndex\":2,\"defaultBranch\":false},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"200400666C\",\"customerEncodedKey\":\"8a8e86957660c40d017661a963b900e1\",\"customerLimit\":500,\"customerLimitExpiryDate\":null,\"customer\":\"THE BARK CAFE PTE. LTD.\",\"branch\":\"00\",\"branchName\":\"DGY - East\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":6,\"branchPatchPathIndex\":9,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"197302096R\",\"customerEncodedKey\":\"8a8e875176939c4901769423137705d1\",\"customerLimit\":1000,\"customerLimitExpiryDate\":null,\"customer\":\"UNICO \\u00A0MOTOR (PTE) LIMITED\",\"branch\":\"00\",\"branchName\":\"MainBranch\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":4,\"branchPatchPathIndex\":6,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"197302096R\",\"customerEncodedKey\":\"8a8e875176939c4901769423137705d1\",\"customerLimit\":1000,\"customerLimitExpiryDate\":null,\"customer\":\"UNICO \\u00A0MOTOR (PTE) LIMITED\",\"branch\":\"01\",\"branchName\":\"Woodlands\",\"creditTermDays\":30,\"financingPeriodDays\":660,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":4,\"branchPatchPathIndex\":7,\"defaultBranch\":false},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"AAAAA59\",\"customerEncodedKey\":\"8a8e860d7683247f0176833eca3a0065\",\"customerLimit\":100000,\"customerLimitExpiryDate\":null,\"customer\":\"Update\",\"branch\":\"00\",\"branchName\":\"\",\"creditTermDays\":0,\"financingPeriodDays\":0,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":60,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":3,\"branchPatchPathIndex\":4,\"defaultBranch\":true},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"AAAAA59\",\"customerEncodedKey\":\"8a8e860d7683247f0176833eca3a0065\",\"customerLimit\":100000,\"customerLimitExpiryDate\":null,\"customer\":\"Update\",\"branch\":\"01\",\"branchName\":\"\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":50,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":3,\"branchPatchPathIndex\":5,\"defaultBranch\":false},{\"factoringLine\":\"8Q2V7H7A\",\"customerId\":\"200907731R\",\"customerEncodedKey\":\"8a8e876d77ac76350177ae5a5671027b\",\"customerLimit\":1000000,\"customerLimitExpiryDate\":null,\"customer\":\"ZUELLIG PHARMA SPECIALTY SOLUTIONS HOLDINGS PTE. LTD.\",\"branch\":\"00\",\"branchName\":\"MB00\",\"creditTermDays\":30,\"financingPeriodDays\":60,\"invoiceVerificationLimit\":50000,\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"reminderPeriods\":[{\"reminderPeriod\":1,\"days\":30},{\"reminderPeriod\":2,\"days\":1},{\"reminderPeriod\":3,\"days\":1}],\"customerPatchPathIndex\":2,\"branchPatchPathIndex\":3,\"defaultBranch\":true}],\"topBannerInfo\":{\"client\":\"BBC Pte Ltd\",\"account\":\"8Q2V7H7A\",\"accountEncodedKey\":\"8a8e874e77b2bd8c0177b3c261d8346f\",\"accountOfficer\":\"Cecilia Cheng\",\"accountOfficerId\":\"8a8e8ed670f08f5d0170f1674f591875\",\"clientAccountLimit\":10000.0,\"overdraftInterestSpread\":null,\"overdraftInterestRate\":20.0,\"overdraftInterestIndexRate\":null,\"overdraftInterestChargeFrequency\":1,\"interestRateSource\":1,\"isIndexInterestRate\":false,\"clientOverallLimit\":900000.0,\"fundsInUse\":7373.34,\"overallFundsInUse\":7373.3400000000,\"factoringAccountType\":\"Domestic (Recourse)\",\"notificationType\":\"Notified\",\"loDate\":\"2021-01-01T00:00:00\",\"loAcceptanceDate\":\"2021-11-03T00:00:00\",\"loReference\":\"BBC/0221/001\",\"activationDate\":\"2021-01-08T00:00:00\",\"bank\":\"OCBC\",\"bankAccountNo\":\"00055258875\",\"esgApplicationNo\":\"\",\"initialPaymentPercentage\":70,\"factoringChargePercentage\":0.7,\"financingPeriodDays\":60,\"accountGrade\":\"Pass\",\"gradingNextReviewDate\":\"2021-11-30T00:00:00\",\"auditFrequencyFactoring\":\"Yearly\",\"nextAuditDateFactoring\":\"2021-07-20T00:00:00\",\"notes\":\"\",\"overdraftInterestRateDisplay\":\"20% per year\",\"currentTime\":\"2021-12-15T13:40:37\"}},\"success\":true,\"error\":null}'\r\n )\r\n );\r\n }, 500);\r\n });\r\n}\r\n\r\nexport function GetConsolidatedLoanList(): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetConsolidatedLoanList\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function GetLoanModuleDropdownSource(): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetLoanModuleDropdownSource\",\r\n method: \"get\",\r\n });\r\n}\r\n\r\nexport function GetInstalmentScheduleList(\r\n loanAccountEncodedKey: string\r\n): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetInstalmentScheduleList\",\r\n method: \"get\",\r\n params: {\r\n loanAccountEncodedKey,\r\n },\r\n });\r\n}\r\n\r\nexport function GetLoanStatement(\r\n loanAccountId: string,\r\n month: string\r\n): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetLoanStatement\",\r\n method: \"get\",\r\n params: {\r\n loanAccountId,\r\n month,\r\n },\r\n });\r\n}\r\n\r\nexport function LoadPrintLoanStatement(\r\n loanAccountId: string,\r\n month: string\r\n): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/LoadPrintLoanStatement\",\r\n method: \"get\",\r\n params: {\r\n loanAccountId,\r\n month,\r\n },\r\n });\r\n}\r\n\r\nexport function RunLoadReceivablesTask(factoringLineId: string, connectionId: any) {\r\n return requestFactoring({\r\n url: `/api/EClient/RunLoadReceivablesTask?factoringLineId=${factoringLineId}&connectionId=${connectionId}`,\r\n method: \"post\",\r\n });\r\n}\r\n\r\nexport function GetInstalmentTransction(data: { loanAccountId: string, beginDate: string, endDate: string }): Promise {\r\n return requestFactoring({\r\n url: `/api/EClient/GetLoanMCAStatement`,\r\n method: \"post\",\r\n data,\r\n });\r\n}\r\n\r\nexport function LoadPrintLoanMCAStatement(data: { loanAccountId: string, beginDate: string, endDate: string }) {\r\n return requestFactoring({\r\n url: `/api/EClient/LoadPrintLoanMCAStatement`,\r\n method: \"post\",\r\n data,\r\n });\r\n}\r\n\r\nexport function GetMCALoanAccountsSource(): Promise {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetMCALoanAccountsSource\",\r\n method: \"get\",\r\n });\r\n}","export enum GBFSDataType {\r\n None,\r\n Text,\r\n TextArea,\r\n IntegerNumber,\r\n DecimalNumber,\r\n DynamicDecimalNumber,\r\n Currency,\r\n Percentage,\r\n Date,\r\n}\r\n\r\nexport enum StatementPrintType {\r\n Client,\r\n CustomerStatement,\r\n CustomerPayment,\r\n}\r\n\r\nexport enum FactoringPreFilterType {\r\n InvoiceId = 0,\r\n CreditNoteId = 1,\r\n InvoiceScheduleNo = 2,\r\n CreditNotesScheduleNo = 3,\r\n InvoiceStatus = 4,\r\n ReceiptId = 5,\r\n DisbursedFundingRequestTransaction = 6,\r\n InvoiceBulkBatchId = 7,\r\n CreditNoteBulkBatchId = 8,\r\n}\r\n\r\nexport enum ReceivableTypeEnums {\r\n IN = 0,\r\n CN = 1,\r\n}\r\n\r\nexport enum ReceivableBulkActionType {\r\n ReassignReverse,\r\n EditTag,\r\n AddTag,\r\n}\r\n\r\nexport enum InvoiceStatusEnums {\r\n Eligible = 0,\r\n PendingVerification = 1,\r\n PastFinancingPeriod = 2,\r\n Others = 3,\r\n Postdated = 4,\r\n}\r\n","const conditionFilterSelectors = [\"<\", \"<=\", \">\", \">=\", \"=\"];\r\n\r\n/**\r\n * Time FormMat String\r\n */\r\nconst TIME_FORMAT = {\r\n long: \"YYYY-MM-DD HH:mm\",\r\n short: \"HH:mm\",\r\n middle: \"DD/MM/YYYY\",\r\n longToSec: \"YYYY-MM-DD HH:mm:ss\",\r\n month: \"YYYY-MM\",\r\n factoringDateFormateString: \"DD-MMM-YYYY\",\r\n};\r\n\r\nconst definedPeriodIndexs = [0, 1, 2];\r\nconst warnRequired = \"Required\";\r\nconst warnInvalid = \"Invalid\";\r\n\r\nexport {\r\n TIME_FORMAT,\r\n conditionFilterSelectors,\r\n definedPeriodIndexs,\r\n warnRequired,\r\n warnInvalid,\r\n};\r\n","const gbfsTextAreaEncode = (text: any) => {\r\n if (text) {\r\n return
{text}
;\r\n }\r\n return \"\";\r\n};\r\n\r\nexport { gbfsTextAreaEncode };\r\n","import moment, { MomentInput } from \"moment\";\r\nimport numeral from \"numeral\";\r\nimport { GBFSDataType } from \"./enums\";\r\nimport { DataTableFilterMatchModeType } from \"primereact/datatable\";\r\nimport { TIME_FORMAT } from \"./consts/commons\";\r\nimport { messageHelper } from \"./message-helper\";\r\nimport { gbfsTextAreaEncode } from \"./render-helper\";\r\n\r\nexport function convertMambuErrorMessage(message: any) {\r\n if (message && message !== \"\") {\r\n const rMsg = message.toString().split(\"_\").join(\" \").toLowerCase();\r\n return rMsg;\r\n }\r\n}\r\n\r\nexport function convertStrToDate(str: any) {\r\n const d = moment(str).toDate();\r\n return d;\r\n}\r\n\r\nexport function getMonthBeginDate(year: number, month: number) {\r\n const beginDate = new Date(year, month, 1);\r\n return beginDate;\r\n}\r\n\r\nexport function getMonthEndDate(year: number, month: number) {\r\n const beginDate = new Date(year, month, 1);\r\n const endDate = moment(beginDate).add(1, \"months\").add(-1, \"days\").toDate();\r\n return endDate;\r\n}\r\n\r\nexport function toGBFSCurrencyNumberFormatStr(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `$${numeral(n).format(\"0,0.00\")}`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSCurrencyNumberFormatStrWithBracket(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `($${numeral(n).format(\"0,0.00\")})`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSPercentageNumberFormatStr(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `${numeral(n).format(\"0.0%\")}`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSNumberFormatStr(n: number, keepZero: boolean = false) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `${numeral(n).format(\"0,0.00\")}`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSNumberFormatStrWithBracket(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `(${numeral(n).format(\"0,0.00\")})`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSDynamicNumberFormatStr(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `${numeral(n).format(\"0,0.[00]\")}`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSIntegerNumberFormatStr(\r\n n: number,\r\n keepZero: boolean = false\r\n) {\r\n return n !== null && (n !== 0 || (keepZero && n === 0))\r\n ? `${numeral(n).format(\"0,0\")}`\r\n : \"-\";\r\n}\r\n\r\nexport function toGBFSDateWithoutDayFormatStr(d: Date) {\r\n return d ? moment(d).format(\"MMM-YYYY\") : \"\";\r\n}\r\n\r\nexport function toGBFSDateFormatStr(d: Date) {\r\n return d ? moment(d).format(\"DD-MMM-YYYY\") : \"\";\r\n}\r\n\r\nexport function toOrignalDateFormatStr(d: Date) {\r\n return d ? moment(d).format(\"YYYY-MM-DDTHH:mm:sszzz\") : \"\";\r\n}\r\n\r\nexport function toOrignalDateOnlyFormatStr(d: Date) {\r\n return d ? moment(d).format(\"YYYY-MM-DD\") : \"\";\r\n}\r\n\r\nexport function toDateTimesNumber(d: Date) {\r\n if (d) {\r\n const oStr = toOrignalDateFormatStr(d);\r\n return moment(oStr, \"YYYY-MM-DD\").toDate().getTime();\r\n }\r\n return 0;\r\n}\r\n\r\nexport function getDateTimesNumberList(\r\n from: Date | undefined,\r\n to: Date | undefined\r\n) {\r\n let res: number[] = [];\r\n if (from && to) {\r\n var days = moment(to).diff(from, \"days\");\r\n for (let index = 0; index <= days; index++) {\r\n var d = moment(from).add(index, \"days\").toDate();\r\n const oStr = toOrignalDateFormatStr(d);\r\n var timeNumber = moment(oStr, \"YYYY-MM-DD\").toDate().getTime();\r\n res.push(timeNumber);\r\n }\r\n }\r\n return res;\r\n}\r\n\r\nexport function formatItemValueByFieldType(\r\n value: any,\r\n dType: GBFSDataType,\r\n keepZero: boolean = false,\r\n keepMinusSign: boolean = false,\r\n emptySign?: string\r\n) {\r\n if (value !== null && value !== undefined && value !== \"\") {\r\n // number value check\r\n if (\r\n dType === GBFSDataType.Currency ||\r\n dType === GBFSDataType.Percentage ||\r\n dType === GBFSDataType.IntegerNumber ||\r\n dType === GBFSDataType.DecimalNumber ||\r\n dType === GBFSDataType.DynamicDecimalNumber\r\n ) {\r\n const checkNumber = Number(\r\n value.toFixed(dType === GBFSDataType.Percentage ? 4 : 2)\r\n );\r\n if (checkNumber === 0 && !keepZero) {\r\n return getEmptyValueSign(dType, emptySign);\r\n }\r\n }\r\n if (dType === GBFSDataType.None) {\r\n return value;\r\n } else if (dType === GBFSDataType.Currency) {\r\n if (value < 0 && !keepMinusSign) {\r\n return toGBFSCurrencyNumberFormatStrWithBracket(-1 * value, keepZero);\r\n } else {\r\n return toGBFSCurrencyNumberFormatStr(value, keepZero);\r\n }\r\n } else if (dType === GBFSDataType.Percentage) {\r\n return toGBFSPercentageNumberFormatStr(value, keepZero);\r\n } else if (dType === GBFSDataType.Text) {\r\n return value;\r\n } else if (dType === GBFSDataType.TextArea) {\r\n return gbfsTextAreaEncode(value);\r\n } else if (dType === GBFSDataType.IntegerNumber) {\r\n return toGBFSIntegerNumberFormatStr(value, keepZero);\r\n } else if (dType === GBFSDataType.DecimalNumber) {\r\n if (value < 0 && !keepMinusSign) {\r\n return toGBFSNumberFormatStrWithBracket(-1 * value, keepZero);\r\n } else {\r\n return toGBFSNumberFormatStr(value, keepZero);\r\n }\r\n } else if (dType === GBFSDataType.DynamicDecimalNumber) {\r\n return toGBFSDynamicNumberFormatStr(value, keepZero);\r\n } else if (dType === GBFSDataType.Date) {\r\n return toGBFSDateFormatStr(value);\r\n }\r\n } else {\r\n return getEmptyValueSign(dType, emptySign);\r\n }\r\n}\r\n\r\nfunction getEmptyValueSign(dType: GBFSDataType, emptySign?: string) {\r\n let defatuleMask = \"\";\r\n if (\r\n dType === GBFSDataType.Currency ||\r\n dType === GBFSDataType.Percentage ||\r\n dType === GBFSDataType.IntegerNumber ||\r\n dType === GBFSDataType.DecimalNumber ||\r\n dType === GBFSDataType.DynamicDecimalNumber\r\n ) {\r\n defatuleMask = \"-\";\r\n }\r\n return emptySign === undefined ? defatuleMask : emptySign;\r\n}\r\n\r\n// export function gbfsTextAreaEncode(text: any) {\r\n// if (text) {\r\n// let t = text.toString().split(\"\\n\").join(\"
\");\r\n// t = t.split(\"\\r\").join(\"
\");\r\n// return t;\r\n// }\r\n// return \"\";\r\n// }\r\n\r\nexport const getFilterMatchModel: (\r\n arg0: string\r\n) => DataTableFilterMatchModeType = (condition: string) => {\r\n let filterMatch;\r\n if (condition === \"<\") {\r\n filterMatch = \"lt\";\r\n } else if (condition === \"<=\") {\r\n filterMatch = \"lte\";\r\n } else if (condition === \">\") {\r\n filterMatch = \"gt\";\r\n } else if (condition === \">=\") {\r\n filterMatch = \"gte\";\r\n } else if (condition === \"=\") {\r\n filterMatch = \"equals\";\r\n }\r\n return filterMatch as DataTableFilterMatchModeType;\r\n};\r\n\r\nexport type YearMonthDropdownOptions = {\r\n text: string;\r\n value: string;\r\n monthBeginDate: Date;\r\n monthEndDate: Date;\r\n};\r\nexport const getYearMonthDropdownOptions = (beginDate: Date, endDate: Date) => {\r\n let resOptions: YearMonthDropdownOptions[] = [];\r\n if (beginDate && endDate) {\r\n const beginYr = beginDate.getFullYear();\r\n const beginMo = beginDate.getMonth();\r\n const endYr = endDate.getFullYear();\r\n const endMo = endDate.getMonth();\r\n for (let y = beginYr; y <= endYr; y++) {\r\n const mBegin = y === beginYr ? beginMo : 0;\r\n const mEnd = y === endYr ? endMo + 1 : 12;\r\n for (let m = mBegin; m < mEnd; m++) {\r\n const d = new Date(y, m, 1);\r\n const dStr = toGBFSDateWithoutDayFormatStr(d);\r\n const item = {\r\n text: dStr,\r\n value: dStr,\r\n monthBeginDate: getMonthBeginDate(y, m),\r\n monthEndDate: getMonthEndDate(y, m),\r\n };\r\n resOptions.push(item);\r\n }\r\n }\r\n }\r\n return resOptions;\r\n};\r\n\r\nexport const getLastMonth = () => {\r\n const today = new Date();\r\n const lastmonth = new Date(today.getFullYear(), today.getMonth() - 1);\r\n return lastmonth;\r\n};\r\n\r\nexport function getLastMonthBeginDate() {\r\n const lastmonth = getLastMonth();\r\n const beginDate = getMonthBeginDate(lastmonth.getFullYear(), lastmonth.getMonth());\r\n return beginDate;\r\n}\r\n\r\nexport function getLastMonthEndDate() {\r\n const lastmonth = getLastMonth();\r\n const endDate = getMonthEndDate(\r\n lastmonth.getFullYear(),\r\n lastmonth.getMonth()\r\n );\r\n return endDate;\r\n}\r\n\r\n// format money\r\nexport const renderMoney = (value: any) => {\r\n let result: string;\r\n if (Number.isNaN(+value) || !value) {\r\n result = (0).toLocaleString(\"en-us\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n });\r\n } else {\r\n result = value.toLocaleString(\"en-us\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n });\r\n }\r\n return `S$ ${result.replace(\"$\", \"\")}`;\r\n};\r\n/**\r\n * 1. keepZero && value === 0, Show '-'\r\n * 2. undefind null 0 or invalid value @return 0.00\r\n * 3. value < 0, Format With Bracket\r\n * 4. value >= 0, format\r\n *\r\n */\r\nexport const renderMoneyWithCurrencyCode = (\r\n value: any,\r\n fundingSymbol?: string,\r\n keepZero?: boolean\r\n) => {\r\n let result: string;\r\n let isNegativeNumber = false;\r\n\r\n if (\r\n !keepZero &&\r\n (value === 0 ||\r\n value === undefined ||\r\n value === null ||\r\n Number.isNaN(+value))\r\n ) {\r\n return \"-\";\r\n }\r\n\r\n if (Number.isNaN(+value) || !value) {\r\n result = (0).toLocaleString(\"en-us\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n });\r\n } else if (value < 0) {\r\n isNegativeNumber = true;\r\n result = (-1 * value).toLocaleString(\"en-us\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n });\r\n } else {\r\n result = value.toLocaleString(\"en-us\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n });\r\n }\r\n\r\n if (isNegativeNumber) {\r\n return `(${fundingSymbol || \"\"} ${result.replace(\"$\", \"\")})`;\r\n }\r\n return `${fundingSymbol || \"\"} ${result.replace(\"$\", \"\")}`;\r\n};\r\n\r\n// format date\r\nexport const renderDate = (dateString: string, format = TIME_FORMAT.middle) => {\r\n if (!dateString) {\r\n return \"\";\r\n }\r\n\r\n return moment(dateString).format(format);\r\n};\r\n\r\nexport const renderPercent = (value: number | string) => {\r\n if (value === undefined || value === null || value === \"\") {\r\n return \"\";\r\n }\r\n\r\n if (isNaN((value as number) * 1)) {\r\n return \"\";\r\n }\r\n\r\n if (value > 1) {\r\n return `${value}%`;\r\n } else {\r\n return `${(value as number) * 100}%`;\r\n }\r\n};\r\n\r\nexport const hasError = (\r\n mountedRef: React.MutableRefObject,\r\n res: any\r\n) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport function getTodayDate() {\r\n const today = new Date();\r\n const todayDate = new Date(\r\n today.getFullYear(),\r\n today.getMonth(),\r\n today.getDate()\r\n );\r\n return todayDate;\r\n}\r\n\r\nexport const getCalendarYearRange = () => {\r\n const curYr = getTodayDate().getFullYear();\r\n const beginYr = curYr - 10;\r\n const endYr = curYr + 10;\r\n return `${beginYr}:${endYr}`;\r\n};\r\n\r\nexport function toGBFSDateTimeFormatStr(d: MomentInput) {\r\n return d ? moment(d).format(\"DD-MMM-YYYY HH:mm:ss\") : \"\";\r\n}\r\n\r\nexport function getCurrentMonthBeginDate() {\r\n const today = new Date();\r\n const beginDate = getMonthBeginDate(today.getFullYear(), today.getMonth());\r\n return beginDate;\r\n}\r\n\r\nexport function getTodayDateTime() {\r\n const today = new Date();\r\n return today;\r\n}\r\n\r\nexport function guid() {\r\n function S4() {\r\n return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n }\r\n return (\r\n S4() +\r\n S4() +\r\n \"-\" +\r\n S4() +\r\n \"-\" +\r\n S4() +\r\n \"-\" +\r\n S4() +\r\n \"-\" +\r\n S4() +\r\n S4() +\r\n S4()\r\n );\r\n}\r\n\r\n// format number\r\nexport const formateNumber = (value: any) => {\r\n let result: string;\r\n if (Number.isNaN(+value) || !value) {\r\n result = \"0.00\";\r\n } else {\r\n result = numeral(value).format(\"0,0.00\");\r\n }\r\n return result;\r\n};\r\n","export enum DateTypeEnum {\r\n currency = \"currency\",\r\n state = \"state\",\r\n date = \"date\",\r\n}\r\n\r\nexport interface FieldType {\r\n label: React.ReactNode ;\r\n field: keyof Loan.CondolidatedLoanItem;\r\n isLongField?: boolean;\r\n minWidth?: number;\r\n type?: DateTypeEnum;\r\n style?: any;\r\n textAlign?: any;\r\n headerStyle?: any;\r\n header?: any;\r\n filterElement?: any;\r\n filter?: boolean;\r\n sortable?: boolean;\r\n}\r\n\r\nexport interface DataItem {\r\n accountName: string;\r\n type: string;\r\n state: number;\r\n balance: number;\r\n\r\n [propName: string]: any;\r\n}\r\n","import * as React from \"react\";\r\nimport styles from './index.module.scss';\r\n\r\ninterface ILoadingProps { }\r\n\r\nconst Loading: React.FunctionComponent = (props) => {\r\n return (\r\n
\r\n
\r\n \"loading...\"\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Loading;\r\n","\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport Loading from \"../components/Loading\";\r\n\r\nexport class LoadingAnimation {\r\n public static show() {\r\n this.showLoadingIcon();\r\n }\r\n\r\n public static hide(): void {\r\n this.hideLoadingIcon();\r\n }\r\n\r\n private static showLoadingIcon(): void {\r\n if (document.getElementById(\"DivLoadingAnimation\")) {\r\n return\r\n }\r\n const div = document.createElement(\"div\");\r\n div.id = \"DivLoadingAnimation\";\r\n div.style.top = \"0\";\r\n div.style.position = \"fixed\";\r\n div.style.backgroundColor = \"white\";\r\n div.style.opacity = \"0.6\";\r\n div.style.zIndex = \"99999\";\r\n document.body.appendChild(div);\r\n ReactDOM.render(\r\n React.createElement(Loading),\r\n div\r\n );\r\n }\r\n\r\n private static hideLoadingIcon(): void {\r\n const div = document.getElementById(\"DivLoadingAnimation\");\r\n if (div !== null) {\r\n document.body.removeChild(div);\r\n }\r\n }\r\n}\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { getDateTimesNumberList, getMonthBeginDate, getMonthEndDate } from \"@/utils/common-helper\";\r\nimport { Calendar } from \"primereact/calendar\";\r\nimport moment from \"moment\";\r\n\r\ninterface IDateFilterProps {\r\n tableRef: React.RefObject;\r\n reset: number;\r\n field: string;\r\n className?: string;\r\n selectedMonth?: string;\r\n onDateChange?: () => void;\r\n defaultMonth?: string;\r\n}\r\n\r\nconst DateFilter: React.FunctionComponent = (props) => {\r\n const { tableRef, reset, field, className, selectedMonth, onDateChange, defaultMonth } = props;\r\n\r\n const [selectedToDate, setSelectedToDate] = React.useState();\r\n const [selectedFromDate, setSelectedFromDate] = React.useState();\r\n\r\n const [viewDate, setViewDate] = React.useState();\r\n\r\n /**\r\n * reset filter\r\n */\r\n React.useEffect(() => {\r\n if (defaultMonth) {\r\n const selectedMonthMoment = moment(defaultMonth);\r\n const year = selectedMonthMoment.year();\r\n const month = selectedMonthMoment.month();\r\n\r\n const monthBeginDate = getMonthBeginDate(year, month);\r\n const monthEndDate = getMonthEndDate(year, month);\r\n\r\n setSelectedFromDate(monthBeginDate);\r\n setSelectedToDate(monthEndDate);\r\n\r\n setViewDate(monthBeginDate);\r\n\r\n const timesArry = getDateTimesNumberList(monthBeginDate, monthEndDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, field, \"in\");\r\n }\r\n } else {\r\n setSelectedToDate(undefined);\r\n setSelectedFromDate(undefined);\r\n }\r\n }, [reset, defaultMonth, field, tableRef]);\r\n\r\n /**\r\n * on selected month change\r\n * 1. set from date and end date\r\n * 2. filter Table\r\n */\r\n React.useEffect(() => {\r\n if (selectedMonth) {\r\n const selectedMonthMoment = moment(selectedMonth);\r\n const year = selectedMonthMoment.year();\r\n const month = selectedMonthMoment.month();\r\n\r\n const monthBeginDate = getMonthBeginDate(year, month);\r\n const monthEndDate = getMonthEndDate(year, month);\r\n\r\n setSelectedFromDate(monthBeginDate);\r\n setSelectedToDate(monthEndDate);\r\n\r\n setViewDate(monthBeginDate);\r\n\r\n const timesArry = getDateTimesNumberList(monthBeginDate, monthEndDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, field, \"in\");\r\n }\r\n }\r\n }, [selectedMonth, field, tableRef]);\r\n\r\n const onFromDateChange = (event: any) => {\r\n onDateChange?.();\r\n\r\n setSelectedFromDate(event.value);\r\n setViewDate(event.value);\r\n\r\n const timesArry = getDateTimesNumberList(event.value, selectedToDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, field, \"in\");\r\n }\r\n };\r\n const onToDateChange = (event: any) => {\r\n onDateChange?.();\r\n\r\n setSelectedToDate(event.value);\r\n const timesArry = getDateTimesNumberList(selectedFromDate, event.value);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, field, \"in\");\r\n }\r\n };\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n to\r\n \r\n
\r\n setViewDate(e.value)}\r\n />\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default DateFilter;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\n\r\n\r\ninterface IMultiSelectFilterProps {\r\n reset: number;\r\n field: string;\r\n tableRef: React.RefObject;\r\n options: any[];\r\n}\r\n\r\nconst MultiSelectFilter: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { tableRef, reset, field, options } = props;\r\n\r\n const [selectedOptions, setSelectedOptions] = React.useState<\r\n any | null\r\n >();\r\n\r\n /**\r\n * reset filter\r\n */\r\n React.useEffect(() => {\r\n setSelectedOptions(undefined);\r\n }, [reset]);\r\n\r\n const onSelectedOptionChange = (event: any) => {\r\n tableRef.current?.filter(event.value, field, \"in\");\r\n setSelectedOptions(event.value);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default MultiSelectFilter;\r\n","import * as React from \"react\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport styles from \"./index.module.scss\";\r\n\r\nconst defaultCondition = conditionFilterSelectors[4];\r\n\r\ninterface ICompareFilterProps {\r\n doFilterNumber: any;\r\n reset: number;\r\n field: string;\r\n className?: string;\r\n}\r\n\r\nconst NumberFilter: React.FunctionComponent = (props) => {\r\n const { doFilterNumber, reset, field, className } = props;\r\n\r\n const [selectedCondition, setSelectedCondition] = React.useState(\r\n defaultCondition\r\n );\r\n const [filterValue, setFilterValue] = React.useState(\r\n undefined\r\n );\r\n\r\n /**\r\n * reset filter\r\n */\r\n React.useEffect(() => {\r\n setSelectedCondition(defaultCondition);\r\n setFilterValue(undefined);\r\n }, [reset]);\r\n\r\n const onConditionChange = (event: any) => {\r\n doFilterNumber(event.value, filterValue, field);\r\n setSelectedCondition(event.value);\r\n };\r\n\r\n const onFilterValueChange = (event: any) => {\r\n doFilterNumber(selectedCondition, event.value, field);\r\n setFilterValue(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default NumberFilter;\r\n","import DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport { getFilterMatchModel, renderMoney, toGBFSDateFormatStr } from \"@/utils/common-helper\";\r\nimport { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Row } from \"primereact/row\";\r\nimport { Tooltip } from \"primereact/tooltip\";\r\nimport * as React from \"react\";\r\nimport { DateTypeEnum, FieldType } from \"./data.d\";\r\nimport styles from \"./index.module.scss\";\r\n\r\ninterface Options {\r\n accountId: any[];\r\n type: any[];\r\n stateDisplay: any[];\r\n product: any[];\r\n}\r\nconst getOptions = (tableData: Loan.CondolidatedLoanItem[]) => {\r\n const compareFunction = (a: any, b: any) => {\r\n if (a === b) {\r\n return 0;\r\n }\r\n return a < b ? -1 : 1;\r\n };\r\n\r\n const result: Options = {\r\n accountId: [],\r\n type: [],\r\n stateDisplay: [],\r\n product: [],\r\n };\r\n\r\n const stateSet = new Set();\r\n const accountNameSet = new Set();\r\n const productSet = new Set();\r\n\r\n tableData.forEach((i) => {\r\n if (!productSet.has(i.productName)) {\r\n result.product.push({\r\n label: i.productName,\r\n value: i.productName,\r\n });\r\n }\r\n if (!accountNameSet.has(i.accountId)) {\r\n result.accountId.push({\r\n label: i.accountId,\r\n value: i.accountId,\r\n });\r\n }\r\n\r\n if (!stateSet.has(i.stateDisplay)) {\r\n result.stateDisplay.push({\r\n label: i.stateDisplay,\r\n value: i.stateDisplay,\r\n });\r\n }\r\n\r\n accountNameSet.add(i.accountId);\r\n stateSet.add(i.stateDisplay);\r\n productSet.add(i.productName);\r\n });\r\n\r\n result.accountId.sort(compareFunction);\r\n result.type.sort(compareFunction);\r\n result.stateDisplay.sort(compareFunction);\r\n\r\n return result;\r\n};\r\n\r\nconst getValue = (\r\n item: Loan.CondolidatedLoanItem | undefined,\r\n field: keyof Loan.CondolidatedLoanItem,\r\n type?: DateTypeEnum\r\n) => {\r\n if (!item || !field) {\r\n return \"\";\r\n }\r\n if (type) {\r\n switch (type) {\r\n case DateTypeEnum.currency: {\r\n return renderMoney(item[field]);\r\n }\r\n case DateTypeEnum.state: {\r\n // const active = item[field] === 1;\r\n\r\n return (\r\n
\r\n \r\n {item[field]}\r\n
\r\n );\r\n }\r\n case DateTypeEnum.date: {\r\n return toGBFSDateFormatStr(item[field] as any);\r\n }\r\n }\r\n }\r\n return item[field];\r\n};\r\n\r\ninterface IConsilidatedLoansTableProps {\r\n tableData: Loan.CondolidatedLoanItem[];\r\n loading: boolean;\r\n}\r\n\r\nconst ConsilidatedLoansTable: React.FunctionComponent = (props) => {\r\n const { tableData, loading } = props;\r\n\r\n const [displayedData, setDisplayData] = React.useState([]);\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const [options, setOptions] = React.useState();\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n const total = React.useMemo(() => {\r\n return displayedData?.reduce(\r\n (preValue, currentItem) => {\r\n preValue.totalBalance += currentItem.loanBalance || 0;\r\n preValue.totalLoanAmount += currentItem.loanAmount || 0;\r\n return preValue;\r\n },\r\n {\r\n totalBalance: 0,\r\n totalLoanAmount: 0,\r\n }\r\n );\r\n }, [displayedData]);\r\n\r\n React.useEffect(() => {\r\n setOptions(getOptions(tableData));\r\n setDisplayData(tableData);\r\n }, [tableData]);\r\n\r\n const footerColumnGroup = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const tableFields: FieldType[] = [\r\n {\r\n label: \"Product\",\r\n field: \"productName\",\r\n style: { width: 120 },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n label: \"Account ID\",\r\n field: \"accountId\",\r\n style: { width: 100 },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n label: \"State\",\r\n field: \"stateDisplay\",\r\n type: DateTypeEnum.state,\r\n style: { width: 100 },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n label: \"Activation Date\",\r\n field: \"activationDate\",\r\n type: DateTypeEnum.date,\r\n style: { width: 120 },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return ;\r\n },\r\n },\r\n {\r\n label: \"Closed Date\",\r\n field: \"closedDate\",\r\n type: DateTypeEnum.date,\r\n style: { width: 120 },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return ;\r\n },\r\n },\r\n {\r\n label: \"Loan Amount\",\r\n field: \"loanAmount\",\r\n type: DateTypeEnum.currency,\r\n textAlign: \"right\",\r\n style: { width: 110, textAlign: \"right\" },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n label: (\r\n \r\n Loan Balance \r\n \r\n \r\n ),\r\n field: \"loanBalance\",\r\n type: DateTypeEnum.currency,\r\n textAlign: \"right\",\r\n style: { width: 120, textAlign: \"right\" },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n label: \"Action\",\r\n field: \"\" as any,\r\n\r\n style: { width: 80, textAlign: \"center\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilters = () => {\r\n /**\r\n * clear all filter\r\n */\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n setDisplayData(tableData);\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n return (\r\n
\r\n {\r\n setDisplayData(value);\r\n }}\r\n loading={loading}\r\n >\r\n {tableFields.map((i) => {\r\n const { field, type, textAlign } = i;\r\n return (\r\n {\r\n return (\r\n \r\n {getValue(rowData, field, type)}\r\n
\r\n );\r\n }}\r\n header={i.label}\r\n headerStyle={i.style}\r\n style={i.style}\r\n key={field}\r\n filter={i.filter}\r\n filterElement={i.filterElement && i.filterElement()}\r\n sortable={i.sortable}\r\n >\r\n );\r\n })}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ConsilidatedLoansTable;\r\n","import * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport ConsilidatedLoansTable from \"./Table\";\r\nimport { Card } from \"primereact/card\";\r\n\r\ninterface IConsolidatedLoansProps {\r\n consolidatedLoansTableData: Loan.CondolidatedLoanItem[];\r\n}\r\n\r\nconst ConsolidatedLoans: React.FunctionComponent = (props) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ConsolidatedLoans;\r\n","export const notesIcon ='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAA8ElEQVQ4T92UPW6DQBCF38MHyBVc5wppiGALkAI+glOnTxfZljv3ruMjeLEExYJCkyuk5go5AIyF/IeNsF2EJtut3u63M/N2hgAQJCqg4B3AEwQrsaSgcFprzSWUKSsOQYwBfAuxiDwTsT4UxuqXlHDtpXkQq8wqZX4JOOyrAT8i3zijxLVFqLVvHjjauLYMONG+ed4BnUfAWnZBgOpN+9nP/vEvljJrQbovt5UwVj1CajoA+0pE+Sn1PiP5k5qEifqEYNgJIwrtmder7tSW34pm/ZLm/Vv8z9K5VdSmfvz2l118L+Ssi1vz5F5KY55sARfI1O1MPSbeAAAAAElFTkSuQmCC';\r\n\r\nexport const pendingVerificationIcon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAMAAABFjsb+AAAA0lBMVEUAAAD//wCAgACqqgCStgCfvwCVvxWJxBSPvxCXuQyPwgqTugqSvwmUvRCPvxCTuQ+PvA+Qvg2PuwySvAySvguPuguRvg+Tug+SvQ6RuQ2Tug2Ruw2RuguSvAuTvQ6Ruw2SvAyQuw6RvQ2Ruw6RvQ2SvQ2QvA6SvA2QuwyRvQ6Ruw6RvA2RvA2RvQySvA2RvA2RvAyRvA6RvA2RvA2SvAyRvAyRvA6RvA2RvA2RvA2Suw2RvA2RvA2RvA2RvA2RvA2RvA2RvA2RvA2RvA2RvA3///9d9+56AAAARHRSTlMAAQIDBwgMDRAWGRocHyAhIicpKi8wMzQ2Ojs8Q0RJT1ReZG10d4GFj5aXmZulr7O6u8fKzc7P0tXa2+Tl5+7z+fr8/U4KRA4AAAABYktHREWOs6hXAAAAm0lEQVQY023NZw+CMBSF4SIqblHcCxT33nugnP//m2wrhkvC++GmeZKTMhaWMprRLGEaDhu/2/pnHbKa/y3e9mr4Vn16nX0L2+bkj+mA5aVlAubtVHPQq5cClt26J7wsapE9jlHAKRJrAjsVwJhYl5uyWDorYi3gbuiFy0SaXRGlrhC5NW6xt3yjX37w+7HlKKnLNJawp0ODhfcFX/Uhd3cT2sEAAAAASUVORK5CYII=\";\r\n\r\nexport const expiredIcon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAMAAABFjsb+AAABO1BMVEUAAAD/AAD/AAC/A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YAAAAASUVORK5CYII=\";\r\n\r\nexport const messageWarnIcon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+ElEQVR42mNgAIK396c3PDkT+v3eQWYgZiKAmb8/ORP2/e39mQ0MEM2zG+7sY/8PlETDjP/v7mMA43sHGDHk7+zj+P/2/twGhidnwr9jamb6//CY0f/vHy4D8ZX/zy4U/Mem5smZiO8MUGdjGnDc6j8MPL9Sh9UAkF4GqN/INIBpcBtgizDgcg3pBtw/JPX/39+fYAOenksh3YC7B5j+//r2FGzAw2NWpBsASkgPjhpBNTOSYQAw9T27WPH/xdUOoGtY8BmAPSE9u1gJD8S3dxcBDWHEnpBAGYNcA0DZAHdmIuAFkB6QXga82fkAIwRjZOfQ7yA9IL0A2JO/LoWh2h0AAAAASUVORK5CYII=\";\r\n\r\nexport const currencyExchangeIcon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAAXNSR0IArs4c6QAAAm5JREFUOE+tlD9s00AUxr93SVQhJKArBQkJysKEwoJowS1xqN00aUB07gKVGAAhMZfOLExIFQsTSwWJkzQusVHdP1GFRMQObFDEVhhKFCXxQ3Zt1/lDAQlLtnx373733vc+HeE/PvQnVnwxHjt5fPBSrL77dmlmq35Q/G9haT0xD6bLBIwCiAH4SUDVJq4WFHOhH7QHll6WL5DAc2JugMQi2qjlU5VaVk+M2MAIAwOihTVEheQCbee1rfyUaXXAsnrius30EsQrmmIq/unTxYTkBIfHHKFnAL44c9TmhR5YRpe3ibGUV4374TIyZZk11QgOduAcoXkQzmqKMeTHBgGORsQ0qqlGIsigPH6aEXkMIOtlMOZkEMAAMLHlaxjAMrpcAqisKZWnPsxtAgBXI+/xYa5cUTpCjAVNNc67hzkfaVWKHq3HdtttWypNvdkKYMvyCwJ/0ybNB/26l165doZs+yM1moP5rPXdhXlpr4Z1cef15G0G3wXjHANrgvhRXtlvhBPj6Eltdsvfg+WkYzwQ22EhhgsTrz/1zWI5+ZCIVU01xvz1VPHqxUhEWD8ONQ9bY1ZrX7Oy/J6Z7hUmK+t9YXsNksKwjJ68A7CqKUYq0Mz58brpGtH3jV++F+hYZqbLMiYTb/R0061fl7fB+ODD/I3dPnOlKctPmHCzx2dh3wA4QW2+1e348DijJ3QwTQjiGznFfNVhWgcGISQIb7plW3YUVwhoCGAzp5ib06VkHBHEwfYcEw2wjdnCpPEuXPaBtwYxzQI45W1oMrAB4vW/vjW6O5kqjg9FIYY/f92p1uZqzX6d7ijzoIB/WfsFWTQkI6jg1vsAAAAASUVORK5CYII=\";\r\n","import { renderMoneyWithCurrencyCode } from \"@/utils/common-helper\";\r\nimport { currencyExchangeIcon } from \"@/utils/consts/icon-consts\";\r\nimport { Button } from \"primereact/button\";\r\n\r\nconst getFundingCurrencyOptions = (tableData: any[]) => {\r\n const currencySet = new Set();\r\n const result: { label: string; value: string }[] = [];\r\n\r\n tableData?.forEach((i: any) => {\r\n if (!currencySet.has(i.currency.fundingCurrencyCode)) {\r\n result.push({\r\n label: i.currency.fundingCurrencyCode,\r\n value: i.currency.fundingCurrencyCode,\r\n });\r\n }\r\n\r\n currencySet.add(i.currency.fundingCurrencyCode);\r\n });\r\n\r\n return result;\r\n};\r\n\r\nconst getCurrencyOptions = (tableData: any[]) => {\r\n const currencySet = new Set();\r\n const result: { label: string; value: string }[] = [];\r\n\r\n tableData?.forEach((i: any) => {\r\n if (!currencySet.has(i.currency.currencyCode)) {\r\n result.push({\r\n label: i.currency.currencyCode,\r\n value: i.currency.currencyCode,\r\n });\r\n }\r\n\r\n currencySet.add(i.currency.currencyCode);\r\n });\r\n\r\n return result;\r\n};\r\n\r\nconst renderExchangeContentForDetailTable = (currency: any, value: any) => {\r\n if (!currency || currency?.isBaseCurrency || !value) {\r\n return null;\r\n }\r\n const { symbol, exchangeRate } = currency;\r\n const forexInfo = `${renderMoneyWithCurrencyCode(\r\n value,\r\n symbol\r\n )} @${exchangeRate}`;\r\n return (\r\n \r\n \r\n \"\"\r\n \r\n \r\n );\r\n};\r\n\r\nexport {\r\n getFundingCurrencyOptions,\r\n getCurrencyOptions,\r\n renderExchangeContentForDetailTable,\r\n};\r\n","import * as React from \"react\";\r\nimport { Column } from \"primereact/column\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { getFilterMatchModel, renderMoneyWithCurrencyCode } from \"@/utils/common-helper\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport { DataItem } from \"../data\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\n\r\ninterface Options {\r\n accountNo: any[];\r\n product: any[];\r\n accountReference: any[];\r\n}\r\n\r\nconst getOptions = (tableData: any[]) => {\r\n const compareFunction = (a: any, b: any) => {\r\n if (a === b) {\r\n return 0;\r\n }\r\n return a < b ? -1 : 1;\r\n };\r\n\r\n const result: Options = {\r\n accountNo: [],\r\n product: [],\r\n accountReference: [],\r\n };\r\n\r\n const accountNoSet = new Set();\r\n const productSet = new Set();\r\n const accountRefSet = new Set();\r\n\r\n tableData.forEach((i) => {\r\n if (!productSet.has(i.product)) {\r\n result.product.push({\r\n label: i.product,\r\n value: i.product,\r\n });\r\n }\r\n if (!accountNoSet.has(i.accountNo)) {\r\n result.accountNo.push({\r\n label: i.accountNo,\r\n value: i.accountNo,\r\n });\r\n }\r\n if (!accountRefSet.has(i.accountReference) && i.accountReference) {\r\n result.accountReference.push({\r\n label: i.accountReference,\r\n value: i.accountReference,\r\n });\r\n }\r\n\r\n accountNoSet.add(i.accountNo);\r\n productSet.add(i.product);\r\n accountRefSet.add(i.accountReference);\r\n });\r\n\r\n result.accountNo.sort(compareFunction);\r\n result.product.sort(compareFunction);\r\n result.accountReference.sort(compareFunction);\r\n\r\n return result;\r\n};\r\n\r\ninterface IConsolidatedFactoringTableProps {\r\n consolidatedFactoringData: any[];\r\n choosenCurreny: string;\r\n}\r\n\r\nconst ConsolidatedFactoringTable: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { consolidatedFactoringData, choosenCurreny } = props;\r\n\r\n const [displayTableData, setDisplayTableData] = React.useState();\r\n\r\n const [filteredTableData, setFilteredTableData] = React.useState();\r\n\r\n const [options, setOptions] = React.useState();\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n const newDisplayTableData =\r\n consolidatedFactoringData?.filter((i) => i.currency.fundingCurrencyCode === choosenCurreny) ||\r\n [];\r\n\r\n setDisplayTableData(newDisplayTableData);\r\n setFilteredTableData(newDisplayTableData);\r\n\r\n setOptions(getOptions(newDisplayTableData));\r\n }, [choosenCurreny, consolidatedFactoringData]);\r\n\r\n const clearFilters = () => {\r\n /**\r\n * clear all filter\r\n */\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n\r\n const newDisplayTableData =\r\n consolidatedFactoringData?.filter((i) => i.currency.fundingCurrencyCode === choosenCurreny) ||\r\n [];\r\n\r\n setDisplayTableData(newDisplayTableData);\r\n setFilteredTableData(newDisplayTableData);\r\n };\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const { totalDebts, totalEligible, fundsInUse, clientAccountLimit, currencyFundingSymbol } =\r\n React.useMemo(() => {\r\n const initTotalValue = {\r\n totalDebts: 0,\r\n totalEligible: 0,\r\n fundsInUse: 0,\r\n clientAccountLimit: 0,\r\n currencyFundingSymbol: filteredTableData?.[0]?.currency?.fundingSymbol,\r\n };\r\n\r\n return (\r\n filteredTableData?.reduce((preValue, currentItem) => {\r\n return {\r\n totalDebts: preValue.totalDebts + (currentItem.totalDebts || 0),\r\n totalEligible: preValue.totalEligible + (currentItem.totalEligible || 0),\r\n fundsInUse: preValue.fundsInUse + (currentItem.fundsInUse || 0),\r\n clientAccountLimit: preValue.clientAccountLimit + (currentItem.clientAccountLimit || 0),\r\n currencyFundingSymbol: preValue.currencyFundingSymbol,\r\n };\r\n }, initTotalValue) || initTotalValue\r\n );\r\n }, [filteredTableData]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n ref={tableRef}\r\n onValueChange={(value) => {\r\n setFilteredTableData(value);\r\n }}\r\n >\r\n \r\n }\r\n >\r\n \r\n }\r\n >\r\n\r\n \r\n }\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.totalDebts, rowData.currency.fundingSymbol);\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.totalEligible,\r\n rowData.currency.fundingSymbol\r\n );\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.fundsInUse, rowData.currency.fundingSymbol);\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.clientAccountLimit,\r\n rowData.currency.fundingSymbol\r\n );\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n >\r\n \r\n }\r\n >\r\n
\r\n );\r\n};\r\n\r\nexport default ConsolidatedFactoringTable;\r\n","import * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport { getFundingCurrencyOptions } from \"../../../Factoring/utils\";\r\nimport { Card } from \"primereact/card\";\r\nimport ConsolidatedFactoringTable from \"./ConsolidatedFactoringTable\";\r\nimport { Accordion, AccordionTab } from \"primereact/accordion\";\r\n\r\ninterface IConsolidatedFactoringProps {\r\n consolidatedFactoringData: any[];\r\n}\r\n\r\nconst ConsolidatedFactoring: React.FunctionComponent = (props) => {\r\n const { consolidatedFactoringData } = props;\r\n\r\n const [currencyOptions, setCurrencyOptions] = React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >();\r\n\r\n React.useEffect(() => {\r\n const newCurrencyOptions = getFundingCurrencyOptions(consolidatedFactoringData);\r\n setCurrencyOptions(newCurrencyOptions);\r\n }, [consolidatedFactoringData]);\r\n\r\n return (\r\n \r\n {}}\r\n >\r\n {currencyOptions?.map((i) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n\r\n {/* display empty table when no data */}\r\n {!currencyOptions ||\r\n (currencyOptions.length === 0 && (\r\n \r\n ))}\r\n \r\n );\r\n};\r\n\r\nexport default ConsolidatedFactoring;\r\n","import * as React from \"react\";\r\nimport { RouteComponentProps } from \"react-router-dom\";\r\nimport {\r\n GetBorrowerInvestmentSummaryTaskStatus,\r\n GetConsolidatedLoanList,\r\n RunBorrowerInvestmentSummaryTask,\r\n} from \"@/services/factoring\";\r\nimport { convertMambuErrorMessage, toDateTimesNumber } from \"@/utils/common-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport ConsolidatedLoans from \"./components/ConsolidatedLoans\";\r\nimport ConsolidatedFactoring from \"./components/ConsolidatedFactoring\";\r\nimport { Lang } from \"@/locales/en-US\";\r\n\r\ninterface IDashboardProps extends RouteComponentProps {}\r\n\r\nlet retryAfter = 2000;\r\nconst Dashboard: React.FunctionComponent = (props) => {\r\n const [consolidatedLoansTableData, setConsolidatedLoansTableData] = React.useState<\r\n Loan.CondolidatedLoanItem[]\r\n >([]);\r\n\r\n const [borrowerInvestmentSummary, setBorrowerInvestmentSummary] = React.useState([]);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n const someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n React.useEffect(() => {\r\n const getConsolidatedLoanList = async () => {\r\n const res = await GetConsolidatedLoanList();\r\n\r\n if (!someError(res, mountedRef)) {\r\n setConsolidatedLoansTableData(\r\n res.result?.map((i) => {\r\n return {\r\n ...i,\r\n activationDate: toDateTimesNumber(i.activationDate as any) as any,\r\n closedDate: toDateTimesNumber(i.closedDate as any) as any,\r\n };\r\n })\r\n );\r\n }\r\n };\r\n\r\n const getBorrowerInvestmentSummaryTaskStatus = async (\r\n taskId: string,\r\n maxRetryAfter: number\r\n ) => {\r\n const taskRes = await GetBorrowerInvestmentSummaryTaskStatus(taskId);\r\n const result = taskRes.result;\r\n if (result.taskStatus === 3) {\r\n const sourceRes = result.data;\r\n if (sourceRes.success) {\r\n setBorrowerInvestmentSummary(sourceRes.result?.filter((i: any) => i.isFactoringLine));\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(sourceRes.error?.message));\r\n }\r\n } else if (result.taskStatus === 2) {\r\n // in process\r\n await new Promise((resolve) => {\r\n setTimeout(\r\n async () => {\r\n retryAfter *= 2;\r\n\r\n await getBorrowerInvestmentSummaryTaskStatus(taskId, maxRetryAfter);\r\n resolve(0);\r\n },\r\n retryAfter > maxRetryAfter ? maxRetryAfter : retryAfter\r\n );\r\n });\r\n }\r\n };\r\n\r\n const getBorrowerInvestmentSummaryData = async (endDate?: any) => {\r\n const res = await RunBorrowerInvestmentSummaryTask();\r\n if (!someError(res, mountedRef)) {\r\n if (res?.result?.taskStatus === 1) {\r\n await getBorrowerInvestmentSummaryTaskStatus(res.result?.taskId, res.result?.retryAfter);\r\n }\r\n }\r\n };\r\n\r\n const loadData = async () => {\r\n LoadingAnimation.show();\r\n await Promise.allSettled([getConsolidatedLoanList(), getBorrowerInvestmentSummaryData()]);\r\n LoadingAnimation.hide();\r\n };\r\n\r\n loadData();\r\n }, []);\r\n\r\n return (\r\n
\r\n

Dashboard

\r\n\r\n \r\n\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Dashboard;\r\n","import config from \"@/utils/config\";\r\nimport { hasRole } from \"./CacheService\";\r\n\r\nclass UserClass {\r\n private _isAdmin: boolean = false;\r\n private _isGBFSAdmin: boolean = false;\r\n\r\n private _initialized = false;\r\n\r\n private init() {\r\n this._isAdmin = hasRole([config.adminString]);\r\n this._isGBFSAdmin = hasRole([config.gbfsAdminString]);\r\n this._initialized = true;\r\n }\r\n\r\n get isAdmin() {\r\n if (!this._initialized) {\r\n this.init();\r\n }\r\n return this._isAdmin;\r\n }\r\n\r\n get isGBFSAdmin() {\r\n if (!this._initialized) {\r\n this.init();\r\n }\r\n return this._isGBFSAdmin;\r\n }\r\n\r\n resetUser(){\r\n this._initialized = false\r\n }\r\n}\r\n\r\nconst User = new UserClass();\r\n\r\nexport default User;\r\n","import * as React from \"react\";\r\nimport { RouteComponentProps } from \"react-router-dom\";\r\nimport { getToken, setToken, storeAuthUser } from \"../services/CacheService\";\r\nimport { logout as logoutService } from \"../services/userService\";\r\nimport config from \"../utils/config\";\r\nimport User from \"@/services/user\";\r\n\r\ninterface ILogoutProps extends RouteComponentProps {}\r\n\r\nconst Logout: React.FunctionComponent = (props) => {\r\n React.useEffect(() => {\r\n const logout = async () => {\r\n const data = new FormData();\r\n data.append(\"token_type_hint\", \"access_token\");\r\n data.append(\"token\", getToken() || \"\");\r\n data.append(\"client_id\", config.clientId);\r\n data.append(\"client_secret\", config.clientSecret);\r\n\r\n await logoutService(data);\r\n setToken(null);\r\n storeAuthUser(null);\r\n User.resetUser();\r\n \r\n props.history.push(\"/signIn\");\r\n };\r\n logout();\r\n }, [props.history]);\r\n return
;\r\n};\r\n\r\nexport default Logout;\r\n","import printJS from \"print-js\";\r\nimport { LoadingAnimation } from \"./loading-animation\";\r\n\r\nexport const GBFSPrint = (printId: any, docTitle: any, type: any = \"html\", base64: boolean = false) => {\r\n const printHeader = ` \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
GOLDBELL FINANCIAL SERVICES PTE LTD
\r\n
47 Scotts Road, #12-01/02, Goldbell Towers, Singapore 228223
\r\n
Co. Reg. No.: 201511444H
\r\n
\r\n
`;\r\n const style = `\r\n @page \r\n {\r\n size: auto; \r\n margin: 0mm; \r\n }\r\n body\r\n { \r\n margin: 10mm; \r\n }`;\r\n return (\r\n printJS({\r\n printable: printId,\r\n type: type,\r\n base64: base64,\r\n header: printHeader,\r\n documentTitle: docTitle,\r\n targetStyles: ['*'],\r\n maxWidth: 1280,\r\n style: style,\r\n onLoadingStart: () => {\r\n if(type===\"html\"){\r\n LoadingAnimation.show();\r\n } \r\n },\r\n onLoadingEnd: () => {\r\n LoadingAnimation.hide();\r\n }\r\n }));\r\n}","import * as React from \"react\";\r\nimport clsx from \"clsx\";\r\nimport { Button } from \"primereact/button\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport {\r\n convertMambuErrorMessage,\r\n convertStrToDate,\r\n} from \"@/utils/common-helper\";\r\nimport { StatementPrintType } from \"@/utils/enums\";\r\nimport { GBFSPrint } from \"@/utils/print-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { loadStatementPrintContent } from \"@/services/factoring\";\r\n\r\nconst print = (printContents: any) => {\r\n GBFSPrint(printContents, \"Statement\", \"pdf\", true);\r\n};\r\n\r\ninterface IPrintStatementProps {\r\n onClose: () => void;\r\n options: any[];\r\n printType: StatementPrintType;\r\n activedFactoringLineId?: string;\r\n customerDropList?: any[];\r\n}\r\n\r\nconst PrintStatement: React.FunctionComponent = (\r\n props\r\n) => {\r\n const {\r\n onClose,\r\n options,\r\n printType,\r\n customerDropList,\r\n activedFactoringLineId,\r\n } = props;\r\n const [\r\n valueDateYearMonthValue,\r\n setValueDateYearMonthValue,\r\n ] = React.useState();\r\n\r\n const [\r\n customerBranchValue,\r\n setCustomerBranchValue,\r\n ] = React.useState();\r\n\r\n const isCustomerStatement =\r\n printType === StatementPrintType.CustomerStatement;\r\n\r\n const handleSubmit = async () => {\r\n const getFilterBody = () => {\r\n if (isCustomerStatement) {\r\n if (\r\n !customerBranchValue ||\r\n customerBranchValue?.split(\";\")?.length !== 2\r\n ) {\r\n messageHelper.warn(Lang[\"customer.required\"]);\r\n return;\r\n }\r\n }\r\n\r\n const dItem = options.find((f) => f.value === valueDateYearMonthValue);\r\n if (!valueDateYearMonthValue || !dItem) {\r\n messageHelper.warn(Lang[\"month.required\"]);\r\n return;\r\n }\r\n\r\n const fromDate = convertStrToDate(dItem.monthBeginDate);\r\n const toDate = convertStrToDate(dItem.monthEndDate);\r\n const filterBody: any = {\r\n beginDate: fromDate,\r\n endDate: toDate,\r\n printType,\r\n };\r\n\r\n if (isCustomerStatement) {\r\n const params = customerBranchValue?.split(\";\");\r\n if (params?.length === 2) {\r\n filterBody.customerEncodedKey = params[0];\r\n filterBody.branch = params[1];\r\n }\r\n }\r\n\r\n return filterBody;\r\n };\r\n\r\n const printData = async (filter: any) => {\r\n if (!activedFactoringLineId) {\r\n messageHelper.warn(Lang[\"invalid.parameters\"]);\r\n return;\r\n }\r\n\r\n LoadingAnimation.show();\r\n const res = await loadStatementPrintContent(\r\n filter,\r\n activedFactoringLineId,\r\n false\r\n );\r\n LoadingAnimation.hide();\r\n if (res.success && res.result) {\r\n print(res.result.printContents);\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n\r\n const filterBody = getFilterBody();\r\n if (filterBody) {\r\n printData(filterBody);\r\n }\r\n };\r\n\r\n const getTitle = () => {\r\n switch (printType) {\r\n case StatementPrintType.Client:\r\n return \"Print Client Statement\";\r\n case StatementPrintType.CustomerPayment:\r\n return \"Print Customer Payment\";\r\n case StatementPrintType.CustomerStatement:\r\n return \"Print Customer Statement\";\r\n }\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
{getTitle()}
\r\n
\r\n
\r\n {isCustomerStatement && (\r\n
\r\n {\r\n setCustomerBranchValue(e.value);\r\n }}\r\n />\r\n
\r\n )}\r\n\r\n
\r\n {\r\n setValueDateYearMonthValue(e.value);\r\n }}\r\n placeholder=\"Select month\"\r\n />\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n {\r\n onClose();\r\n }}\r\n >\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default PrintStatement;\r\n","import { Dropdown } from \"primereact/dropdown\";\r\nimport { getCurrentUser } from \"../services/CacheService\";\r\n\r\nexport function gbfsContentWithNone(s: any, keepZero?: boolean) {\r\n if ((!!!s && !keepZero) || (keepZero && s !== 0 && !!!s)) {\r\n return
(None)
;\r\n }\r\n return s;\r\n}\r\n\r\nexport const calendarNavigatorTemplate = (e: any) => {\r\n return (\r\n e.onChange(event.originalEvent, event.value)}\r\n />\r\n );\r\n};\r\n\r\nexport function buildFacliSubTitleByExtra(activedFactoringLineName: string) {\r\n const companyName = getCurrentUser()?.company || \"\";\r\n if (companyName) {\r\n return `${companyName} - ${activedFactoringLineName}`;\r\n }\r\n return `${activedFactoringLineName}`;\r\n}\r\n","import * as React from \"react\";\r\nimport styles from \"./ViewEditNotes/factoring.module.scss\";\r\nimport clsx from \"clsx\";\r\nimport { formatItemValueByFieldType } from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { gbfsContentWithNone } from \"@/utils/common-contents\";\r\n\r\ninterface IClientStatementBannerProps {\r\n source: any;\r\n}\r\n\r\nconst ClientStatementBanner: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { source } = props;\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n setIsInitCompleted(true);\r\n return () => {};\r\n }, [source]);\r\n\r\n const getClientAccountLimitStr = () => {\r\n const clientAccountLimit = source?.clientAccountLimit;\r\n if (clientAccountLimit) {\r\n const fiuFacility = formatItemValueByFieldType(\r\n source?.fundsInUse,\r\n GBFSDataType.DecimalNumber\r\n );\r\n const fLimit = formatItemValueByFieldType(\r\n clientAccountLimit,\r\n GBFSDataType.DecimalNumber\r\n );\r\n return `$${fiuFacility} / ${fLimit}`;\r\n }\r\n return gbfsContentWithNone(null);\r\n };\r\n\r\n const getClientOverallLimitStr = () => {\r\n const overallFundsInUse = source?.overallFundsInUse;\r\n const clientOverallLimit = source?.clientOverallLimit;\r\n if (clientOverallLimit) {\r\n const overallFiu = formatItemValueByFieldType(\r\n overallFundsInUse,\r\n GBFSDataType.DecimalNumber\r\n );\r\n const cTotalLimit = formatItemValueByFieldType(\r\n clientOverallLimit,\r\n GBFSDataType.DecimalNumber\r\n );\r\n return `$${overallFiu} / ${cTotalLimit}`;\r\n }\r\n return gbfsContentWithNone(null);\r\n };\r\n\r\n const renderTopInfoItems = () => {\r\n return (\r\n
\r\n {source && (\r\n
\r\n
\r\n \r\n Client Account Limit (SGD)\r\n \r\n \r\n \r\n \r\n \r\n Account Officer\r\n \r\n \r\n {gbfsContentWithNone(source.accountOfficer)}\r\n \r\n
\r\n
\r\n \r\n Initial Payment (%)\r\n \r\n \r\n \r\n \r\n \r\n LO Reference\r\n \r\n \r\n {gbfsContentWithNone(source.loReference)}\r\n \r\n
\r\n
\r\n \r\n Factoring Charge (%)\r\n \r\n \r\n \r\n \r\n \r\n LO Acceptance Date\r\n \r\n \r\n {gbfsContentWithNone(\r\n formatItemValueByFieldType(source.loDate, GBFSDataType.Date)\r\n )}\r\n \r\n
\r\n
\r\n \r\n Financing Period (Days)\r\n \r\n \r\n \r\n \r\n \r\n Activation Date\r\n \r\n \r\n {gbfsContentWithNone(\r\n formatItemValueByFieldType(\r\n source.activationDate,\r\n GBFSDataType.Date\r\n )\r\n )}\r\n \r\n
\r\n
\r\n \r\n Account Grade (Company)\r\n \r\n \r\n {gbfsContentWithNone(source.accountGrade)}\r\n \r\n \r\n \r\n {gbfsContentWithNone(\r\n formatItemValueByFieldType(\r\n source.gradingNextReviewDate,\r\n GBFSDataType.Date\r\n )\r\n )}\r\n \r\n \r\n Notes\r\n \r\n \r\n (None)
',\r\n }}\r\n >
\r\n \r\n
\r\n \r\n )}\r\n \r\n );\r\n };\r\n return (\r\n
\r\n {isInitCompleted && (\r\n
\r\n
{renderTopInfoItems()}
\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ClientStatementBanner;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\nimport { Calendar } from \"primereact/calendar\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\nimport { Button } from \"primereact/button\";\r\nimport {\r\n convertMambuErrorMessage,\r\n convertStrToDate,\r\n formatItemValueByFieldType,\r\n getLastMonthBeginDate,\r\n getLastMonthEndDate,\r\n getDateTimesNumberList,\r\n getFilterMatchModel,\r\n getTodayDate,\r\n getYearMonthDropdownOptions,\r\n toDateTimesNumber,\r\n toGBFSDateFormatStr,\r\n toGBFSDateWithoutDayFormatStr,\r\n getLastMonth,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType, StatementPrintType } from \"@/utils/enums\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { notesIcon } from \"@/utils/consts/icon-consts\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport {\r\n getFactoringLineActivationDate,\r\n GetFactoringLines,\r\n getFactoringLineStatement,\r\n} from \"@/services/factoring\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport PrintStatement from \"../PrintStatement\";\r\nimport ClientStatementBanner from \"../ClientStatementBanner\";\r\nimport ViewEditNotes from \"../ViewEditNotes\";\r\n\r\ninterface IClientTransactionsTableProps {}\r\n\r\nconst getTransactionSubTypeSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const ts = s.transactionSubType;\r\n if (!!ts && res.findIndex((f) => f.label === ts) === -1) {\r\n res.push({ label: ts, value: ts });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nlet currentFilterDropdownColumnType: any;\r\nenum FilterDropdownColumnType {\r\n TransactionSubType,\r\n}\r\nlet filterBeginDate: Date;\r\n\r\nlet yearMonthFilterDropdownSource: any[] = [];\r\nconst balancesBroughtForwardItemId = \"bbf_key_cus\";\r\n\r\nconst ClientTransactionsTable: React.FunctionComponent = (props) => {\r\n const accountTransactionSourceRef = React.useRef(null);\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [isResetFilter, setIsResetFilter] = React.useState(false);\r\n const defaultCondition = conditionFilterSelectors[4];\r\n const [accountTransactionSource, setAccountTransactionSource] = React.useState([]);\r\n const [transactionFilteredSource, setTransactionFilteredSource] = React.useState([]);\r\n const [valueDateYearMonthFilterValue, setValueDateYearMonthFilterValue] =\r\n React.useState();\r\n const [valueDateFromFilterValue, setValueDateFromFilterValue] = React.useState();\r\n const [valueDateToFilterValue, setValueDateToFilterValue] = React.useState();\r\n const [fromViewDate, setFromViewDate] = React.useState(getTodayDate());\r\n const [toViewDate, setToViewDate] = React.useState(getTodayDate());\r\n const [selFilterTransactionSubType, setSelFilterTransactionSubType] = React.useState<\r\n any | null\r\n >();\r\n const [selFilterSalesLedgerTransactionCondition, setSelFilterSalesLedgerTransactionCondition] =\r\n React.useState(defaultCondition);\r\n\r\n const [filterSalesLedgerTransaction, setFilterSalesLedgerTransaction] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n\r\n const [selFilterAmountCondition, setSelFilterAmountCondition] =\r\n React.useState(defaultCondition);\r\n const [filterAmount, setFilterAmount] = React.useState(undefined);\r\n const [selFilterBalanceCondition, setSelFilterBalanceCondition] =\r\n React.useState(defaultCondition);\r\n const [filterBalance, setFilterBalance] = React.useState(undefined);\r\n const [transactionSubTypeDropdownSource, setTransactionSubTypeDropdownSource] = React.useState<\r\n any[]\r\n >([]);\r\n\r\n const [showViewEditNotes, setShowViewEditNotes] = React.useState(false);\r\n const [viewEditNotesSource, setViewEditNotesSource] = React.useState();\r\n const [bottomSumStatementSource, setBottomSumStatementSource] = React.useState([]);\r\n\r\n const [selFilterSalesLedgerBalanceCondition, setSelFilterSalesLedgerBalanceCondition] =\r\n React.useState(defaultCondition);\r\n const [filterSalesLedgerBalance, setFilterSalesLedgerBalance] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n\r\n const [bannerData, setBannerData] = React.useState({});\r\n\r\n const [showPrintPreview, setShowPrintPreview] = React.useState(false);\r\n\r\n const [factoringLines, setFactoringLines] = React.useState([]);\r\n const [activedFactoringLineId, setActivedFactoringLineId] = React.useState({});\r\n\r\n const [currency, setCurrency] = React.useState();\r\n\r\n const [monthOptions, setMonthOptions] = React.useState([]);\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n React.useEffect(() => {\r\n const setYearMonthFilterDropdownSource = (activationDate: any) => {\r\n if (activationDate) {\r\n const beginDate = convertStrToDate(activationDate);\r\n const endDate = getTodayDate();\r\n yearMonthFilterDropdownSource = getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n };\r\n\r\n const getStatement = async (factoringLineId: string) => {\r\n const statementRes = await getFactoringLineStatement(factoringLineId);\r\n if (mountedRef.current && statementRes.success) {\r\n const source = statementRes.result;\r\n if (source) {\r\n setBannerData(source.topBannerInfo);\r\n setYearMonthFilterDropdownSource(source.activationDate);\r\n const tranSource = source.transactions;\r\n setAccountTransactionSource(tranSource);\r\n setCurrency(tranSource[0]?.currency?.fundingSymbol);\r\n setTransactionFilteredSource(tranSource);\r\n setDropdownSource(tranSource);\r\n setIsInitCompleted(true);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(statementRes.error?.message));\r\n }\r\n };\r\n\r\n const getActivationDate = async (factoringLineId: string) => {\r\n const getMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getLastMonth();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n };\r\n\r\n const res = await getFactoringLineActivationDate(factoringLineId);\r\n if (!mountedRef.current) {\r\n return;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return;\r\n }\r\n setMonthOptions(getMonthOptions(res.result));\r\n };\r\n\r\n const getFactoringLine = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetFactoringLines();\r\n if (mountedRef.current && res.success && res.result && res.result?.length > 0) {\r\n setFactoringLines(res.result);\r\n setActivedFactoringLineId(res.result[0]?.id);\r\n LoadingAnimation.show();\r\n await Promise.all([getActivationDate(res.result[0]?.id), getStatement(res.result[0]?.id)]);\r\n LoadingAnimation.hide();\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n LoadingAnimation.hide();\r\n }\r\n };\r\n\r\n getFactoringLine();\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n const setDefaultDateFilter = () => {\r\n const today = getTodayDate();\r\n const dValue = toGBFSDateWithoutDayFormatStr(today);\r\n setValueDateYearMonthFilterValue(dValue);\r\n setValueDateFilter(dValue);\r\n };\r\n\r\n if (isInitCompleted || isResetFilter) {\r\n setDefaultDateFilter();\r\n setIsResetFilter(false);\r\n }\r\n return () => {};\r\n }, [isInitCompleted, isResetFilter]);\r\n\r\n const bottomSumStatementTotalSource = React.useMemo(() => {\r\n const gstRateSet = new Set();\r\n const gstRateMap = new Map();\r\n\r\n const total = bottomSumStatementSource.reduce(\r\n (result, item) => {\r\n const sIdentify = item.summationIdentify;\r\n const slTranAmount = item.salesLedgerTransaction || 0;\r\n const fiuAmount = item.amount || 0;\r\n\r\n if (sIdentify?.isCustomerPayment) {\r\n result.customerPaymentFilteredTotal += -1 * fiuAmount;\r\n }\r\n if (sIdentify?.isScheduleOfOffer) {\r\n result.scheduleOfOfferFilteredTotal += slTranAmount;\r\n }\r\n if (sIdentify?.isCreditNote) {\r\n result.creditNotesFilteredTotal += -1 * slTranAmount;\r\n }\r\n if (sIdentify?.isInitialPaymentAdvance) {\r\n result.fundingToClientFilteredTotal += fiuAmount;\r\n }\r\n if (sIdentify?.isFactoringCharge) {\r\n result.factoringChargeFilteredTotal += fiuAmount;\r\n }\r\n if (sIdentify?.isOtherCharge) {\r\n result.otherChargeFilteredTotal += fiuAmount;\r\n }\r\n if (sIdentify?.isGst) {\r\n result.gstFilteredTotal += fiuAmount;\r\n }\r\n if (sIdentify?.isGstStandardRatedCharge && item.gstRateInPercent > 0) {\r\n gstRateSet.add(item.gstRateInPercent);\r\n\r\n const gstAmount = gstRateMap.get(item.gstRateInPercent) || 0;\r\n const newGstAmount = gstAmount + fiuAmount;\r\n\r\n gstRateMap.set(item.gstRateInPercent, newGstAmount);\r\n }\r\n if (sIdentify?.isGstZeroRatedCharge) {\r\n result.gstZrcFilteredTotal += fiuAmount;\r\n }\r\n\r\n return result;\r\n },\r\n {\r\n scheduleOfOfferFilteredTotal: 0,\r\n creditNotesFilteredTotal: 0,\r\n fundingToClientFilteredTotal: 0,\r\n customerPaymentFilteredTotal: 0,\r\n factoringChargeFilteredTotal: 0,\r\n otherChargeFilteredTotal: 0,\r\n gstFilteredTotal: 0,\r\n gstZrcFilteredTotal: 0,\r\n }\r\n );\r\n\r\n return [\r\n {\r\n ...total,\r\n gstSrcFilteredTotals: Array.from(gstRateSet)\r\n .sort()\r\n .map((i) => {\r\n return {\r\n rate: i,\r\n amount: gstRateMap.get(i),\r\n };\r\n }),\r\n },\r\n ];\r\n }, [bottomSumStatementSource]);\r\n\r\n const isDefinedGstRateInPercent = React.useMemo(() => {\r\n return bottomSumStatementSource.findIndex((f) => f.isDefinedGstRateInPercent) !== -1;\r\n }, [bottomSumStatementSource]);\r\n\r\n const setDropdownSource = (source: any) => {\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.TransactionSubType) {\r\n const dropdownSource = getTransactionSubTypeSource(source);\r\n setTransactionSubTypeDropdownSource(dropdownSource);\r\n }\r\n\r\n currentFilterDropdownColumnType = undefined;\r\n };\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n accountTransactionSourceRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n accountTransactionSourceRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const getOriginalSource = () => {\r\n const dSource = accountTransactionSource.filter((f) => f.id !== balancesBroughtForwardItemId);\r\n return dSource;\r\n };\r\n\r\n const setBroughtForwardItem = () => {\r\n const fromDate = getLastMonthBeginDate();\r\n const fDate = filterBeginDate || fromDate;\r\n const dTimesNumber = toDateTimesNumber(fDate);\r\n const orignalSource = getOriginalSource();\r\n const prevFilteredItems = orignalSource.filter((f) => f.valueDateFilter < dTimesNumber);\r\n let bbfSlt = 0;\r\n let bbfRes = 0;\r\n if (prevFilteredItems) {\r\n for (let s of prevFilteredItems) {\r\n bbfSlt += s.salesLedgerTransaction || 0;\r\n bbfRes += s.reservesTransaction || 0;\r\n }\r\n }\r\n\r\n let prevBalance = 0;\r\n if (prevFilteredItems.length > 0) {\r\n const pItem = prevFilteredItems[prevFilteredItems.length - 1];\r\n prevBalance = pItem.balance;\r\n }\r\n\r\n const balancesBroughtForwardItem = {\r\n id: balancesBroughtForwardItemId,\r\n filterDate: fDate,\r\n valueDateFilter: dTimesNumber,\r\n transactionSubType: \"Balances Brought Forward\",\r\n salesLedgerBalance: bbfSlt,\r\n reservesTransaction: bbfRes,\r\n balance: prevBalance,\r\n currency: prevFilteredItems[0]?.currency,\r\n };\r\n setAccountTransactionSource((pre) => {\r\n const bIndex = pre.findIndex((f) => f.id === balancesBroughtForwardItemId);\r\n if (bIndex > -1) {\r\n pre?.splice(bIndex, 1, balancesBroughtForwardItem);\r\n } else {\r\n pre?.splice(0, 0, balancesBroughtForwardItem);\r\n }\r\n return [...pre];\r\n });\r\n\r\n setTransactionFilteredSource((pre) => {\r\n const dBfFilteredIndex = pre.findIndex((f) => f.id === balancesBroughtForwardItemId);\r\n if (dBfFilteredIndex > -1) {\r\n pre?.splice(dBfFilteredIndex, 1, balancesBroughtForwardItem);\r\n } else {\r\n pre?.splice(0, 0, balancesBroughtForwardItem);\r\n }\r\n return [...pre];\r\n });\r\n };\r\n\r\n const footerGroup = () => {\r\n const getFilteredSource = () => {\r\n return transactionFilteredSource.filter((f) => f.id !== balancesBroughtForwardItemId);\r\n };\r\n\r\n const getSalesLedgerTransactionTotalAmount = () => {\r\n let total = 0;\r\n const dFilteredSource = getFilteredSource();\r\n if (dFilteredSource) {\r\n for (let s of dFilteredSource) {\r\n total += s.salesLedgerTransaction || 0;\r\n }\r\n }\r\n return total;\r\n };\r\n\r\n const getSalesLedgerTransactionTotalFooter = () => {\r\n const total = getSalesLedgerTransactionTotalAmount();\r\n return renderMoneyWithCurrencyCode(total, currency);\r\n };\r\n\r\n const getFIUTransactionTotalFooter = () => {\r\n let total = 0;\r\n const dSource = transactionFilteredSource;\r\n if (dSource) {\r\n for (let s of dSource) {\r\n total += s.amount || 0;\r\n }\r\n }\r\n return renderMoneyWithCurrencyCode(total, currency);\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const valueDateBodyTemplate = (rowData: any) => {\r\n rowData.valueDateFilter = toDateTimesNumber(rowData.filterDate);\r\n return formatItemValueByFieldType(rowData.valueDate, GBFSDataType.Date);\r\n };\r\n\r\n const transactionSubTypeBodyTemplate = (rowData: any) => {\r\n return
{rowData.transactionSubType}
;\r\n };\r\n\r\n const referenceBodyTemplate = (rowData: any) => {\r\n const forexReference = !!rowData.forexReference ? `${rowData.forexReference} ` : \"\";\r\n const reference = rowData.reference;\r\n const referenceExtra = !!rowData.referenceExtra ? ` ${rowData.referenceExtra}` : \"\";\r\n\r\n return (\r\n
\r\n
\r\n \r\n {forexReference}\r\n {reference}\r\n {referenceExtra}\r\n
\r\n
\r\n \r\n );\r\n };\r\n\r\n ////////////////////////////////body templates//////////////////////////////////////////////////\r\n\r\n const salesLedgerTransactionBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.salesLedgerTransaction,\r\n rowData?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n const salesLedgerBalanceBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.salesLedgerBalance,\r\n rowData?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n const amountBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.amount, rowData?.currency?.fundingSymbol);\r\n };\r\n\r\n const balanceBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.balance, rowData?.currency?.fundingSymbol);\r\n };\r\n\r\n const actionBodyTemplate = (rowData: any) => {\r\n const renderNotesIcon = () => {\r\n const viewEditNotesClickHandler = () => {\r\n setShowViewEditNotes(true);\r\n const viewEditNoteSource = {\r\n transactionEncodedKey: \"\",\r\n notes: rowData.notes,\r\n };\r\n setViewEditNotesSource(viewEditNoteSource);\r\n };\r\n return (\r\n
\r\n \r\n
\r\n );\r\n };\r\n return rowData.enableNotesEditor && renderNotesIcon();\r\n };\r\n\r\n const renderTransactionSubTypeFilter = () => {\r\n const onTransactionSubTypeFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterDropdownColumnType = FilterDropdownColumnType.TransactionSubType;\r\n }\r\n accountTransactionSourceRef.current?.filter(event.value, \"transactionSubType\", \"in\");\r\n setSelFilterTransactionSubType(event.value);\r\n };\r\n return (\r\n \r\n );\r\n };\r\n\r\n const setValueDateFilter = (dValue: any) => {\r\n let fromDate;\r\n let toDate;\r\n const dItem = yearMonthFilterDropdownSource.find((f) => f.value === dValue);\r\n if (dItem) {\r\n fromDate = convertStrToDate(dItem.monthBeginDate);\r\n toDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n fromDate = getLastMonthBeginDate();\r\n toDate = getLastMonthEndDate();\r\n }\r\n filterBeginDate = fromDate;\r\n const timesArry = getDateTimesNumberList(fromDate, toDate);\r\n if (timesArry.length > 0) {\r\n accountTransactionSourceRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n\r\n setValueDateFromFilterValue(fromDate);\r\n setValueDateToFilterValue(toDate);\r\n doFilterForBottomSumSource(fromDate, toDate);\r\n setFromViewDate(fromDate);\r\n setToViewDate(toDate);\r\n const calDateFromFilterInput = document.getElementById(\"calDateFromFilter\") as HTMLInputElement;\r\n if (calDateFromFilterInput) {\r\n calDateFromFilterInput.value = toGBFSDateFormatStr(fromDate);\r\n }\r\n const calDateToFilterInput = document.getElementById(\"calDateToFilter\") as HTMLInputElement;\r\n if (calDateToFilterInput) {\r\n calDateToFilterInput.value = toGBFSDateFormatStr(toDate);\r\n }\r\n };\r\n\r\n const valueDateHeader = () => {\r\n const onYearMonthFilterChange = (e: any) => {\r\n setValueDateYearMonthFilterValue(e.value);\r\n setValueDateFilter(e.value);\r\n };\r\n return (\r\n \r\n Date\r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const doFilterForBottomSumSource = (fromDate?: Date, toDate?: Date) => {\r\n if (fromDate && toDate) {\r\n const orignalSource = getOriginalSource();\r\n const dFromTimesNumber = toDateTimesNumber(fromDate);\r\n const dToTimesNumber = toDateTimesNumber(toDate);\r\n const bottomSource = orignalSource.filter(\r\n (f) => f.valueDateFilter >= dFromTimesNumber && f.valueDateFilter <= dToTimesNumber\r\n );\r\n setBottomSumStatementSource(bottomSource);\r\n }\r\n };\r\n\r\n const renderValueDateFilter = () => {\r\n const onValueDateFromFilterChange = (event: any) => {\r\n filterBeginDate = event.value;\r\n const timesArry = getDateTimesNumberList(event.value, valueDateToFilterValue);\r\n if (timesArry.length > 0) {\r\n accountTransactionSourceRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n setValueDateFromFilterValue(event.value);\r\n setValueDateYearMonthFilterValue(undefined);\r\n doFilterForBottomSumSource(event.value, valueDateToFilterValue);\r\n };\r\n\r\n const onValueDateToFilterChange = (event: any) => {\r\n const timesArry = getDateTimesNumberList(valueDateFromFilterValue, event.value);\r\n if (timesArry.length > 0) {\r\n accountTransactionSourceRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n setValueDateToFilterValue(event.value);\r\n setValueDateYearMonthFilterValue(undefined);\r\n doFilterForBottomSumSource(valueDateFromFilterValue, event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n setFromViewDate(e.value)}\r\n inputId=\"calDateFromFilter\"\r\n maxDate={valueDateToFilterValue}\r\n value={valueDateFromFilterValue}\r\n onChange={onValueDateFromFilterChange}\r\n dateFormat=\"dd-M-yy\"\r\n className=\"p-column-filter\"\r\n />\r\n
\r\n \r\n to\r\n
\r\n
\r\n setToViewDate(e.value)}\r\n inputId=\"calDateToFilter\"\r\n minDate={valueDateFromFilterValue}\r\n value={valueDateToFilterValue}\r\n onChange={onValueDateToFilterChange}\r\n dateFormat=\"dd-M-yy\"\r\n className=\"p-column-filter\"\r\n />\r\n
\r\n \r\n );\r\n };\r\n\r\n const renderAmountFilter = () => {\r\n const onAmountFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterAmount, \"amount\");\r\n setSelFilterAmountCondition(event.value);\r\n };\r\n\r\n const onAmountFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterAmountCondition, event.value, \"amount\");\r\n setFilterAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const renderBalanceFilter = () => {\r\n const onBalanceFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterBalance, \"balance\");\r\n setSelFilterBalanceCondition(event.value);\r\n };\r\n\r\n const onBalanceFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterBalanceCondition, event.value, \"balance\");\r\n setFilterBalance(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const renderClearFilter = () => {\r\n const clearOAPFilters = () => {\r\n setSelFilterTransactionSubType(undefined);\r\n setFilterAmount(undefined);\r\n setFilterBalance(undefined);\r\n setFilterSalesLedgerTransaction(undefined);\r\n\r\n setFilterSalesLedgerBalance(undefined);\r\n currentFilterDropdownColumnType = undefined;\r\n accountTransactionSourceRef.current?.reset();\r\n setIsResetFilter(true);\r\n\r\n const source = accountTransactionSourceRef.current?.props.value || [];\r\n\r\n setTransactionFilteredSource(source);\r\n setDropdownSource(source);\r\n };\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n const salesLedgerTransactionFilter = () => {\r\n const onSalesLedgerTransactionFilterChangeValue = (event: any) => {\r\n doFilterNumber(\r\n selFilterSalesLedgerTransactionCondition,\r\n event.value,\r\n \"salesLedgerTransaction\"\r\n );\r\n setFilterSalesLedgerTransaction(event.value);\r\n };\r\n const onSalesLedgerTransactionFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterSalesLedgerBalance, \"salesLedgerTransaction\");\r\n setSelFilterSalesLedgerTransactionCondition(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const salesLedgerBalanceFilter = () => {\r\n const onSalesLedgerBalanceFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterSalesLedgerBalance, \"salesLedgerBalance\");\r\n setSelFilterSalesLedgerBalanceCondition(event.value);\r\n };\r\n\r\n const onSalesLedgerBalanceFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterSalesLedgerBalanceCondition, event.value, \"salesLedgerBalance\");\r\n setFilterSalesLedgerBalance(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const renderFilteredTotals = () => {\r\n const invoicesBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.scheduleOfOfferFilteredTotal, currency);\r\n };\r\n const creditNotesBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.creditNotesFilteredTotal, currency);\r\n };\r\n const fundingToClientBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.fundingToClientFilteredTotal, currency);\r\n };\r\n const customerPaymentBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.customerPaymentFilteredTotal, currency);\r\n };\r\n const factoringChargeBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.factoringChargeFilteredTotal, currency);\r\n };\r\n const otherChargeBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.otherChargeFilteredTotal, currency);\r\n };\r\n const gstBodyTemplate = (rowData: any) => {\r\n const { gstSrcFilteredTotals } = rowData;\r\n return (\r\n
\r\n
{renderMoneyWithCurrencyCode(rowData.gstFilteredTotal, currency)}
\r\n {gstSrcFilteredTotals.map((i: any) => {\r\n return (\r\n
{`Standard Rated Charges (S) ${renderMoneyWithCurrencyCode(\r\n i.amount,\r\n currency\r\n )} @${formatItemValueByFieldType(i.rate, GBFSDataType.DynamicDecimalNumber)}%`}
\r\n );\r\n })}\r\n
{`Exempt Charges (E) ${renderMoneyWithCurrencyCode(\r\n rowData.gstZrcFilteredTotal,\r\n currency\r\n )} @0%`}
\r\n
\r\n );\r\n };\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {isDefinedGstRateInPercent && (\r\n \r\n )}\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n const getStatement = async (factoringLineId: string) => {\r\n const setYearMonthFilterDropdownSource = (activationDate: any) => {\r\n if (activationDate) {\r\n const beginDate = convertStrToDate(activationDate);\r\n const endDate = getTodayDate();\r\n yearMonthFilterDropdownSource = getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n };\r\n\r\n LoadingAnimation.show();\r\n setIsInitCompleted(false);\r\n const statementRes = await getFactoringLineStatement(factoringLineId);\r\n\r\n LoadingAnimation.hide();\r\n if (mountedRef.current && statementRes.success) {\r\n const source = statementRes.result;\r\n if (source) {\r\n setSelFilterTransactionSubType(undefined);\r\n setFilterAmount(undefined);\r\n setFilterBalance(undefined);\r\n setFilterSalesLedgerTransaction(undefined);\r\n currentFilterDropdownColumnType = undefined;\r\n accountTransactionSourceRef.current?.reset();\r\n setIsResetFilter(true);\r\n\r\n setBannerData(source.topBannerInfo);\r\n setYearMonthFilterDropdownSource(source.activationDate);\r\n const tranSource = source.transactions;\r\n setAccountTransactionSource(tranSource);\r\n setCurrency(tranSource[0]?.currency?.fundingSymbol);\r\n setTransactionFilteredSource(tranSource);\r\n setDropdownSource(tranSource);\r\n setIsInitCompleted(true);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(statementRes.error?.message));\r\n }\r\n };\r\n\r\n const getActivationDate = async (factoringLineId: string) => {\r\n const getMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getLastMonth();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n };\r\n\r\n const res = await getFactoringLineActivationDate(factoringLineId);\r\n if (!mountedRef.current) {\r\n return;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(\"Result is empty!\");\r\n return;\r\n }\r\n setMonthOptions(getMonthOptions(res.result));\r\n };\r\n\r\n return (\r\n
\r\n
\r\n
\r\n {\r\n return {\r\n text: `${i.name} ${i.id} ${i.accountReference ? `- ${i.accountReference}` : \"\"}`,\r\n value: i.id,\r\n };\r\n })}\r\n onChange={(e) => {\r\n setActivedFactoringLineId(e.value);\r\n getStatement(e.value);\r\n getActivationDate(e.value);\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select Factoring Line\"\r\n style={{ maxWidth: \"400px\" }}\r\n />\r\n
\r\n
\r\n {monthOptions?.length > 0 && (\r\n {\r\n setShowPrintPreview(true);\r\n }}\r\n label=\"Print\"\r\n icon=\"pi pi-download\"\r\n className=\"p-button-secondary\"\r\n />\r\n )}\r\n
\r\n
\r\n {isInitCompleted && }\r\n {isInitCompleted && (\r\n
\r\n {\r\n if (filteredData) {\r\n setTransactionFilteredSource(filteredData);\r\n setDropdownSource(filteredData);\r\n }\r\n setBroughtForwardItem();\r\n }}\r\n footerColumnGroup={footerGroup()}\r\n rowHover\r\n scrollable\r\n scrollHeight=\"calc(100vh - 446px)\"\r\n >\r\n \r\n \r\n {isDefinedGstRateInPercent && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {renderFilteredTotals()}\r\n
\r\n )}\r\n\r\n {showViewEditNotes && (\r\n {\r\n setShowViewEditNotes(false);\r\n }}\r\n />\r\n )}\r\n\r\n {showPrintPreview && (\r\n {\r\n setShowPrintPreview(false);\r\n }}\r\n activedFactoringLineId={activedFactoringLineId}\r\n options={monthOptions}\r\n printType={StatementPrintType.Client}\r\n />\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ClientTransactionsTable;\r\n","import * as React from \"react\";\r\nimport clsx from \"clsx\";\r\nimport styles from \"./factoring.module.scss\";\r\nimport { Button } from \"primereact/button\";\r\n\r\ninterface IViewEditNotesProps {\r\n source: any;\r\n unmount: Function;\r\n}\r\n\r\nconst ViewEditNotes: React.FunctionComponent = (props) => {\r\n const { source, unmount } = props;\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [notesValue, setNotesValue] = React.useState<\"\">();\r\n\r\n React.useEffect(() => {\r\n const initData = async () => {\r\n setNotesValue(source.notes);\r\n setIsInitCompleted(true);\r\n };\r\n initData();\r\n return () => {};\r\n }, [source]);\r\n\r\n const handleCancel = async () => {\r\n unmount();\r\n };\r\n\r\n return (\r\n
\r\n {isInitCompleted && (\r\n
\r\n \r\n
View Notes
\r\n
\r\n
\r\n
\r\n (None)
',\r\n }}\r\n >
\r\n
\r\n
\r\n \r\n
\r\n {\" \"}\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default ViewEditNotes;\r\n","import * as React from \"react\";\r\nimport { Calendar } from \"primereact/calendar\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\n\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\n\r\nimport { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\nimport { Dialog } from \"primereact/components/dialog/Dialog\";\r\nimport ReceiptDetail from \"./ReceiptDetail\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n getFilterMatchModel,\r\n toGBFSDateFormatStr,\r\n convertStrToDate,\r\n getDateTimesNumberList,\r\n getLastMonthBeginDate,\r\n getLastMonthEndDate,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { Button } from \"primereact/button\";\r\nimport { currencyExchangeIcon } from \"@/utils/consts/icon-consts\";\r\n\r\nenum FilterDropdownColumnType {\r\n Customer,\r\n Branch,\r\n Status,\r\n}\r\n\r\nconst tableFields = {\r\n customer: {\r\n label: \"Customer\",\r\n field: \"customer\",\r\n },\r\n branch: {\r\n label: \"Branch\",\r\n field: \"branch\",\r\n },\r\n branchName: {\r\n label: \"Branch Name\",\r\n field: \"branchName\",\r\n },\r\n receiptId: {\r\n label: \"Receipt ID\",\r\n field: \"receiptId\",\r\n },\r\n OAPReceiptDateFilter: {\r\n label: \"Receipt Date\",\r\n field: \"valueDateFilter\",\r\n },\r\n receiptAmountForTablePresent: {\r\n label: \"Receipt Amount\",\r\n field: \"receiptAmountForTablePresent\",\r\n },\r\n unappliedAmount: {\r\n label: \"Unapplied Amount\",\r\n field: \"unappliedAmount\",\r\n },\r\n accountStateDisplay: {\r\n label: \"Receipt Status\",\r\n field: \"accountStateDisplay\",\r\n },\r\n};\r\n\r\ninterface IReceiptsTableProps {\r\n tableData: any[];\r\n loading: boolean;\r\n factoringLineId: string;\r\n monthOptions: any[];\r\n choosenCurreny: any[] | undefined;\r\n}\r\nconst getCustomerSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const customer = s.customer;\r\n if (res.findIndex((f) => f.label === customer) === -1) {\r\n res.push({ label: customer, value: customer });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nconst getBranchSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const branch = s.branch;\r\n if (res.findIndex((f) => f.label === branch) === -1) {\r\n res.push({ label: branch, value: branch });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nconst getStatusSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const status = s.accountStateDisplay;\r\n if (res.findIndex((f) => f.label === status) === -1) {\r\n res.push({ label: status, value: status });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nlet currentFilterOAPDropdownColumnType: any;\r\n\r\nconst ReceiptsTable: React.FunctionComponent = (props) => {\r\n const { tableData, loading, factoringLineId, monthOptions, choosenCurreny } =\r\n props;\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n // filter statement start\r\n // date filter\r\n const [selectedMonth, setSelecteMonth] = React.useState();\r\n const [selectedToDate, setSelectedToDate] = React.useState();\r\n const [selectedFromDate, setSelectedFromDate] = React.useState();\r\n\r\n const [openDetail, setOpenDetail] = React.useState(false);\r\n const [selectedDetail, setSelectedDetail] = React.useState(null);\r\n\r\n const defaultCondition = conditionFilterSelectors[4];\r\n\r\n const [accountPaymentFilteredSource, setAccountPaymentFilteredSource] =\r\n React.useState([]);\r\n\r\n const [selFilterOAPBranch, setSelFilterOAPBranch] = React.useState<\r\n any | null\r\n >();\r\n const [selFilterOAPCustomers, setSelFilterOAPCustomers] = React.useState<\r\n any | null\r\n >();\r\n const [\r\n selFilterOAPReceiptAmountCondition,\r\n setSelFilterOAPReceiptAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterOAPReceiptAmount, setFilterOAPReceiptAmount] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n const [\r\n selFilterOAPUnappliedAmountCondition,\r\n setSelFilterOAPUnappliedAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterOAPUnappliedAmount, setFilterOAPUnappliedAmount] =\r\n React.useState(undefined);\r\n const [OAPCustomerSource, setOAPCustomerSource] = React.useState([]);\r\n const [OAPBranchsSource, setOAPBranchsSource] = React.useState([]);\r\n const [selFilterOAPStatus, setSelFilterOAPStatus] = React.useState<\r\n any | null\r\n >();\r\n const [OAPStatusSource, setOAPStatusSource] = React.useState([]);\r\n\r\n const [troggleSetDefaultFilter, setTroggleSetDefaultFilter] =\r\n React.useState(false);\r\n\r\n const setOAPDropdownSource = React.useCallback((source: any) => {\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Customer\r\n ) {\r\n const customers = getCustomerSource(source);\r\n setOAPCustomerSource(customers);\r\n }\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Branch\r\n ) {\r\n const bSource = getBranchSource(source);\r\n setOAPBranchsSource(bSource);\r\n }\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Status\r\n ) {\r\n const bSource = getStatusSource(source);\r\n setOAPStatusSource(bSource);\r\n }\r\n currentFilterOAPDropdownColumnType = undefined;\r\n }, []);\r\n\r\n const setDate = React.useCallback(\r\n (month: any) => {\r\n let newfromDate;\r\n let newtoDate;\r\n const dItem = monthOptions.find((f) => f.value === month);\r\n if (dItem) {\r\n newfromDate = convertStrToDate(dItem.monthBeginDate);\r\n newtoDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n newfromDate = getLastMonthBeginDate();\r\n newtoDate = getLastMonthEndDate();\r\n }\r\n const timesArry = getDateTimesNumberList(newfromDate, newtoDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n\r\n setSelectedFromDate(newfromDate);\r\n setSelectedToDate(newtoDate);\r\n },\r\n [monthOptions]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (tableData) {\r\n setOAPDropdownSource(tableData);\r\n }\r\n }, [tableData, setOAPDropdownSource]);\r\n\r\n React.useEffect(() => {\r\n if (monthOptions?.length > 0) {\r\n setSelecteMonth(monthOptions[monthOptions.length - 1]?.value);\r\n setDate(monthOptions[monthOptions.length - 1]?.value);\r\n }\r\n }, [monthOptions, setDate, troggleSetDefaultFilter]);\r\n\r\n React.useEffect(() => {\r\n setTimeout(() => {\r\n tableRef.current?.filter(choosenCurreny, \"currency.currencyCode\", \"in\");\r\n }, 0);\r\n }, [choosenCurreny, troggleSetDefaultFilter]);\r\n\r\n const doOAPFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string\r\n ) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const onMonthChange = (e: any) => {\r\n const newSelectedMonth = e.value;\r\n let newfromDate;\r\n let newtoDate;\r\n const dItem = monthOptions.find((f) => f.value === newSelectedMonth);\r\n if (dItem) {\r\n newfromDate = convertStrToDate(dItem.monthBeginDate);\r\n newtoDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n newfromDate = getLastMonthBeginDate();\r\n newtoDate = getLastMonthEndDate();\r\n }\r\n const timesArry = getDateTimesNumberList(newfromDate, newtoDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n\r\n setSelectedFromDate(newfromDate);\r\n setSelectedToDate(newtoDate);\r\n setSelecteMonth(newSelectedMonth);\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: \"currency.currencyCode\",\r\n filter: true,\r\n body: () => {\r\n return \"\";\r\n },\r\n style: { padding: 0, width: 0 },\r\n },\r\n {\r\n field: tableFields.OAPReceiptDateFilter.field,\r\n header: (\r\n \r\n Date\r\n \r\n \r\n \r\n \r\n ),\r\n filter: true,\r\n body: (rowData: any) => {\r\n return toGBFSDateFormatStr(rowData.receiptDate);\r\n },\r\n filterElement: () => {\r\n const onFromDateChange = (event: any) => {\r\n setSelectedFromDate(event.value);\r\n const timesArry = getDateTimesNumberList(event.value, selectedToDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n };\r\n const onToDateChange = (event: any) => {\r\n setSelectedToDate(event.value);\r\n const timesArry = getDateTimesNumberList(\r\n selectedFromDate,\r\n event.value\r\n );\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n to\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.customer.field,\r\n header: tableFields.customer.label,\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPCustomerFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Customer;\r\n }\r\n tableRef.current?.filter(event.value, \"customer\", \"in\");\r\n setSelFilterOAPCustomers(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const customer = `${rowData.customer}`;\r\n return
{customer}
;\r\n },\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.branch.field,\r\n header: tableFields.branch.label,\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPBranchFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Branch;\r\n }\r\n tableRef.current?.filter(event.value, \"branch\", \"in\");\r\n setSelFilterOAPBranch(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.branchName.field,\r\n header: tableFields.branchName.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.receiptId.field,\r\n header: tableFields.receiptId.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n\r\n {\r\n field: tableFields.receiptAmountForTablePresent.field,\r\n header: tableFields.receiptAmountForTablePresent.label,\r\n body: (rowData: any) => {\r\n const val = rowData.receiptAmountForTablePresent || 0;\r\n const forexInfo = rowData.receiptAmountForexReference;\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n return (\r\n
\r\n {exchangeContent}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"left\" },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPReceiptAmountFilterChangeCondition = (event: any) => {\r\n doOAPFilterNumber(\r\n event.value,\r\n filterOAPReceiptAmount,\r\n \"receiptAmountForTablePresent\"\r\n );\r\n setSelFilterOAPReceiptAmountCondition(event.value);\r\n };\r\n\r\n const onOAPReceiptAmountFilterChangeValue = (event: any) => {\r\n doOAPFilterNumber(\r\n selFilterOAPReceiptAmountCondition,\r\n event.value,\r\n \"receiptAmountForTablePresent\"\r\n );\r\n setFilterOAPReceiptAmount(event.value);\r\n };\r\n return (\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n );\r\n },\r\n style: { textAlign: \"right\", width: 160 },\r\n },\r\n {\r\n field: tableFields.unappliedAmount.field,\r\n header: tableFields.unappliedAmount.label,\r\n filterHeaderStyle: { textAlign: \"left\" },\r\n body: (rowData: any) => {\r\n const valReceiptAmount = rowData.receiptAmountForTablePresent || 0;\r\n const val = rowData.unappliedAmount || 0;\r\n const valRes = renderMoneyWithCurrencyCode(\r\n val,\r\n rowData?.currency?.fundingSymbol\r\n );\r\n const forexInfo = rowData.unappliedAmountForexReference;\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && val !== 0 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n if (valReceiptAmount !== val) {\r\n return (\r\n
\r\n {\" \"}\r\n {exchangeContent}{\" \"}\r\n
{valRes}
\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n {exchangeContent}\r\n {valRes}\r\n
\r\n );\r\n },\r\n filterElement: () => {\r\n const onOAPUnappliedAmountFilterChangeCondition = (event: any) => {\r\n doOAPFilterNumber(\r\n event.value,\r\n filterOAPUnappliedAmount,\r\n \"unappliedAmount\"\r\n );\r\n setSelFilterOAPUnappliedAmountCondition(event.value);\r\n };\r\n\r\n const onOAPUnappliedAmountFilterChangeValue = (event: any) => {\r\n doOAPFilterNumber(\r\n selFilterOAPUnappliedAmountCondition,\r\n event.value,\r\n \"unappliedAmount\"\r\n );\r\n setFilterOAPUnappliedAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n );\r\n },\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { textAlign: \"right\", width: 160 },\r\n },\r\n {\r\n field: tableFields.accountStateDisplay.field,\r\n header: tableFields.accountStateDisplay.label,\r\n\r\n style: { textAlign: \"center\", width: 140 },\r\n filterElement: () => {\r\n const onOAPStatusFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Status;\r\n }\r\n tableRef.current?.filter(event.value, \"accountStateDisplay\", \"in\");\r\n setSelFilterOAPStatus(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n filter: true,\r\n sortable: true,\r\n },\r\n {\r\n field: \"Action\",\r\n header: \"Action\",\r\n body: (rowData: any) => {\r\n return (\r\n {\r\n setOpenDetail(true);\r\n setSelectedDetail(rowData);\r\n }}\r\n >\r\n );\r\n },\r\n style: { width: \"60px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearOAPFilters = () => {\r\n setSelFilterOAPCustomers(undefined);\r\n setFilterOAPReceiptAmount(undefined);\r\n setFilterOAPUnappliedAmount(undefined);\r\n setSelFilterOAPBranch(undefined);\r\n setSelFilterOAPStatus(undefined);\r\n\r\n tableRef.current?.reset();\r\n setTroggleSetDefaultFilter((i) => !i);\r\n\r\n currentFilterOAPDropdownColumnType = undefined;\r\n\r\n const source = tableRef.current?.props.value || [];\r\n setAccountPaymentFilteredSource(source);\r\n setOAPDropdownSource(source);\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n const footerGroup = () => {\r\n const getOAPReceiptAmountTotalFooter = () => {\r\n let total = 0;\r\n for (let s of accountPaymentFilteredSource) {\r\n total += s.receiptAmountForTablePresent || 0;\r\n }\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n accountPaymentFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n const getOAPUnappliedAmountTotalFooter = () => {\r\n let total = 0;\r\n for (let s of accountPaymentFilteredSource) {\r\n total += s.unappliedAmount || 0;\r\n }\r\n\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n accountPaymentFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n {\r\n if (filteredData) {\r\n setAccountPaymentFilteredSource(filteredData);\r\n setOAPDropdownSource(filteredData);\r\n }\r\n }}\r\n scrollable={true}\r\n columns={columns}\r\n loading={loading}\r\n paginator\r\n rows={20}\r\n rowsPerPageOptions={[20, 50, 100]}\r\n footerColumnGroup={footerGroup()}\r\n />\r\n {\r\n setOpenDetail(false);\r\n setSelectedDetail(null);\r\n }}\r\n >\r\n {selectedDetail && (\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default ReceiptsTable;\r\n","import ClientTransactionsTable from \"@/page/Factoring/components/ClientTransactionsTable\";\r\nimport * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\n\r\nconst ClientStatement: React.FunctionComponent = (props) => {\r\n return (\r\n
\r\n

Client Statement

\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ClientStatement;\r\n","import { Button } from \"primereact/button\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\n\r\ninterface ICustomerStatementTableProps {\r\n factoringLines: any[];\r\n showPrintButton: boolean;\r\n setShowPrintPreview: any;\r\n activedFactoringLine: any;\r\n onActivedFactoringLineChange: (agr: any) => void;\r\n}\r\n\r\nconst ActionButtons: React.FunctionComponent = (\r\n props\r\n) => {\r\n const {\r\n factoringLines,\r\n showPrintButton,\r\n setShowPrintPreview,\r\n activedFactoringLine,\r\n onActivedFactoringLineChange,\r\n } = props;\r\n return (\r\n
\r\n
\r\n {\r\n return {\r\n text: `${i.name} ${i.id} ${\r\n i.accountReference ? `- ${i.accountReference}` : \"\"\r\n }`,\r\n value: i.id,\r\n };\r\n })}\r\n onChange={(e) => {\r\n onActivedFactoringLineChange(e.value);\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select Factoring Line\"\r\n style={{ maxWidth: \"400px\" }}\r\n />\r\n
\r\n
\r\n {showPrintButton && (\r\n {\r\n setShowPrintPreview(true);\r\n }}\r\n label=\"Print\"\r\n icon=\"pi pi-download\"\r\n className=\"p-button-secondary\"\r\n />\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ActionButtons;\r\n","import { Column, ColumnProps } from \"primereact/column\";\r\nimport { DataTable, DataTableProps } from \"primereact/datatable\";\r\nimport * as React from \"react\";\r\n\r\nexport interface CustomTableColumnProps extends ColumnProps {\r\n filterElement?: () => React.ReactNode;\r\n}\r\n\r\nexport interface ICustomTableProps extends DataTableProps {\r\n tableRef: React.LegacyRef | undefined;\r\n columns: CustomTableColumnProps[];\r\n}\r\n\r\nconst CustomTable: React.FunctionComponent = (props) => {\r\n const {\r\n tableRef,\r\n value,\r\n onValueChange,\r\n footerColumnGroup,\r\n scrollable = true,\r\n scrollHeight = \"50vh\",\r\n rowHover = true,\r\n columns = [],\r\n loading,\r\n } = props;\r\n return (\r\n
\r\n \r\n {columns.map((i) => {\r\n return (\r\n \r\n );\r\n })}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default CustomTable;\r\n","import { Calendar } from \"primereact/calendar\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n getFilterMatchModel,\r\n toDateTimesNumber,\r\n formatItemValueByFieldType,\r\n getCalendarYearRange,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { renderExchangeContentForDetailTable } from \"../../utils\";\r\n\r\nconst tableFields = {\r\n applyToCreditNoteId: {\r\n label: \"Credit Note ID\",\r\n field: \"applyToCreditNoteId\",\r\n },\r\n OCNDateFilter: {\r\n label: \"Credit Note Date\",\r\n field: \"OCNDateFilter\",\r\n },\r\n crditNoteAmountBeforeApplied: {\r\n label: \"Unapplied Amount (Before)\",\r\n field: \"crditNoteAmountBeforeApplied\",\r\n },\r\n};\r\n\r\ninterface ICreditTableProps {\r\n tableData: any[];\r\n}\r\nconst defaultCondition = conditionFilterSelectors[4];\r\n\r\nconst CreditTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n const [dateFilterCondition, setDateFilterCondition] =\r\n React.useState(defaultCondition);\r\n const [dateFilterValue, setDateFilterValue] = React.useState();\r\n\r\n const [amountFilterCondition, setAmountFilterCondition] =\r\n React.useState(defaultCondition);\r\n\r\n const [amountFilterValue, setAmountFilterValue] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n\r\n const doOCNFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string\r\n ) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: tableFields.applyToCreditNoteId.field,\r\n header: tableFields.applyToCreditNoteId.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 350 },\r\n },\r\n {\r\n field: tableFields.OCNDateFilter.field,\r\n header: tableFields.OCNDateFilter.label,\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(\r\n rowData.OCNDateFilter,\r\n GBFSDataType.Date\r\n );\r\n },\r\n filterElement: () => {\r\n const onDateFilterValueChange = (event: any) => {\r\n var filterTimesNumber = toDateTimesNumber(event.value);\r\n doOCNFilterNumber(\r\n dateFilterCondition,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"OCNDateFilter\"\r\n );\r\n setDateFilterValue(event.value);\r\n };\r\n\r\n const onDateFilterConditionChange = (event: any) => {\r\n const filterTimesNumber = toDateTimesNumber(dateFilterValue);\r\n doOCNFilterNumber(\r\n event.value,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"OCNDateFilter\"\r\n );\r\n setDateFilterCondition(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n filter: true,\r\n sortable: true,\r\n style: { width: 350 },\r\n },\r\n {\r\n field: tableFields.crditNoteAmountBeforeApplied.field,\r\n header: tableFields.crditNoteAmountBeforeApplied.label,\r\n filter: true,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(\r\n rowData.crditNoteAmountBeforeApplied,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n\r\n filterElement: () => {\r\n const onAmountFilterConditionChange = (event: any) => {\r\n doOCNFilterNumber(\r\n event.value,\r\n amountFilterValue,\r\n \"crditNoteAmountBeforeApplied\"\r\n );\r\n setAmountFilterCondition(event.value);\r\n };\r\n\r\n const onAmountFilterValueChange = (event: any) => {\r\n doOCNFilterNumber(\r\n amountFilterCondition,\r\n event.value,\r\n \"crditNoteAmountBeforeApplied\"\r\n );\r\n setAmountFilterValue(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 350 },\r\n },\r\n {\r\n field: \"\",\r\n header: \"\",\r\n body: () => {\r\n return null;\r\n },\r\n style: { width: \"60px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilter = () => {\r\n setDateFilterCondition(defaultCondition);\r\n setDateFilterValue(undefined);\r\n setAmountFilterCondition(defaultCondition);\r\n setAmountFilterValue(undefined);\r\n tableRef.current?.reset();\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default CreditTable;\r\n","import { Calendar } from \"primereact/calendar\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n getFilterMatchModel,\r\n toDateTimesNumber,\r\n formatItemValueByFieldType,\r\n getCalendarYearRange,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { renderExchangeContentForDetailTable } from \"../../utils\";\r\n\r\nconst tableFields = {\r\n applyToInvoiceId: {\r\n label: \"Invoice ID\",\r\n field: \"applyToInvoiceId\",\r\n },\r\n INDateFilter: {\r\n label: \"Invoice Date\",\r\n field: \"INDateFilter\",\r\n },\r\n INDueDateFilter: {\r\n label: \"Due Date\",\r\n field: \"INDueDateFilter\",\r\n },\r\n invoiceAmountBeforeApplied: {\r\n label: \"Due Amount (Before)\",\r\n field: \"invoiceAmountBeforeApplied\",\r\n },\r\n};\r\n\r\ninterface IInvoiceTableProps {\r\n tableData: any[];\r\n}\r\nconst defaultCondition = conditionFilterSelectors[4];\r\n\r\nconst InvoiceTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n const [dateFilterCondition, setDateCondition] =\r\n React.useState(defaultCondition);\r\n const [dateFilterValue, setDateFilterValue] = React.useState();\r\n const [dueDateFilterCondition, setDueDateFilterCondition] =\r\n React.useState(defaultCondition);\r\n const [dueDateFilterValue, setDueDateFilterValue] = React.useState();\r\n\r\n const [\r\n selFilterINUnappliedAmountCondition,\r\n setSelFilterINUnappliedAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterINUnappliedAmount, setFilterINUnappliedAmount] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n\r\n const doINFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string\r\n ) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: tableFields.applyToInvoiceId.field,\r\n header: tableFields.applyToInvoiceId.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.INDateFilter.field,\r\n header: tableFields.INDateFilter.label,\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(\r\n rowData.INDateFilter,\r\n GBFSDataType.Date\r\n );\r\n },\r\n filterElement: () => {\r\n const onDateFilterValueChange = (event: any) => {\r\n var filterTimesNumber = toDateTimesNumber(event.value);\r\n doINFilterNumber(\r\n dateFilterCondition,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDateFilter\"\r\n );\r\n setDateFilterValue(event.value);\r\n };\r\n const onDateFilterConditionChange = (event: any) => {\r\n const filterTimesNumber = toDateTimesNumber(dateFilterValue);\r\n doINFilterNumber(\r\n event.value,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDateFilter\"\r\n );\r\n setDateCondition(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n filter: true,\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.INDueDateFilter.field,\r\n header: tableFields.INDueDateFilter.label,\r\n filter: true,\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(\r\n rowData.INDueDateFilter,\r\n GBFSDataType.Date\r\n );\r\n },\r\n\r\n filterElement: () => {\r\n const onDueDateFilterConditionChange = (event: any) => {\r\n const filterTimesNumber = toDateTimesNumber(dateFilterValue);\r\n doINFilterNumber(\r\n event.value,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDueDateFilter\"\r\n );\r\n setDueDateFilterCondition(event.value);\r\n };\r\n\r\n const onDueDateFilterChange = (event: any) => {\r\n var filterTimesNumber = toDateTimesNumber(event.value);\r\n doINFilterNumber(\r\n dueDateFilterCondition,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDueDateFilter\"\r\n );\r\n setDueDateFilterValue(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.invoiceAmountBeforeApplied.field,\r\n header: tableFields.invoiceAmountBeforeApplied.label,\r\n filter: true,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(\r\n rowData.invoiceAmountBeforeApplied,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n\r\n filterElement: () => {\r\n const onUnappliedAmountFilterConditionChange = (event: any) => {\r\n doINFilterNumber(\r\n event.value,\r\n filterINUnappliedAmount,\r\n \"invoiceAmountBeforeApplied\"\r\n );\r\n setSelFilterINUnappliedAmountCondition(event.value);\r\n };\r\n\r\n const onUnappliedAmountFilterValueChange = (event: any) => {\r\n doINFilterNumber(\r\n selFilterINUnappliedAmountCondition,\r\n event.value,\r\n \"invoiceAmountBeforeApplied\"\r\n );\r\n setFilterINUnappliedAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 260 },\r\n },\r\n {\r\n field: \"\",\r\n header: \"\",\r\n body: () => {\r\n return null;\r\n },\r\n style: { width: \"60px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilter = () => {\r\n setDateCondition(defaultCondition);\r\n setDateFilterValue(undefined);\r\n setDueDateFilterCondition(defaultCondition);\r\n setDueDateFilterValue(undefined);\r\n setSelFilterINUnappliedAmountCondition(defaultCondition);\r\n setFilterINUnappliedAmount(undefined);\r\n tableRef.current?.reset();\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default InvoiceTable;\r\n","import * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport { getReceiptTransactions } from \"@/services/factoring\";\r\nimport {\r\n convertMambuErrorMessage,\r\n toGBFSDateFormatStr,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { renderExchangeContentForDetailTable } from \"../../utils\";\r\n\r\nconst tableFields = {\r\n valueDate: {\r\n label: \"Created Date\",\r\n field: \"valueDate\",\r\n },\r\n transactionType: {\r\n label: \"Transaction Type\",\r\n field: \"brtransactionTypeanch\",\r\n },\r\n reference: {\r\n label: \"Reference\",\r\n field: \"reference\",\r\n },\r\n amount: {\r\n label: \"Amount\",\r\n field: \"amount\",\r\n },\r\n dueAmount: {\r\n label: \"Unapplied Amount\",\r\n field: \"dueAmount\",\r\n },\r\n};\r\n\r\ninterface ITranscationTableProps {\r\n depositAccountEncodedKey: string;\r\n}\r\n\r\nconst TranscationTable: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { depositAccountEncodedKey } = props;\r\n const [transactionSource, setTransactionSource] = React.useState([]);\r\n\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const loadSource = async () => {\r\n setLoading(true);\r\n const res = await getReceiptTransactions(depositAccountEncodedKey);\r\n setLoading(false);\r\n\r\n if (res.success) {\r\n const source = res.result;\r\n if (source) {\r\n setTransactionSource(source);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n loadSource();\r\n }, [depositAccountEncodedKey]);\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: tableFields.valueDate.field,\r\n header: tableFields.valueDate.label,\r\n body: (rowData: any) => {\r\n return toGBFSDateFormatStr(rowData.valueDate);\r\n },\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.transactionType.field,\r\n header: tableFields.transactionType.label,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {`${rowData.transactionType} ${rowData.transactionReferenceTypeDesc}`}\r\n
\r\n );\r\n },\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.reference.field,\r\n header: tableFields.reference.label,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.amount.field,\r\n header: tableFields.amount.label,\r\n body: (rowData: any) => {\r\n const val = rowData.amount || 0;\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.amountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 120 },\r\n },\r\n {\r\n field: tableFields.dueAmount.field,\r\n header: tableFields.dueAmount.label,\r\n body: (rowData: any) => {\r\n const val = rowData.dueAmount || 0;\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 120 },\r\n },\r\n ];\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default TranscationTable;\r\n","import { currencyExchangeIcon } from \"@/utils/consts/icon-consts\";\r\nimport { Button } from \"primereact/button\";\r\n\r\nexport const getInvoiceStatusSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const paymentStatus = s.accountState;\r\n var invoiceTagsList = s.invoiceCustomTags || [];\r\n if (paymentStatus !== \"CLOSED\") {\r\n for (let si of invoiceTagsList) {\r\n if (si.isOpen) {\r\n const tag = si.tag;\r\n if (res.findIndex((f) => f.value === tag) === -1) {\r\n res.push({ label: tag, value: tag, sortValue: si.tagType });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return res.sort((a: any, b: any) => {\r\n return a.sortValue - b.sortValue;\r\n });\r\n};\r\n\r\nexport const getStatusSource = (source: any[]) => {\r\n //payment status\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const status = s.accountStateDisplay;\r\n if (res.findIndex((f) => f.label === status) === -1) {\r\n res.push({ label: status, value: status });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nexport const getCustomerSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const customer = s.customer;\r\n if (res.findIndex((f) => f.label === customer) === -1) {\r\n res.push({ label: customer, value: customer });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nexport const getTypesSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const typeName = s.receivableTypeDisplay;\r\n if (res.findIndex((f) => f.label === typeName) === -1) {\r\n res.push({ label: typeName, value: typeName });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nexport const getBranchSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const branch = s.branch;\r\n if (res.findIndex((f) => f.label === branch) === -1) {\r\n res.push({ label: branch, value: branch });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nexport const renderExchangeContent = (\r\n currency: any,\r\n forexInfo: any,\r\n val: any\r\n) => {\r\n if (!currency || currency?.isBaseCurrency || !forexInfo || !val) {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \"\"\r\n \r\n \r\n );\r\n};\r\n","import * as React from \"react\";\r\nimport CreditTable from \"./CreditTable\";\r\nimport InvoiceTable from \"./InvoiceTable\";\r\nimport TranscationTable from \"./TranscationTable\";\r\nimport styles from \"./index.module.scss\";\r\nimport { getApplyReceiptFormData } from \"@/services/factoring\";\r\nimport {\r\n renderDate,\r\n renderPercent,\r\n toDateTimesNumber,\r\n convertMambuErrorMessage,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { TIME_FORMAT } from \"@/utils/consts/commons\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { renderExchangeContent } from \"../../ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-utils\";\r\n\r\ninterface FieldsType {\r\n [propName: string]: {\r\n label: string;\r\n field: string;\r\n isLongField?: boolean;\r\n minWidth?: number;\r\n type?: \"currency\" | \"date\" | \"percent\";\r\n customRender?: (rowData: any, otherArgument?: any) => JSX.Element;\r\n };\r\n}\r\n\r\nconst fields: FieldsType = {\r\n customer: {\r\n label: \"Customer:\",\r\n field: \"customer\",\r\n },\r\n branchValue: {\r\n label: \"Branch:\",\r\n field: \"branchValue\",\r\n customRender: (detail: any) => {\r\n const { branchName, branch } = detail;\r\n\r\n return {`${branch}${branchName ? ` - ${branchName}` : \"\"}`};\r\n },\r\n },\r\n receiptId: {\r\n label: \"Receipt ID: \",\r\n field: \"receiptId\",\r\n },\r\n paymentMethod: {\r\n label: \"Payment Method:\",\r\n field: \"paymentMethod\",\r\n },\r\n\r\n receiptDate: {\r\n label: \"Receipt Date:\",\r\n field: \"receiptDate\",\r\n type: \"date\",\r\n },\r\n paymentSource: {\r\n label: \"Payment Source: \",\r\n field: \"paymentSource\",\r\n },\r\n chequeReference: {\r\n label: \"Cheque Reference: \",\r\n field: \"chequeReference\",\r\n },\r\n\r\n receiptAmount: {\r\n label: \"Receipt Amount:\",\r\n field: \"receiptAmount\",\r\n type: \"currency\",\r\n },\r\n unappliedAmount: {\r\n label: \"Unapplied Amount:\",\r\n field: \"unappliedAmount\",\r\n type: \"currency\",\r\n },\r\n accountStateDisplay: {\r\n label: \"Receipt Status:\",\r\n field: \"accountStateDisplay\",\r\n },\r\n};\r\n\r\nconst fieldArray = [\r\n fields.customer,\r\n fields.branchValue,\r\n fields.receiptId,\r\n // fields.bankAccount,\r\n fields.paymentMethod,\r\n fields.receiptDate,\r\n // fields.paymentSource,\r\n fields.chequeReference,\r\n fields.receiptAmount,\r\n fields.unappliedAmount,\r\n fields.accountStateDisplay,\r\n];\r\n\r\ninterface DataItem {\r\n accountNo: string;\r\n productType: string;\r\n loanDisbursementDate: string;\r\n loanAmount: number;\r\n interestRate: number;\r\n id: string;\r\n name: string;\r\n balanceList: {\r\n id: string;\r\n month: string;\r\n creditBalance: number;\r\n }[];\r\n schedule: {\r\n id: string;\r\n month: string;\r\n creditBalance: number;\r\n }[];\r\n\r\n [propName: string]: any;\r\n}\r\n\r\nconst getValue = (\r\n item: DataItem | undefined,\r\n field: string,\r\n type?: \"currency\" | \"date\" | \"percent\",\r\n exchangeContent?: any\r\n) => {\r\n if (!item || !field) {\r\n return \"\";\r\n }\r\n if (type) {\r\n switch (type) {\r\n case \"currency\": {\r\n return (\r\n \r\n {renderMoneyWithCurrencyCode(\r\n item[field],\r\n item?.currency?.fundingSymbol\r\n )}\r\n {exchangeContent}\r\n \r\n );\r\n }\r\n case \"date\": {\r\n return renderDate(item[field], TIME_FORMAT.factoringDateFormateString);\r\n }\r\n case \"percent\": {\r\n return renderPercent(item[field]);\r\n }\r\n }\r\n }\r\n return item[field] || \"(None)\";\r\n};\r\n\r\ninterface IReceiptDetailProps {\r\n detail: any;\r\n factoringLineId: string;\r\n}\r\n\r\nconst ReceiptDetail: React.FunctionComponent = (props) => {\r\n const { detail, factoringLineId } = props;\r\n\r\n const [receiptFormData, setReceiptFormData] = React.useState<{\r\n creditNoteSource: any[];\r\n invoiceTableData: any[];\r\n }>();\r\n\r\n React.useEffect(() => {\r\n const getInitData = async () => {\r\n const fullApplied = detail?.unappliedAmount <= 0;\r\n if (!fullApplied) {\r\n LoadingAnimation.show();\r\n const res = await getApplyReceiptFormData({\r\n factoringLineId,\r\n customerId: detail.customerId,\r\n branch: detail.branch,\r\n currencyCode: detail.currency.currencyCode,\r\n });\r\n LoadingAnimation.hide();\r\n\r\n if (res.success && res.result) {\r\n const creditNoteSource =\r\n res.result.creditNotesFormSource?.map((i: any) => {\r\n const { creditNoteId, dueAmount, creditNoteDate } = i;\r\n return {\r\n ...i,\r\n applyToCreditNoteId: creditNoteId,\r\n crditNoteAmountBeforeApplied: dueAmount,\r\n OCNDateFilter: toDateTimesNumber(creditNoteDate),\r\n };\r\n }) || [];\r\n\r\n const invoiceTableData =\r\n res.result.invoicesFormSource?.map((i: any) => {\r\n const { invoiceId, invoiceDate, invoiceDueDate, dueAmount } = i;\r\n return {\r\n ...i,\r\n applyToInvoiceId: invoiceId,\r\n // for filter\r\n INDateFilter: toDateTimesNumber(invoiceDate),\r\n // for filter\r\n INDueDateFilter: toDateTimesNumber(invoiceDueDate),\r\n invoiceAmountBeforeApplied: dueAmount,\r\n };\r\n }) || [];\r\n\r\n setReceiptFormData({\r\n creditNoteSource,\r\n invoiceTableData,\r\n });\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n }\r\n };\r\n getInitData();\r\n }, [detail, factoringLineId]);\r\n\r\n return (\r\n
\r\n
\r\n {fieldArray.map((i) => {\r\n const { isLongField, minWidth, label, field, type, customRender } = i;\r\n\r\n let exchangeContent = null;\r\n if (i === fields.receiptAmount) {\r\n exchangeContent = renderExchangeContent(\r\n detail?.currency,\r\n detail?.receiptAmountForexReference,\r\n detail.receiptAmount\r\n );\r\n }\r\n if (i === fields.unappliedAmount) {\r\n exchangeContent = renderExchangeContent(\r\n detail?.currency,\r\n detail?.unappliedAmountForexReference,\r\n detail.unappliedAmount\r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n {label}\r\n \r\n \r\n {customRender\r\n ? customRender(detail)\r\n : getValue(detail, field, type, exchangeContent)}\r\n \r\n
\r\n );\r\n })}\r\n
\r\n
\r\n \r\n {detail.unappliedAmount ? (\r\n \r\n ) : (\r\n \"\"\r\n )}\r\n {detail.unappliedAmount ? (\r\n \r\n ) : (\r\n \"\"\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ReceiptDetail;\r\n","import * as React from \"react\";\r\nimport { Calendar } from \"primereact/calendar\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\n\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\n\r\nimport { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\nimport { Dialog } from \"primereact/components/dialog/Dialog\";\r\nimport CreditNoteDetail from \"./CreditNoteDetail\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n getFilterMatchModel,\r\n toGBFSDateFormatStr,\r\n convertStrToDate,\r\n getDateTimesNumberList,\r\n getLastMonthBeginDate,\r\n getLastMonthEndDate,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { Button } from \"primereact/button\";\r\nimport { currencyExchangeIcon } from \"@/utils/consts/icon-consts\";\r\n\r\nenum FilterDropdownColumnType {\r\n Customer,\r\n Branch,\r\n Status,\r\n}\r\n\r\nconst tableFields = {\r\n customer: {\r\n label: \"Customer\",\r\n field: \"customer\",\r\n },\r\n branch: {\r\n label: \"Branch\",\r\n field: \"branch\",\r\n },\r\n branchName: {\r\n label: \"Branch Name\",\r\n field: \"branchName\",\r\n },\r\n documentId: {\r\n label: \"Credit Note ID\",\r\n field: \"documentId\",\r\n },\r\n OCNDateFilter: {\r\n label: \"Credit Note Date\",\r\n field: \"valueDateFilter\",\r\n },\r\n creditNoteAmountForTablePresent: {\r\n label: \"Credit Note Amount\",\r\n field: \"creditNoteAmountForTablePresent\",\r\n },\r\n unappliedAmount: {\r\n label: \"Unapplied Amount\",\r\n field: \"unappliedAmount\",\r\n },\r\n accountStateDisplay: {\r\n label: \"Credit Note Status\",\r\n field: \"accountStateDisplay\",\r\n },\r\n};\r\n\r\ninterface IReceiptsTableProps {\r\n tableData: any[];\r\n loading: boolean;\r\n factoringLineId: string;\r\n monthOptions: any[];\r\n choosenCurreny: any[] | undefined;\r\n}\r\nconst getCustomerSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const customer = s.customer;\r\n if (res.findIndex((f) => f.label === customer) === -1) {\r\n res.push({ label: customer, value: customer });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nconst getBranchSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const branch = s.branch;\r\n if (res.findIndex((f) => f.label === branch) === -1) {\r\n res.push({ label: branch, value: branch });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nconst getStatusSource = (source: any[]) => {\r\n let res: any[] = [];\r\n for (let s of source) {\r\n const status = s.accountStateDisplay;\r\n if (res.findIndex((f) => f.label === status) === -1) {\r\n res.push({ label: status, value: status });\r\n }\r\n }\r\n return res.sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nlet currentFilterOAPDropdownColumnType: any;\r\n\r\nconst CreditNote: React.FunctionComponent = (props) => {\r\n const { tableData, loading, factoringLineId, monthOptions, choosenCurreny } =\r\n props;\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n // filter statement start\r\n // date filter\r\n const [selectedMonth, setSelecteMonth] = React.useState();\r\n const [selectedToDate, setSelectedToDate] = React.useState();\r\n const [selectedFromDate, setSelectedFromDate] = React.useState();\r\n\r\n const [openDetail, setOpenDetail] = React.useState(false);\r\n const [selectedDetail, setSelectedDetail] = React.useState(null);\r\n\r\n const defaultCondition = conditionFilterSelectors[4];\r\n\r\n const [accountPaymentFilteredSource, setAccountPaymentFilteredSource] =\r\n React.useState([]);\r\n\r\n const [selFilterOAPBranch, setSelFilterOAPBranch] = React.useState<\r\n any | null\r\n >();\r\n const [selFilterOAPCustomers, setSelFilterOAPCustomers] = React.useState<\r\n any | null\r\n >();\r\n const [\r\n selFilterOAPReceiptAmountCondition,\r\n setSelFilterOAPReceiptAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterOAPReceiptAmount, setFilterOAPReceiptAmount] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n const [\r\n selFilterOAPUnappliedAmountCondition,\r\n setSelFilterOAPUnappliedAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterOAPUnappliedAmount, setFilterOAPUnappliedAmount] =\r\n React.useState(undefined);\r\n const [OAPCustomerSource, setOAPCustomerSource] = React.useState([]);\r\n const [OAPBranchsSource, setOAPBranchsSource] = React.useState([]);\r\n const [selFilterOAPStatus, setSelFilterOAPStatus] = React.useState<\r\n any | null\r\n >();\r\n const [OAPStatusSource, setOAPStatusSource] = React.useState([]);\r\n\r\n const [troggleSetDefaultFilter, setTroggleSetDefaultFilter] =\r\n React.useState(false);\r\n\r\n const setOAPDropdownSource = React.useCallback((source: any) => {\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Customer\r\n ) {\r\n const customers = getCustomerSource(source);\r\n setOAPCustomerSource(customers);\r\n }\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Branch\r\n ) {\r\n const bSource = getBranchSource(source);\r\n setOAPBranchsSource(bSource);\r\n }\r\n if (\r\n currentFilterOAPDropdownColumnType !== FilterDropdownColumnType.Status\r\n ) {\r\n const bSource = getStatusSource(source);\r\n setOAPStatusSource(bSource);\r\n }\r\n currentFilterOAPDropdownColumnType = undefined;\r\n }, []);\r\n\r\n const setDate = React.useCallback(\r\n (month: any) => {\r\n let newfromDate;\r\n let newtoDate;\r\n const dItem = monthOptions.find((f) => f.value === month);\r\n if (dItem) {\r\n newfromDate = convertStrToDate(dItem.monthBeginDate);\r\n newtoDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n newfromDate = getLastMonthBeginDate();\r\n newtoDate = getLastMonthEndDate();\r\n }\r\n const timesArry = getDateTimesNumberList(newfromDate, newtoDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n\r\n setSelectedFromDate(newfromDate);\r\n setSelectedToDate(newtoDate);\r\n },\r\n [monthOptions]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (tableData) {\r\n setAccountPaymentFilteredSource(tableData);\r\n setOAPDropdownSource(tableData);\r\n }\r\n }, [tableData, setOAPDropdownSource]);\r\n\r\n React.useEffect(() => {\r\n if (monthOptions?.length > 0) {\r\n setSelecteMonth(monthOptions[monthOptions.length - 1]?.value);\r\n setDate(monthOptions[monthOptions.length - 1]?.value);\r\n }\r\n }, [monthOptions, setDate, troggleSetDefaultFilter]);\r\n\r\n React.useEffect(() => {\r\n setTimeout(() => {\r\n tableRef.current?.filter(choosenCurreny, \"currency.currencyCode\", \"in\");\r\n }, 0);\r\n }, [choosenCurreny, troggleSetDefaultFilter]);\r\n\r\n const doOAPFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string\r\n ) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const onMonthChange = (e: any) => {\r\n const newSelectedMonth = e.value;\r\n let newfromDate;\r\n let newtoDate;\r\n const dItem = monthOptions.find((f) => f.value === newSelectedMonth);\r\n if (dItem) {\r\n newfromDate = convertStrToDate(dItem.monthBeginDate);\r\n newtoDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n newfromDate = getLastMonthBeginDate();\r\n newtoDate = getLastMonthEndDate();\r\n }\r\n const timesArry = getDateTimesNumberList(newfromDate, newtoDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n\r\n setSelectedFromDate(newfromDate);\r\n setSelectedToDate(newtoDate);\r\n setSelecteMonth(newSelectedMonth);\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: \"currency.currencyCode\",\r\n filter: true,\r\n body: () => {\r\n return \"\";\r\n },\r\n style: { padding: 0, width: 0 },\r\n },\r\n {\r\n field: tableFields.OCNDateFilter.field,\r\n header: (\r\n \r\n Date\r\n \r\n \r\n \r\n \r\n ),\r\n filter: true,\r\n body: (rowData: any) => {\r\n return toGBFSDateFormatStr(rowData.creditNoteDate);\r\n },\r\n filterElement: () => {\r\n const onFromDateChange = (event: any) => {\r\n setSelectedFromDate(event.value);\r\n const timesArry = getDateTimesNumberList(event.value, selectedToDate);\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n };\r\n const onToDateChange = (event: any) => {\r\n setSelectedToDate(event.value);\r\n const timesArry = getDateTimesNumberList(\r\n selectedFromDate,\r\n event.value\r\n );\r\n if (timesArry.length > 0) {\r\n tableRef.current?.filter(timesArry, \"valueDateFilter\", \"in\");\r\n }\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n to\r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.customer.field,\r\n header: tableFields.customer.label,\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPCustomerFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Customer;\r\n }\r\n tableRef.current?.filter(event.value, \"customer\", \"in\");\r\n setSelFilterOAPCustomers(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const customer = `${rowData.customer}`;\r\n return
{customer}
;\r\n },\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.branch.field,\r\n header: tableFields.branch.label,\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPBranchFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Branch;\r\n }\r\n tableRef.current?.filter(event.value, \"branch\", \"in\");\r\n setSelFilterOAPBranch(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.branchName.field,\r\n header: tableFields.branchName.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.documentId.field,\r\n header: tableFields.documentId.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n\r\n {\r\n field: tableFields.creditNoteAmountForTablePresent.field,\r\n header: tableFields.creditNoteAmountForTablePresent.label,\r\n body: (rowData: any) => {\r\n const val = rowData.creditNoteAmountForTablePresent || 0;\r\n const forexInfo = rowData.creditNoteAmountForexReference;\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n return (\r\n
\r\n {exchangeContent}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"left\" },\r\n filter: true,\r\n sortable: true,\r\n filterElement: () => {\r\n const onOAPReceiptAmountFilterChangeCondition = (event: any) => {\r\n doOAPFilterNumber(\r\n event.value,\r\n filterOAPReceiptAmount,\r\n \"creditNoteAmountForTablePresent\"\r\n );\r\n setSelFilterOAPReceiptAmountCondition(event.value);\r\n };\r\n\r\n const onOAPReceiptAmountFilterChangeValue = (event: any) => {\r\n doOAPFilterNumber(\r\n selFilterOAPReceiptAmountCondition,\r\n event.value,\r\n \"creditNoteAmountForTablePresent\"\r\n );\r\n setFilterOAPReceiptAmount(event.value);\r\n };\r\n return (\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n );\r\n },\r\n style: { textAlign: \"right\", width: 160 },\r\n },\r\n {\r\n field: tableFields.unappliedAmount.field,\r\n header: tableFields.unappliedAmount.label,\r\n filterHeaderStyle: { textAlign: \"left\" },\r\n body: (rowData: any) => {\r\n const valcnAmount = rowData.creditNoteAmountForTablePresent || 0;\r\n const val = rowData.unappliedAmount || 0;\r\n const valRes = renderMoneyWithCurrencyCode(\r\n val,\r\n rowData?.currency?.fundingSymbol\r\n );\r\n const forexInfo = rowData.unappliedAmountForexReference;\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && val !== 0 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n if (valcnAmount !== val) {\r\n return (\r\n
\r\n {exchangeContent}\r\n
{valRes}
\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n {exchangeContent}\r\n {valRes}\r\n
\r\n );\r\n },\r\n filterElement: () => {\r\n const onOAPUnappliedAmountFilterChangeCondition = (event: any) => {\r\n doOAPFilterNumber(\r\n event.value,\r\n filterOAPUnappliedAmount,\r\n \"unappliedAmount\"\r\n );\r\n setSelFilterOAPUnappliedAmountCondition(event.value);\r\n };\r\n\r\n const onOAPUnappliedAmountFilterChangeValue = (event: any) => {\r\n doOAPFilterNumber(\r\n selFilterOAPUnappliedAmountCondition,\r\n event.value,\r\n \"unappliedAmount\"\r\n );\r\n setFilterOAPUnappliedAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n );\r\n },\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { textAlign: \"right\", width: 160 },\r\n },\r\n {\r\n field: tableFields.accountStateDisplay.field,\r\n header: tableFields.accountStateDisplay.label,\r\n\r\n style: { textAlign: \"center\", width: 140 },\r\n filterElement: () => {\r\n const onOAPStatusFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n currentFilterOAPDropdownColumnType =\r\n FilterDropdownColumnType.Status;\r\n }\r\n tableRef.current?.filter(event.value, \"accountStateDisplay\", \"in\");\r\n setSelFilterOAPStatus(event.value);\r\n };\r\n return (\r\n \r\n );\r\n },\r\n filter: true,\r\n sortable: true,\r\n },\r\n {\r\n field: \"Action\",\r\n header: \"Action\",\r\n body: (rowData: any) => {\r\n return (\r\n {\r\n setOpenDetail(true);\r\n setSelectedDetail(rowData);\r\n }}\r\n >\r\n );\r\n },\r\n style: { width: \"60px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearOAPFilters = () => {\r\n setSelFilterOAPCustomers(undefined);\r\n setFilterOAPReceiptAmount(undefined);\r\n setFilterOAPUnappliedAmount(undefined);\r\n setSelFilterOAPBranch(undefined);\r\n setSelFilterOAPStatus(undefined);\r\n currentFilterOAPDropdownColumnType = undefined;\r\n\r\n tableRef.current?.reset();\r\n setTroggleSetDefaultFilter((i) => !i);\r\n\r\n const source = tableRef.current?.props.value || [];\r\n setAccountPaymentFilteredSource(source);\r\n setOAPDropdownSource(source);\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n const footerGroup = () => {\r\n const getOAPReceiptAmountTotalFooter = () => {\r\n let total = 0;\r\n for (let s of accountPaymentFilteredSource) {\r\n total += s.creditNoteAmountForTablePresent || 0;\r\n }\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n accountPaymentFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n const getOAPUnappliedAmountTotalFooter = () => {\r\n let total = 0;\r\n for (let s of accountPaymentFilteredSource) {\r\n total += s.unappliedAmount || 0;\r\n }\r\n\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n accountPaymentFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n {\r\n if (filteredData) {\r\n setAccountPaymentFilteredSource(filteredData);\r\n setOAPDropdownSource(filteredData);\r\n }\r\n }}\r\n scrollable={true}\r\n columns={columns}\r\n loading={loading}\r\n paginator\r\n rows={20}\r\n rowsPerPageOptions={[20, 50, 100]}\r\n footerColumnGroup={footerGroup()}\r\n />\r\n {\r\n setOpenDetail(false);\r\n setSelectedDetail(null);\r\n }}\r\n >\r\n {selectedDetail && (\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default CreditNote;\r\n","import { Calendar } from \"primereact/calendar\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n getFilterMatchModel,\r\n toDateTimesNumber,\r\n formatItemValueByFieldType,\r\n getCalendarYearRange,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { renderExchangeContentForDetailTable } from \"../../utils\";\r\n\r\n\r\nconst tableFields = {\r\n applyToInvoiceId: {\r\n label: \"Invoice ID\",\r\n field: \"applyToInvoiceId\",\r\n },\r\n INDateFilter: {\r\n label: \"Invoice Date\",\r\n field: \"INDateFilter\",\r\n },\r\n INDueDateFilter: {\r\n label: \"Due Date\",\r\n field: \"INDueDateFilter\",\r\n },\r\n invoiceAmountBeforeApplied: {\r\n label: \"Due Amount (Before)\",\r\n field: \"invoiceAmountBeforeApplied\",\r\n },\r\n};\r\n\r\ninterface IInvoiceTableProps {\r\n tableData: any[];\r\n}\r\nconst defaultCondition = conditionFilterSelectors[4];\r\n\r\nconst InvoiceTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n const tableRef = React.useRef(null);\r\n\r\n const [dateFilterCondition, setDateCondition] =\r\n React.useState(defaultCondition);\r\n const [dateFilterValue, setDateFilterValue] = React.useState();\r\n const [dueDateFilterCondition, setDueDateFilterCondition] =\r\n React.useState(defaultCondition);\r\n const [dueDateFilterValue, setDueDateFilterValue] = React.useState();\r\n\r\n const [\r\n selFilterINUnappliedAmountCondition,\r\n setSelFilterINUnappliedAmountCondition,\r\n ] = React.useState(defaultCondition);\r\n const [filterINUnappliedAmount, setFilterINUnappliedAmount] = React.useState<\r\n number | undefined\r\n >(undefined);\r\n\r\n const doINFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string\r\n ) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: tableFields.applyToInvoiceId.field,\r\n header: tableFields.applyToInvoiceId.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.INDateFilter.field,\r\n header: tableFields.INDateFilter.label,\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(\r\n rowData.INDateFilter,\r\n GBFSDataType.Date\r\n );\r\n },\r\n filterElement: () => {\r\n const onDateFilterValueChange = (event: any) => {\r\n var filterTimesNumber = toDateTimesNumber(event.value);\r\n doINFilterNumber(\r\n dateFilterCondition,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDateFilter\"\r\n );\r\n setDateFilterValue(event.value);\r\n };\r\n const onDateFilterConditionChange = (event: any) => {\r\n const filterTimesNumber = toDateTimesNumber(dateFilterValue);\r\n doINFilterNumber(\r\n event.value,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDateFilter\"\r\n );\r\n setDateCondition(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n filter: true,\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.INDueDateFilter.field,\r\n header: tableFields.INDueDateFilter.label,\r\n filter: true,\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(\r\n rowData.INDueDateFilter,\r\n GBFSDataType.Date\r\n );\r\n },\r\n\r\n filterElement: () => {\r\n const onDueDateFilterConditionChange = (event: any) => {\r\n const filterTimesNumber = toDateTimesNumber(dateFilterValue);\r\n doINFilterNumber(\r\n event.value,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDueDateFilter\"\r\n );\r\n setDueDateFilterCondition(event.value);\r\n };\r\n\r\n const onDueDateFilterChange = (event: any) => {\r\n var filterTimesNumber = toDateTimesNumber(event.value);\r\n doINFilterNumber(\r\n dueDateFilterCondition,\r\n filterTimesNumber > 0 ? filterTimesNumber : undefined,\r\n \"INDueDateFilter\"\r\n );\r\n setDueDateFilterValue(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n style: { width: 260 },\r\n },\r\n {\r\n field: tableFields.invoiceAmountBeforeApplied.field,\r\n header: tableFields.invoiceAmountBeforeApplied.label,\r\n filter: true,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(\r\n rowData.invoiceAmountBeforeApplied,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n\r\n filterElement: () => {\r\n const onUnappliedAmountFilterConditionChange = (event: any) => {\r\n doINFilterNumber(\r\n event.value,\r\n filterINUnappliedAmount,\r\n \"invoiceAmountBeforeApplied\"\r\n );\r\n setSelFilterINUnappliedAmountCondition(event.value);\r\n };\r\n\r\n const onUnappliedAmountFilterValueChange = (event: any) => {\r\n doINFilterNumber(\r\n selFilterINUnappliedAmountCondition,\r\n event.value,\r\n \"invoiceAmountBeforeApplied\"\r\n );\r\n setFilterINUnappliedAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n },\r\n sortable: true,\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 260 },\r\n },\r\n {\r\n field: \"\",\r\n header: \"\",\r\n body: () => {\r\n return null;\r\n },\r\n style: { width: \"60px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilter = () => {\r\n setDateCondition(defaultCondition);\r\n setDateFilterValue(undefined);\r\n setDueDateFilterCondition(defaultCondition);\r\n setDueDateFilterValue(undefined);\r\n setSelFilterINUnappliedAmountCondition(defaultCondition);\r\n setFilterINUnappliedAmount(undefined);\r\n tableRef.current?.reset();\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default InvoiceTable;\r\n","import * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport { getCreditNotesTransactions } from \"@/services/factoring\";\r\nimport {\r\n convertMambuErrorMessage,\r\n toGBFSDateFormatStr,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { renderExchangeContentForDetailTable } from \"../../utils\";\r\n\r\nconst tableFields = {\r\n valueDate: {\r\n label: \"Created Date\",\r\n field: \"valueDate\",\r\n },\r\n transactionType: {\r\n label: \"Transaction Type\",\r\n field: \"brtransactionTypeanch\",\r\n },\r\n reference: {\r\n label: \"Reference\",\r\n field: \"reference\",\r\n },\r\n amount: {\r\n label: \"Amount\",\r\n field: \"amount\",\r\n },\r\n dueAmount: {\r\n label: \"Unapplied Amount\",\r\n field: \"dueAmount\",\r\n },\r\n};\r\n\r\ninterface ITranscationTableProps {\r\n depositAccountEncodedKey: string;\r\n}\r\n\r\nconst TranscationTable: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { depositAccountEncodedKey } = props;\r\n const [transactionSource, setTransactionSource] = React.useState([]);\r\n\r\n React.useEffect(() => {\r\n const loadSource = async () => {\r\n const res = await getCreditNotesTransactions(depositAccountEncodedKey);\r\n if (res.success) {\r\n const source = res.result;\r\n if (source) {\r\n setTransactionSource(source);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n loadSource();\r\n }, [depositAccountEncodedKey]);\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: tableFields.valueDate.field,\r\n header: tableFields.valueDate.label,\r\n body: (rowData: any) => {\r\n return toGBFSDateFormatStr(rowData.valueDate);\r\n },\r\n style: { width: 160 },\r\n },\r\n {\r\n field: tableFields.transactionType.field,\r\n header: tableFields.transactionType.label,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {`${rowData.transactionType} ${rowData.transactionReferenceTypeDesc}`}\r\n
\r\n );\r\n },\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.reference.field,\r\n header: tableFields.reference.label,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.amount.field,\r\n header: tableFields.amount.label,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(\r\n rowData.amount,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.amountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 120 },\r\n },\r\n {\r\n field: tableFields.dueAmount.field,\r\n header: tableFields.dueAmount.label,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {renderMoneyWithCurrencyCode(\r\n rowData.dueAmount,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n
\r\n );\r\n },\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { textAlign: \"right\", width: 120 },\r\n },\r\n ];\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default TranscationTable;\r\n","import * as React from \"react\";\r\nimport InvoiceTable from \"./InvoiceTable\";\r\nimport TranscationTable from \"./TranscationTable\";\r\nimport styles from \"./index.module.scss\";\r\nimport { getApplyCreditNoteFormData } from \"@/services/factoring\";\r\nimport {\r\n toGBFSDateFormatStr,\r\n renderPercent,\r\n toDateTimesNumber,\r\n convertMambuErrorMessage,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { renderExchangeContent } from \"../../ScheduleOfInvoices/components/ReceiveableTable/receivables/receivable-utils\";\r\n\r\ninterface FieldsType {\r\n [propName: string]: {\r\n label: string;\r\n field: string;\r\n isLongField?: boolean;\r\n minWidth?: number;\r\n type?: \"currency\" | \"date\" | \"percent\";\r\n customRender?: (rowData: any) => JSX.Element;\r\n };\r\n}\r\n\r\nconst fields: FieldsType = {\r\n customer: {\r\n label: \"Customer:\",\r\n field: \"customer\",\r\n },\r\n branchValue: {\r\n label: \"Branch:\",\r\n field: \"branchValue\",\r\n customRender: (detail: any) => {\r\n const { branchName, branch } = detail;\r\n\r\n return {`${branch}${branchName ? ` - ${branchName}` : \"\"}`};\r\n },\r\n },\r\n documentId: {\r\n label: \"Credit Note ID: \",\r\n field: \"documentId\",\r\n },\r\n // createdDate: {\r\n // label: \"Created Date: \",\r\n // field: \"createdDate\",\r\n // type: \"date\",\r\n // },\r\n creditNoteDate: {\r\n label: \"Credit Note Date:\",\r\n field: \"creditNoteDate\",\r\n type: \"date\",\r\n },\r\n scheduleNo: {\r\n label: \"Schedule No.:\",\r\n field: \"scheduleNo\",\r\n },\r\n\r\n creditNoteAmount: {\r\n label: \"Credit Note Amount:\",\r\n field: \"creditNoteAmount\",\r\n type: \"currency\",\r\n },\r\n unappliedAmount: {\r\n label: \"Unapplied Amount: \",\r\n field: \"unappliedAmount\",\r\n type: \"currency\",\r\n },\r\n accountStateDisplay: {\r\n label: \"Credit Note Status: \",\r\n field: \"accountStateDisplay\",\r\n },\r\n};\r\n\r\nconst fieldArray = [\r\n fields.customer,\r\n fields.branchValue,\r\n fields.documentId,\r\n fields.creditNoteDate,\r\n fields.scheduleNo,\r\n fields.creditNoteAmount,\r\n fields.unappliedAmount,\r\n fields.accountStateDisplay,\r\n];\r\n\r\ninterface DataItem {\r\n accountNo: string;\r\n productType: string;\r\n loanDisbursementDate: string;\r\n loanAmount: number;\r\n interestRate: number;\r\n id: string;\r\n name: string;\r\n balanceList: {\r\n id: string;\r\n month: string;\r\n creditBalance: number;\r\n }[];\r\n schedule: {\r\n id: string;\r\n month: string;\r\n creditBalance: number;\r\n }[];\r\n\r\n [propName: string]: any;\r\n}\r\n\r\nconst getValue = (\r\n item: DataItem | undefined,\r\n field: string,\r\n type?: \"currency\" | \"date\" | \"percent\",\r\n exchangeContent?: any\r\n) => {\r\n if (!item || !field) {\r\n return \"\";\r\n }\r\n if (type) {\r\n switch (type) {\r\n case \"currency\": {\r\n return (\r\n \r\n {renderMoneyWithCurrencyCode(\r\n item[field],\r\n item?.currency?.fundingSymbol\r\n )}\r\n {exchangeContent}\r\n \r\n );\r\n }\r\n case \"date\": {\r\n return toGBFSDateFormatStr(item[field]);\r\n }\r\n case \"percent\": {\r\n return renderPercent(item[field]);\r\n }\r\n }\r\n }\r\n return item[field] || \"(None)\";\r\n};\r\n\r\ninterface ICreditNoteDetailProps {\r\n factoringLineId: string;\r\n detail: any;\r\n}\r\n\r\nconst CreditNoteDetail: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { detail, factoringLineId } = props;\r\n\r\n const [tableData, setTableData] = React.useState([]);\r\n\r\n React.useEffect(() => {\r\n const loadReceiptFormData = async () => {\r\n const fullApplied = detail.unappliedAmount <= 0;\r\n if (!fullApplied) {\r\n LoadingAnimation.show();\r\n const res = await getApplyCreditNoteFormData({\r\n factoringLineId: factoringLineId,\r\n customerId: detail.customerId,\r\n branch: detail.branch,\r\n currencyCode: detail.currency.currencyCode,\r\n });\r\n LoadingAnimation.hide();\r\n if (res.success && res.result) {\r\n const invoiceTableData = res.result?.map((i: any) => {\r\n const { invoiceId, invoiceDate, invoiceDueDate, dueAmount } = i;\r\n return {\r\n ...i,\r\n applyToInvoiceId: invoiceId,\r\n // for filter\r\n INDateFilter: toDateTimesNumber(invoiceDate),\r\n // for filter\r\n INDueDateFilter: toDateTimesNumber(invoiceDueDate),\r\n invoiceAmountBeforeApplied: dueAmount,\r\n };\r\n });\r\n\r\n setTableData(invoiceTableData);\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n }\r\n };\r\n loadReceiptFormData();\r\n }, [factoringLineId, detail]);\r\n\r\n return (\r\n
\r\n
\r\n {fieldArray.map((i) => {\r\n const { isLongField, minWidth, label, field, type, customRender } = i;\r\n\r\n let exchangeContent = null;\r\n if (i === fields.creditNoteAmount) {\r\n exchangeContent = renderExchangeContent(\r\n detail?.currency,\r\n detail?.creditNoteAmountForexReference,\r\n detail.creditNoteAmount\r\n );\r\n }\r\n if (i === fields.unappliedAmount) {\r\n exchangeContent = renderExchangeContent(\r\n detail?.currency,\r\n detail?.unappliedAmountForexReference,\r\n detail.unappliedAmount\r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n {label}\r\n \r\n \r\n {customRender\r\n ? customRender(detail)\r\n : getValue(detail, field, type, exchangeContent)}\r\n \r\n
\r\n );\r\n })}\r\n
\r\n
\r\n \r\n {detail.unappliedAmount ? : \"\"}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default CreditNoteDetail;\r\n","import * as React from \"react\";\r\nimport ActionButtons from \"./ActionButtons\";\r\nimport styles from \"./index.module.scss\";\r\nimport { TabMenu } from \"primereact/tabmenu\";\r\nimport ReceiptsTable from \"./ReceiptsTable\";\r\nimport CreditNote from \"./CreditNote\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport {\r\n getCustomerPayment,\r\n getFactoringLineActivationDate,\r\n GetFactoringLines,\r\n} from \"@/services/factoring\";\r\nimport {\r\n convertStrToDate,\r\n getLastMonth,\r\n getYearMonthDropdownOptions,\r\n convertMambuErrorMessage,\r\n toDateTimesNumber,\r\n getTodayDate,\r\n} from \"@/utils/common-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport PrintStatement from \"../components/PrintStatement\";\r\nimport { StatementPrintType } from \"@/utils/enums\";\r\nimport { getCurrencyOptions } from \"../utils\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\n\r\ninterface ICustomerStatementProps {}\r\n\r\nconst getMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getTodayDate();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n};\r\n\r\nconst getPrintMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getLastMonth();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n};\r\n\r\nconst someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nenum tabType {\r\n receipts = 0,\r\n creditNote = 1,\r\n}\r\n\r\nconst CustomerStatement: React.FunctionComponent = (\r\n props\r\n) => {\r\n const [factoringLines, setFactoringLines] = React.useState([]);\r\n const [activedFactoringLine, setActivedFactoringLine] = React.useState();\r\n\r\n const [monthOptions, setMonthOptions] = React.useState([]);\r\n const [printMonthOptions, setPrintMonthOptions] = React.useState([]);\r\n\r\n const [showPrintPreview, setShowPrintPreview] =\r\n React.useState(false);\r\n\r\n const [activeIndex, setActiveIndex] = React.useState(tabType.receipts);\r\n\r\n const [statement, setStatement] = React.useState([]);\r\n const [creditNote, setCreditNote] = React.useState([]);\r\n\r\n const [choosenCurreny, setChoosenCurreny] = React.useState();\r\n const [currencyOptions, setCurrencyOptions] = React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >();\r\n\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n const getStatement = React.useCallback(async (factoringLineId: string) => {\r\n setLoading(true);\r\n const res = await getCustomerPayment(factoringLineId).catch((e) => {\r\n setLoading(false);\r\n });\r\n setLoading(false);\r\n\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n setCreditNote(\r\n res.result.accountCreditNotes?.map((i: any) => ({\r\n ...i,\r\n valueDateFilter: toDateTimesNumber(i.creditNoteDate),\r\n }))\r\n );\r\n\r\n setStatement(\r\n res.result?.accountPayments?.map((i: any) => ({\r\n ...i,\r\n valueDateFilter: toDateTimesNumber(i.receiptDate),\r\n }))\r\n );\r\n\r\n const newCurrencyOptions = getCurrencyOptions([\r\n ...(res.result.accountCreditNotes || []),\r\n ...(res.result.accountPayments || []),\r\n ]);\r\n\r\n setCurrencyOptions(newCurrencyOptions);\r\n }, []);\r\n\r\n const getActivationDate = React.useCallback(\r\n async (factoringLineId: string) => {\r\n const res = await getFactoringLineActivationDate(factoringLineId);\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n setMonthOptions(getMonthOptions(res.result));\r\n setPrintMonthOptions(getPrintMonthOptions(res.result));\r\n },\r\n []\r\n );\r\n\r\n React.useEffect(() => {\r\n const getInitData = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetFactoringLines();\r\n LoadingAnimation.hide();\r\n if (\r\n mountedRef.current &&\r\n res.success &&\r\n res.result &&\r\n res.result?.length > 0\r\n ) {\r\n setFactoringLines(res.result);\r\n setActivedFactoringLine(res.result[0]?.id);\r\n getStatement(res.result[0]?.id);\r\n\r\n getActivationDate(res.result[0]?.id);\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n\r\n getInitData();\r\n }, [getActivationDate, getStatement]);\r\n\r\n return (\r\n
\r\n

Customer Payment

\r\n
\r\n
\r\n 0}\r\n setShowPrintPreview={setShowPrintPreview}\r\n activedFactoringLine={activedFactoringLine}\r\n onActivedFactoringLineChange={(newActivedFactoringLine: string) => {\r\n setActivedFactoringLine(newActivedFactoringLine);\r\n getStatement(newActivedFactoringLine);\r\n getActivationDate(newActivedFactoringLine);\r\n }}\r\n />\r\n setChoosenCurreny(e.value)}\r\n placeholder=\"Currency\"\r\n />\r\n setActiveIndex(e.index)}\r\n />\r\n\r\n {activeIndex === tabType.receipts && (\r\n \r\n )}\r\n\r\n {activeIndex === tabType.creditNote && (\r\n \r\n )}\r\n\r\n {showPrintPreview && (\r\n {\r\n setShowPrintPreview(false);\r\n }}\r\n activedFactoringLineId={activedFactoringLine}\r\n options={printMonthOptions}\r\n printType={StatementPrintType.CustomerPayment}\r\n />\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default CustomerStatement;\r\n","import requestFactoring from \"@/services/requestFactoring\";\r\nimport { CancelToken } from \"axios\";\r\n\r\nexport function getPrintStatementCustomersDropdownList(factoringLineId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetPrintStatementCustomersDropdownList\",\r\n method: \"get\",\r\n params: {\r\n factoringLineId,\r\n },\r\n }) as Promise;\r\n}\r\n\r\nexport function getCustomerStatement(\r\n factoringLineId: string,\r\n data: FactoringCustomerStatement.CustomerParams,\r\n cancelToken: CancelToken\r\n) {\r\n return requestFactoring({\r\n url: \"/api/EClient/LoadCustomerStatement\",\r\n method: \"POST\",\r\n data,\r\n params: {\r\n factoringLineId,\r\n },\r\n cancelToken,\r\n }) as Promise;\r\n}\r\n\r\nexport function RunLoadCustomerStatementTask(\r\n factoringLineId: string,\r\n data: FactoringCustomerStatement.CustomerParams) {\r\n return requestFactoring({\r\n url: \"/api/EClient/RunLoadCustomerStatementTask\",\r\n method: \"POST\",\r\n data,\r\n params: {\r\n factoringLineId,\r\n },\r\n });\r\n}\r\nexport function GetLoadCustomerStatementTaskStatus(taskId: string) {\r\n return requestFactoring({\r\n url: \"/api/EClient/GetLoadCustomerStatementTaskStatus\",\r\n method: \"GET\",\r\n params: {\r\n id: taskId,\r\n ts: new Date().getTime(),\r\n },\r\n });\r\n}","import { Button } from \"primereact/button\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport PrintStatement from \"../components/PrintStatement\";\r\nimport { StatementPrintType } from \"@/utils/enums\";\r\nimport { getFactoringLineActivationDate, GetFactoringLines } from \"@/services/factoring\";\r\nimport {\r\n convertStrToDate,\r\n getTodayDate,\r\n getYearMonthDropdownOptions,\r\n convertMambuErrorMessage,\r\n YearMonthDropdownOptions,\r\n} from \"@/utils/common-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport { getPrintStatementCustomersDropdownList } from \"@/services/factoring/customerStatement\";\r\n\r\nconst getMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getTodayDate();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n};\r\n\r\nconst someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\ninterface ICustomerStatementTableProps {\r\n setMonthOptions: React.Dispatch>;\r\n monthOptions: YearMonthDropdownOptions[];\r\n activedFactoringLine?: string;\r\n setActivedFactoringLine: React.Dispatch;\r\n activedCustomer?: string;\r\n setActiveCustomer: React.Dispatch;\r\n\r\n selectedMonth?: string;\r\n setSelecteMonth: React.Dispatch;\r\n}\r\n\r\nconst ActionButtons: React.FunctionComponent = (props) => {\r\n const {\r\n setMonthOptions,\r\n monthOptions,\r\n activedFactoringLine,\r\n setActivedFactoringLine,\r\n activedCustomer,\r\n setActiveCustomer,\r\n selectedMonth,\r\n setSelecteMonth,\r\n } = props;\r\n\r\n const [factoringLines, setFactoringLines] = React.useState([]);\r\n\r\n const [showPrintPreview, setShowPrintPreview] = React.useState(false);\r\n\r\n const [customerDropList, setCustomerDropList] = React.useState<\r\n FactoringCustomerStatement.DropDownData[]\r\n >([]);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n const getCustomerDropList = React.useCallback(\r\n async (factoringLineId: string) => {\r\n // set to init state, Avoid incorrect triggering to obtain state\r\n setCustomerDropList([]);\r\n setActiveCustomer(undefined);\r\n\r\n LoadingAnimation.show();\r\n const res = await getPrintStatementCustomersDropdownList(factoringLineId);\r\n LoadingAnimation.hide();\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n\r\n setCustomerDropList(res.result);\r\n\r\n // default\r\n setActiveCustomer(res.result?.[0]?.value);\r\n },\r\n [setActiveCustomer]\r\n );\r\n\r\n const getActivationDate = React.useCallback(\r\n async (factoringLineId: string) => {\r\n const res = await getFactoringLineActivationDate(factoringLineId);\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n const newMonthOptions = getMonthOptions(res.result);\r\n setMonthOptions(newMonthOptions);\r\n setSelecteMonth(newMonthOptions?.[newMonthOptions?.length - 1]?.value);\r\n },\r\n [setMonthOptions, setSelecteMonth]\r\n );\r\n\r\n React.useEffect(() => {\r\n const getInitData = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetFactoringLines();\r\n LoadingAnimation.hide();\r\n if (mountedRef.current && res.success && res.result && res.result?.length > 0) {\r\n setFactoringLines(res.result);\r\n setActivedFactoringLine(res.result[0]?.id);\r\n getCustomerDropList(res.result[0]?.id);\r\n getActivationDate(res.result[0]?.id);\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n\r\n getInitData();\r\n }, [getCustomerDropList, getActivationDate, setActivedFactoringLine]);\r\n\r\n return (\r\n
\r\n
\r\n {\r\n return {\r\n text: `${i.name} ${i.id} ${i.accountReference ? `- ${i.accountReference}` : \"\"}`,\r\n value: i.id,\r\n };\r\n })}\r\n onChange={(e) => {\r\n setActivedFactoringLine(e.value);\r\n getCustomerDropList(e.value);\r\n getActivationDate(e.value)\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select Factoring Line\"\r\n style={{ maxWidth: \"300px\", marginBottom: \"12px\" }}\r\n />\r\n {\r\n setActiveCustomer(e.value);\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select Customer\"\r\n style={{ maxWidth: \"300px\", marginBottom: \"12px\" }}\r\n />\r\n {\r\n setSelecteMonth(e.value);\r\n }}\r\n placeholder=\"Select month\"\r\n style={{ maxWidth: \"140px\", marginBottom: \"12px\" }}\r\n />\r\n
\r\n\r\n
\r\n {monthOptions?.length > 0 && (\r\n {\r\n setShowPrintPreview(true);\r\n }}\r\n label=\"Print\"\r\n icon=\"pi pi-download\"\r\n className=\"p-button-secondary\"\r\n />\r\n )}\r\n
\r\n\r\n {showPrintPreview && (\r\n {\r\n setShowPrintPreview(false);\r\n }}\r\n activedFactoringLineId={activedFactoringLine}\r\n options={monthOptions}\r\n customerDropList={customerDropList}\r\n printType={StatementPrintType.CustomerStatement}\r\n />\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ActionButtons;\r\n","import * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n formatItemValueByFieldType,\r\n getFilterMatchModel,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { Column } from \"primereact/column\";\r\nimport { Row } from \"primereact/row\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\n\r\nenum statementFields {\r\n date = \"documentDate\",\r\n type = \"transactionType\",\r\n reference = \"reference\",\r\n dueDate = \"dueDate\",\r\n description = \"description\",\r\n debit = \"debitInCurrency\",\r\n credit = \"creditInCurrency\",\r\n balance = \"balanceInCurrency\",\r\n}\r\n\r\nconst tableFields = {\r\n date: {\r\n label: \"Date\",\r\n field: \"documentDate\",\r\n },\r\n type: {\r\n label: \"Type\",\r\n field: \"transactionType\",\r\n },\r\n reference: {\r\n label: \"Reference\",\r\n field: \"reference\",\r\n },\r\n dueDate: {\r\n label: \"Due Date\",\r\n field: \"dueDate\",\r\n },\r\n description: {\r\n label: \"Description\",\r\n field: \"description\",\r\n },\r\n debit: {\r\n label: \"Debit\",\r\n field: \"debitInCurrency\",\r\n },\r\n credit: {\r\n label: \"Credit\",\r\n field: \"creditInCurrency\",\r\n },\r\n balance: {\r\n label: \"Balance\",\r\n field: \"balanceInCurrency\",\r\n },\r\n};\r\n\r\nconst renderDate = (value: string) => {\r\n return formatItemValueByFieldType(value, GBFSDataType.Date);\r\n};\r\n\r\nconst getTransactionSubTypeSource = (source: any[]) => {\r\n const valueSet = new Set();\r\n source.forEach((i) => {\r\n valueSet.add(i[statementFields.type]);\r\n });\r\n\r\n return Array.from(valueSet)\r\n .map((i) => {\r\n return {\r\n label: i,\r\n value: i,\r\n };\r\n })\r\n .sort((a, b) => {\r\n return a.value.localeCompare(b.value);\r\n });\r\n};\r\n\r\nconst balancesBroughtForwardItemId = \"bbf_key_cus\";\r\ninterface ICustomerStatementTableProps {\r\n tableData: any[];\r\n loading: boolean;\r\n}\r\n\r\nconst CustomerStatementTable: React.FunctionComponent = (props) => {\r\n const { tableData, loading } = props;\r\n const tableRef = React.useRef(null);\r\n\r\n const [troggleSetDefaultFilter, setTroggleSetDefaultFilter] = React.useState(0);\r\n\r\n const [filteredTableData, setfilteredTableData] = React.useState();\r\n\r\n React.useEffect(() => {\r\n tableRef.current?.reset();\r\n setfilteredTableData(tableData);\r\n setTroggleSetDefaultFilter((i) => i + 1);\r\n }, [tableData]);\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: \"documentDateFilter\",\r\n header: \"Date\",\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const value = rowData[statementFields.date];\r\n return renderDate(value);\r\n },\r\n sortable: true,\r\n style: { width: 170 },\r\n },\r\n {\r\n field: tableFields.type.field,\r\n header: tableFields.type.label,\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n sortable: true,\r\n style: { width: 210 },\r\n },\r\n {\r\n field: tableFields.reference.field,\r\n header: tableFields.reference.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: \"dueDateFilter\",\r\n header: tableFields.dueDate.label,\r\n filterHeaderStyle: { textAlign: \"right\" },\r\n style: { width: 210 },\r\n body: (rowData: any) => {\r\n const value = rowData[statementFields.dueDate];\r\n return renderDate(value);\r\n },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n\r\n sortable: true,\r\n },\r\n {\r\n field: tableFields.description.field,\r\n header: tableFields.description.label,\r\n filter: true,\r\n filterMatchMode: \"contains\",\r\n sortable: true,\r\n style: { width: 120 },\r\n },\r\n {\r\n field: tableFields.debit.field,\r\n header: tableFields.debit.label,\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const value = rowData[statementFields.debit];\r\n const currency = rowData?.currency?.fundingSymbol;\r\n return renderMoneyWithCurrencyCode(value, currency);\r\n },\r\n\r\n sortable: true,\r\n style: { width: 120, textAlign: \"right\" },\r\n },\r\n {\r\n field: tableFields.credit.field,\r\n header: tableFields.credit.label,\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const value = rowData[statementFields.credit];\r\n const currency = rowData?.currency?.fundingSymbol;\r\n return renderMoneyWithCurrencyCode(value, currency);\r\n },\r\n\r\n sortable: true,\r\n style: { width: 120, textAlign: \"right\" },\r\n },\r\n {\r\n field: tableFields.balance.field,\r\n header: tableFields.balance.label,\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n body: (rowData: any) => {\r\n const value = rowData[statementFields.balance];\r\n const currency = rowData?.currency?.fundingSymbol;\r\n return renderMoneyWithCurrencyCode(value, currency);\r\n },\r\n\r\n style: { width: 120, textAlign: \"right\" },\r\n },\r\n {\r\n field: \"Action\",\r\n header: \"Action\",\r\n body: (rowData: any) => {\r\n return null;\r\n },\r\n style: { width: \"80px\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilter = () => {\r\n tableRef.current?.reset();\r\n setTroggleSetDefaultFilter((i) => i + 1);\r\n setfilteredTableData(tableData);\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n const footerGroup = () => {\r\n const total =\r\n (filteredTableData || tableData)?.[(filteredTableData || tableData).length - 1]\r\n ?.balanceInCurrency || 0;\r\n\r\n const currency = tableData[0]?.currency?.fundingSymbol;\r\n if (total <= 0) {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n {\r\n if (filteredData) {\r\n setfilteredTableData(\r\n filteredData?.filter((i) => i.id !== balancesBroughtForwardItemId)\r\n );\r\n }\r\n }}\r\n scrollable={true}\r\n columns={columns}\r\n loading={loading}\r\n footerColumnGroup={footerGroup()}\r\n scrollHeight=\"calc(100vh - 380px)\"\r\n />\r\n
\r\n );\r\n};\r\n\r\nexport default CustomerStatementTable;\r\n","import * as React from \"react\";\r\nimport ActionButtons from \"./ActionButtons\";\r\nimport styles from \"./index.module.scss\";\r\nimport CustomerStatementTable from \"./CustomerStatementTable\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport {\r\n convertMambuErrorMessage,\r\n convertStrToDate,\r\n getLastMonthBeginDate,\r\n getLastMonthEndDate,\r\n toDateTimesNumber,\r\n YearMonthDropdownOptions,\r\n} from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport {\r\n GetLoadCustomerStatementTaskStatus,\r\n RunLoadCustomerStatementTask,\r\n} from \"@/services/factoring/customerStatement\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\n\r\ninterface ICustomerStatementProps {}\r\n\r\nconst someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n};\r\nlet retryAfter = 2000;\r\nlet currentTaskId: string;\r\ntype StatementDataType = (FactoringCustomerStatement.Data & {\r\n documentDateFilter: number;\r\n dueDateFilter: number;\r\n credit: number;\r\n})[];\r\n\r\nconst CustomerStatement: React.FunctionComponent = (props) => {\r\n const [activedFactoringLine, setActivedFactoringLine] = React.useState();\r\n const [activedCustomer, setActiveCustomer] = React.useState();\r\n const [monthOptions, setMonthOptions] = React.useState([]);\r\n const [selectedMonth, setSelecteMonth] = React.useState();\r\n\r\n const [choosenCurreny, setChoosenCurreny] = React.useState();\r\n const [currencyOptions, setCurrencyOptions] =\r\n React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >();\r\n\r\n const [currencyMapStatement, setCurrencyMapStatement] = React.useState<\r\n Map\r\n >(new Map());\r\n\r\n const [statement, setStatement] = React.useState([]);\r\n\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n React.useEffect(() => {\r\n const getLoadCustomerStatementTaskStatus = async (taskId: string, maxRetryAfter: number) => {\r\n // cancel before request after new task created\r\n if (currentTaskId !== taskId) {\r\n return;\r\n }\r\n const taskRes = await GetLoadCustomerStatementTaskStatus(taskId);\r\n const result = taskRes.result;\r\n\r\n // cancel before request after new task created, and discard before result\r\n if (currentTaskId !== taskId) {\r\n return;\r\n }\r\n if (result.taskStatus === 3) {\r\n setLoading(false);\r\n const sourceRes = result.data;\r\n if (sourceRes.success) {\r\n var res = sourceRes;\r\n\r\n const dataMap = new Map();\r\n const currencyCodeSet = new Set();\r\n\r\n res.result?.customerStatementPrintData?.forEach((i: any) => {\r\n const handleData = {\r\n ...i,\r\n documentDateFilter: toDateTimesNumber(i.documentDate as any),\r\n dueDateFilter: toDateTimesNumber(i.dueDate as any),\r\n creditInCurrency: Math.abs(i.creditInCurrency || 0),\r\n };\r\n if (dataMap.get(i.currency.currencyCode)) {\r\n dataMap.get(i.currency.currencyCode)?.push(handleData);\r\n } else {\r\n dataMap.set(i.currency.currencyCode, [handleData]);\r\n }\r\n currencyCodeSet.add(i.currency.currencyCode);\r\n });\r\n\r\n const newCurrencyOptions = Array.from(currencyCodeSet).map((i) => ({\r\n value: i,\r\n label: i,\r\n }));\r\n\r\n const defaultCurrencyCode = newCurrencyOptions?.[0]?.value;\r\n setChoosenCurreny(defaultCurrencyCode);\r\n setCurrencyOptions(\r\n Array.from(currencyCodeSet).map((i) => ({\r\n value: i,\r\n label: i,\r\n }))\r\n );\r\n\r\n setCurrencyMapStatement(dataMap);\r\n setStatement(dataMap.get(defaultCurrencyCode || \"\") || []);\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(sourceRes.error?.message));\r\n }\r\n } else if (result.taskStatus === 2) {\r\n // in process\r\n await new Promise((resolve) => {\r\n setTimeout(\r\n async () => {\r\n retryAfter *= 2;\r\n await getLoadCustomerStatementTaskStatus(taskId, maxRetryAfter);\r\n resolve(0);\r\n },\r\n retryAfter > maxRetryAfter ? maxRetryAfter : retryAfter\r\n );\r\n });\r\n } else {\r\n setLoading(false);\r\n }\r\n };\r\n\r\n const runLoadCustomerStatementTask = async (\r\n factoringLineId: string,\r\n data: FactoringCustomerStatement.CustomerParams\r\n ) => {\r\n setLoading(true);\r\n // reset retryAfter\r\n retryAfter = 2000;\r\n const res = await RunLoadCustomerStatementTask(factoringLineId, data);\r\n if (!someError(res, mountedRef)) {\r\n if (res?.result?.taskStatus === 1) {\r\n currentTaskId = res.result?.taskId;\r\n await getLoadCustomerStatementTaskStatus(res.result?.taskId, res.result?.retryAfter);\r\n }\r\n }\r\n };\r\n\r\n if (activedFactoringLine && activedCustomer && selectedMonth) {\r\n let newfromDate;\r\n let newtoDate;\r\n const dItem = monthOptions.find((f) => f.value === selectedMonth);\r\n if (dItem) {\r\n newfromDate = convertStrToDate(dItem.monthBeginDate);\r\n newtoDate = convertStrToDate(dItem.monthEndDate);\r\n } else {\r\n newfromDate = getLastMonthBeginDate();\r\n newtoDate = getLastMonthEndDate();\r\n }\r\n\r\n const [customerEncodedKey, branch] = activedCustomer?.split(\";\");\r\n const beginDate = selectedMonth ? newfromDate : getLastMonthBeginDate();\r\n const endDate = selectedMonth ? newtoDate : getLastMonthEndDate();\r\n\r\n runLoadCustomerStatementTask(activedFactoringLine, {\r\n customerEncodedKey,\r\n branch,\r\n beginDate,\r\n endDate,\r\n });\r\n }\r\n }, [activedFactoringLine, activedCustomer, selectedMonth, monthOptions]);\r\n\r\n const onCurrencyChange = (newCurrency: string) => {\r\n setChoosenCurreny(newCurrency);\r\n setStatement(currencyMapStatement.get(newCurrency || \"\") || []);\r\n };\r\n\r\n return (\r\n
\r\n

Customer Statement

\r\n
\r\n
\r\n \r\n\r\n {\r\n onCurrencyChange(e.value);\r\n }}\r\n placeholder=\"Currency\"\r\n style={{ maxWidth: \"140px\", marginBottom: \"12px\" }}\r\n />\r\n\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default CustomerStatement;\r\n","import * as React from \"react\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport { Button } from \"primereact/button\";\r\nimport { Dialog } from \"primereact/components/dialog/Dialog\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport UserDetail from \"./UserDetail\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport {\r\n changePassword,\r\n CreateUser,\r\n DeleteUserClaims,\r\n DeleteUserRoles,\r\n GetAdminRoleId,\r\n GetGBFSAdminRoleId,\r\n GetUserClaims,\r\n getUserDetail,\r\n GetUserRoleId,\r\n GetUserRoles,\r\n SearchUser,\r\n SetUserClaims,\r\n SetUserRoles,\r\n UpdateUser,\r\n} from \"@/services/IdentityApi\";\r\nimport {\r\n getCurrentUserCompany,\r\n getCurrentUserCompanyId,\r\n} from \"@/services/CacheService\";\r\nimport config from \"@/utils/config\";\r\nimport User from \"@/services/user\";\r\n\r\ninterface IUserDetailModalProps {\r\n setModalVisible: (arg: boolean) => void;\r\n modalVisible: boolean;\r\n userId: string;\r\n refreshPage: () => void;\r\n activeIndex: tabType;\r\n}\r\n\r\nexport enum UserClaimValue {\r\n company = \"company\",\r\n companyID = \"companyID\",\r\n}\r\n\r\nexport enum tabType {\r\n user = 0,\r\n admin = 1,\r\n gbfsAdmin = 2,\r\n}\r\n\r\n/**\r\n * if CompanyId / Company not change, don't set it (else you will saw a batch same Claims)\r\n * if CompanyId / Company not change, delete old first (if present), then add new Claims,\r\n *\r\n * @param userId\r\n * @param formValue\r\n * @param userClaimMap: Map\r\n */\r\nconst updateCompany = async (\r\n userId: string,\r\n formValue: any,\r\n userClaimMap: Map\r\n) => {\r\n let { companyId, company } = formValue;\r\n\r\n if (companyId !== userClaimMap?.get(UserClaimValue.companyID)?.claimValue) {\r\n if (userClaimMap?.get(UserClaimValue.companyID)?.claimValue) {\r\n await DeleteUserClaims({\r\n userId,\r\n claimId: userClaimMap?.get(UserClaimValue.companyID).claimId,\r\n });\r\n }\r\n await SetUserClaims({\r\n userId,\r\n claimType: \"companyID\",\r\n claimValue: companyId,\r\n });\r\n }\r\n\r\n if (company !== userClaimMap?.get(UserClaimValue.company)?.claimValue) {\r\n if (userClaimMap?.get(UserClaimValue.company)?.claimValue) {\r\n await DeleteUserClaims({\r\n userId,\r\n claimId: userClaimMap?.get(UserClaimValue.company).claimId,\r\n });\r\n }\r\n await SetUserClaims({\r\n userId,\r\n claimType: \"company\",\r\n claimValue: company,\r\n });\r\n }\r\n};\r\n\r\nconst setUserRole = async (\r\n userId: string,\r\n currentUserRoleIds: string[],\r\n activeIndex: tabType,\r\n {\r\n userRoleId,\r\n adminRoleId,\r\n gbfsAdminRoleId,\r\n }: {\r\n userRoleId: string;\r\n adminRoleId: string;\r\n gbfsAdminRoleId: string;\r\n }\r\n) => {\r\n if (\r\n activeIndex === tabType.user &&\r\n !currentUserRoleIds.includes(userRoleId)\r\n ) {\r\n await SetUserRoles({\r\n userId,\r\n roleId: userRoleId,\r\n });\r\n }\r\n if (\r\n activeIndex === tabType.admin &&\r\n !currentUserRoleIds.includes(adminRoleId)\r\n ) {\r\n await SetUserRoles({\r\n userId,\r\n roleId: adminRoleId,\r\n });\r\n }\r\n if (\r\n activeIndex === tabType.gbfsAdmin &&\r\n !currentUserRoleIds.includes(gbfsAdminRoleId)\r\n ) {\r\n await SetUserRoles({\r\n userId,\r\n roleId: gbfsAdminRoleId,\r\n });\r\n }\r\n};\r\n\r\nconst UserDetailModal = React.forwardRef(\r\n (props: IUserDetailModalProps, ref: any) => {\r\n const {\r\n modalVisible,\r\n setModalVisible,\r\n userId,\r\n refreshPage,\r\n activeIndex,\r\n } = props;\r\n\r\n const [userDetail, setUserDetail] = React.useState(null);\r\n\r\n const [adminRoleId, setAdminRoleId] = React.useState(\"\");\r\n const [gbfsAdminRoleId, setGbfsAdminRoleId] = React.useState(\"\");\r\n const [userRoleId, setUserRoleId] = React.useState(\"\");\r\n\r\n const [currentUserRoleIds, setCurrentUserRoleIds] = React.useState<\r\n string[]\r\n >([]);\r\n\r\n const [userClaimMap, setUserClaimMap] = React.useState<\r\n Map\r\n >();\r\n\r\n const modalRef = React.useRef(null);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.errorMessages) {\r\n res?.errorMessages.forEach((i: string) => {\r\n messageHelper.warn(i);\r\n });\r\n } else if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n React.useEffect(() => {\r\n const getUserDetailData = async (id: string) => {\r\n LoadingAnimation.show();\r\n const [userDetailRes, userRolesRes, userClaimsRes] = await Promise.all([\r\n getUserDetail(id),\r\n GetUserRoles(id),\r\n GetUserClaims(id),\r\n ]);\r\n\r\n LoadingAnimation.hide();\r\n if (\r\n !hasError(userDetailRes) &&\r\n !hasError(userRolesRes) &&\r\n !hasError(userClaimsRes)\r\n ) {\r\n const userClaims = (userClaimsRes.claims as any[])?.reduce(\r\n (result: Map, item) => {\r\n result.set(item.claimType, item);\r\n return result;\r\n },\r\n new Map()\r\n );\r\n\r\n setUserClaimMap(userClaims);\r\n\r\n setUserDetail({\r\n ...userDetailRes,\r\n isAdmin:\r\n userRolesRes.success &&\r\n userRolesRes?.roles.some(\r\n (i: any) => i.name === config.adminString\r\n ),\r\n company: userClaims.get(UserClaimValue.company)?.claimValue,\r\n companyId: userClaims.get(UserClaimValue.companyID)?.claimValue,\r\n });\r\n\r\n setCurrentUserRoleIds(userRolesRes?.roles.map((i: any) => i.id));\r\n }\r\n };\r\n\r\n const getAdminRoleId = async () => {\r\n const res = await GetAdminRoleId();\r\n if (!hasError(res) && res.totalCount > 0) {\r\n setAdminRoleId(res.roles[0]?.id);\r\n }\r\n };\r\n\r\n const getGbfsAdminRoleId = async () => {\r\n const res = await GetGBFSAdminRoleId();\r\n if (!hasError(res) && res.totalCount > 0) {\r\n setGbfsAdminRoleId(res.roles[0]?.id);\r\n }\r\n };\r\n\r\n const getUserRoleId = async () => {\r\n const res = await GetUserRoleId();\r\n if (!hasError(res) && res.totalCount > 0) {\r\n setUserRoleId(res.roles[0]?.id);\r\n }\r\n };\r\n\r\n if (userId) {\r\n getUserDetailData(userId);\r\n }\r\n getAdminRoleId();\r\n getGbfsAdminRoleId();\r\n getUserRoleId();\r\n }, [userId]);\r\n\r\n const submit = async () => {\r\n const getUserInfo = async (id: string) => {\r\n LoadingAnimation.show();\r\n const [userRolesRes, userClaimsRes] = await Promise.all([\r\n GetUserRoles(id),\r\n GetUserClaims(id),\r\n ]);\r\n\r\n LoadingAnimation.hide();\r\n if (!hasError(userRolesRes) && !hasError(userClaimsRes)) {\r\n const userClaims = (userClaimsRes.claims as any[])?.reduce(\r\n (result: Map, item) => {\r\n result.set(item.claimType, item);\r\n return result;\r\n },\r\n new Map()\r\n );\r\n\r\n return {\r\n claims: userClaims,\r\n roleIds: userRolesRes?.roles.map((i: any) => i.id),\r\n };\r\n }\r\n };\r\n\r\n const updateUser = async (\r\n userId: string,\r\n userInfo: { claims: Map; roleIds: any[] }\r\n ) => {\r\n LoadingAnimation.show();\r\n const res = await UpdateUser({\r\n ...formValue,\r\n id: userId,\r\n });\r\n LoadingAnimation.hide();\r\n\r\n if (!hasError(res)) {\r\n LoadingAnimation.show();\r\n /**\r\n * only gbfs admin can update company / companyId\r\n * gbfs admin set role by tab\r\n */\r\n if (User.isGBFSAdmin) {\r\n await updateCompany(userId, formValue, userInfo.claims);\r\n await setUserRole(userId, userInfo.roleIds, activeIndex, {\r\n userRoleId,\r\n adminRoleId,\r\n gbfsAdminRoleId,\r\n });\r\n } else {\r\n await setIsAdmin(formValue.isAdmin, userId);\r\n }\r\n LoadingAnimation.hide();\r\n messageHelper.success(Lang[\"update.user.success\"]);\r\n setModalVisible(false);\r\n refreshPage();\r\n }\r\n };\r\n\r\n const createUser = async () => {\r\n LoadingAnimation.show();\r\n const res = await CreateUser({\r\n ...formValue,\r\n id: undefined,\r\n });\r\n LoadingAnimation.hide();\r\n\r\n if (!hasError(res)) {\r\n LoadingAnimation.show();\r\n await setCompany(res.result, formValue);\r\n\r\n if (User.isGBFSAdmin) {\r\n await setUserRole(res.result, [], activeIndex, {\r\n userRoleId,\r\n adminRoleId,\r\n gbfsAdminRoleId,\r\n });\r\n } else {\r\n await setIsAdmin(formValue.isAdmin, res.result);\r\n }\r\n\r\n await setPassword(res.result, formValue.password);\r\n LoadingAnimation.hide();\r\n\r\n messageHelper.success(Lang[\"add.user.success\"]);\r\n setModalVisible(false);\r\n refreshPage();\r\n }\r\n };\r\n\r\n /**\r\n * If user already exists on IDserver, We update it\r\n * Else we create it\r\n */\r\n const validateUser = async () => {\r\n const userRes = await SearchUser(formValue.email);\r\n if (!hasError(userRes)) {\r\n const userId = userRes.users?.find((i: any) => {\r\n return i.email?.toLowerCase() === formValue.email?.toLowerCase();\r\n })?.id;\r\n\r\n if (userId) {\r\n const userInfo = await getUserInfo(userId);\r\n if (userInfo) {\r\n updateUser(userId, userInfo);\r\n }\r\n } else {\r\n createUser();\r\n }\r\n }\r\n };\r\n\r\n const formValue = await modalRef.current?.submit();\r\n if (formValue) {\r\n if (userDetail?.id && userClaimMap) {\r\n updateUser(userDetail?.id, {\r\n claims: userClaimMap,\r\n roleIds: currentUserRoleIds,\r\n });\r\n } else {\r\n validateUser();\r\n }\r\n }\r\n };\r\n\r\n const setCompany = async (userId: string, formValue: any) => {\r\n let { companyId, company } = formValue;\r\n\r\n if (!User.isGBFSAdmin) {\r\n companyId = getCurrentUserCompanyId();\r\n company = getCurrentUserCompany();\r\n }\r\n\r\n await SetUserClaims({\r\n userId,\r\n claimType: \"companyID\",\r\n claimValue: companyId,\r\n });\r\n await SetUserClaims({\r\n userId,\r\n claimType: \"company\",\r\n claimValue: company,\r\n });\r\n };\r\n\r\n const setIsAdmin = async (isAdmin: boolean, userId: string) => {\r\n if (isAdmin) {\r\n if (currentUserRoleIds.includes(userRoleId)) {\r\n await DeleteUserRoles({\r\n userId,\r\n roleId: userRoleId,\r\n });\r\n }\r\n\r\n if (!currentUserRoleIds.includes(adminRoleId)) {\r\n await SetUserRoles({\r\n userId,\r\n roleId: adminRoleId,\r\n });\r\n }\r\n } else {\r\n if (currentUserRoleIds.includes(adminRoleId)) {\r\n await DeleteUserRoles({\r\n userId,\r\n roleId: adminRoleId,\r\n });\r\n }\r\n\r\n if (!currentUserRoleIds.includes(userRoleId)) {\r\n await SetUserRoles({\r\n userId,\r\n roleId: userRoleId,\r\n });\r\n }\r\n }\r\n };\r\n\r\n const setPassword = async (userId: string, password: string) => {\r\n await changePassword({\r\n userId,\r\n password,\r\n confirmPassword: password,\r\n });\r\n };\r\n\r\n const footer = (\r\n \r\n {\r\n setModalVisible(false);\r\n }}\r\n />\r\n {\r\n submit();\r\n }}\r\n />\r\n \r\n );\r\n\r\n const isCreate = !(userDetail && userDetail.id);\r\n const title = isCreate ? \"Add User\" : \"Edit User\";\r\n return (\r\n {\r\n setModalVisible(false);\r\n }}\r\n >\r\n {userDetail && (\r\n \r\n )}\r\n {!userDetail && (\r\n \r\n )}\r\n \r\n );\r\n }\r\n);\r\n\r\nexport default UserDetailModal;\r\n","import * as React from \"react\";\r\nimport { getUserInfo } from \"@/services/userService\";\r\nimport { Skeleton } from \"primereact/skeleton\";\r\nimport styles from \"./index.module.scss\";\r\nimport { getCurrentUserRole } from \"@/services/CacheService\";\r\nimport User from \"@/services/user\";\r\n\r\nconst UserProfile: React.FunctionComponent = () => {\r\n const [detail, setDetail] = React.useState({});\r\n const [loading, setLoading] = React.useState(true);\r\n\r\n React.useEffect(() => {\r\n const getDetail = async () => {\r\n setLoading(true);\r\n const res = await getUserInfo();\r\n setLoading(false);\r\n if (res.email) {\r\n const roles = getCurrentUserRole();\r\n setDetail({\r\n ...res,\r\n roles: roles?.map((i) => i.name),\r\n });\r\n }\r\n };\r\n getDetail();\r\n }, []);\r\n\r\n if (loading) {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n
\r\n

Profile

\r\n \r\n
Email:
\r\n
{detail?.email}
\r\n
\r\n
\r\n
Role:
\r\n
{User.isAdmin ? \"Admin\" : \"User\"}
\r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default UserProfile;\r\n","import { useFormik } from \"formik\";\r\nimport { InputText } from \"primereact/inputtext\";\r\nimport * as React from \"react\";\r\nimport { InputTextarea } from \"primereact/inputtextarea\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Calendar } from \"primereact/calendar\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport { InputSwitch } from \"primereact/inputswitch\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport { UserObjct } from \"@/services/IdentityApi\";\r\nimport { getCurrentUserCompanyId } from \"@/services/CacheService\";\r\nimport User from \"@/services/user\";\r\n\r\nconst initialValues: UserObjct = {\r\n userName: \"\",\r\n email: \"\",\r\n emailConfirmed: false,\r\n phoneNumber: \"\",\r\n phoneNumberConfirmed: false,\r\n lockoutEnabled: false,\r\n twoFactorEnabled: false,\r\n accessFailedCount: 0,\r\n lockoutEnd: \"\",\r\n id: \"\",\r\n companyId: \"\",\r\n company: \"\",\r\n isAdmin: false,\r\n password: \"\",\r\n};\r\n\r\ntype fields =\r\n | \"userName\"\r\n | \"email\"\r\n | \"emailConfirmed\"\r\n | \"phoneNumber\"\r\n | \"phoneNumberConfirmed\"\r\n | \"lockoutEnabled\"\r\n | \"twoFactorEnabled\"\r\n | \"accessFailedCount\"\r\n | \"lockoutEnd\"\r\n | \"id\"\r\n | \"companyId\"\r\n | \"company\"\r\n | \"isAdmin\"\r\n | \"password\";\r\n\r\ntype inputType =\r\n | \"textarea\"\r\n | \"input\"\r\n | \"confirmed\"\r\n | \"number\"\r\n | \"date\"\r\n | undefined;\r\n\r\ninterface fieldType {\r\n field: fields;\r\n label: string;\r\n rules?: any[];\r\n type?: inputType;\r\n disabled?: boolean;\r\n canView?: boolean;\r\n}\r\n\r\nconst getUserFieldsArray = (isCreate: boolean, isGBFSAdmin: boolean) => {\r\n const baseUserFieldsArray: fieldType[] = [\r\n {\r\n field: \"userName\",\r\n label: \"Username\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n canView: true,\r\n },\r\n {\r\n field: \"email\",\r\n label: \"Email\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n canView: true,\r\n },\r\n {\r\n field: \"company\",\r\n label: \"Company\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n canView: isGBFSAdmin,\r\n },\r\n {\r\n field: \"companyId\",\r\n label: \"Company Id\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n canView: isGBFSAdmin,\r\n },\r\n {\r\n field: \"password\",\r\n label: \"Password\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n canView: isCreate,\r\n },\r\n {\r\n field: \"isAdmin\",\r\n label: \"Admin\",\r\n type: \"confirmed\",\r\n // gbfs admin set user role by active tab\r\n canView: !isGBFSAdmin,\r\n },\r\n ];\r\n\r\n return baseUserFieldsArray.filter((i) => i.canView);\r\n};\r\n\r\ninterface IUserDetailProps {\r\n initData: UserObjct;\r\n}\r\n\r\n// todo: add validate rule, must same with backend\r\nconst UserDetail = React.forwardRef((props: IUserDetailProps, ref: any) => {\r\n const { initData } = props;\r\n\r\n const formik = useFormik({\r\n initialValues: initData || initialValues,\r\n validate: (data) => {\r\n let errors: any = {};\r\n\r\n // if create, must validate password\r\n if (!initData?.id) {\r\n if (!data.password) {\r\n errors.password = Lang[\"password.required\"];\r\n } else {\r\n if (data.password.length < 6 || data.password.length > 100) {\r\n errors.password = Lang[\"password.length.limit\"];\r\n }\r\n if (!data.password.match(/[a-z]/)) {\r\n errors.password = Lang[\"password.required.[a-z]\"];\r\n }\r\n if (!data.password.match(/[A-Z]/)) {\r\n errors.password = Lang[\"password.required.[A-Z]\"];\r\n }\r\n if (!data.password.match(/[^a-zA-Z0-9]/)) {\r\n errors.password = Lang[\"password.required.non.alphanumeric\"];\r\n }\r\n }\r\n }\r\n\r\n if (!data.userName) {\r\n errors.userName = Lang[\"name.required\"];\r\n } else if (!/^[a-zA-Z0-9_@\\\\-\\\\.\\\\+]+$/.test(data.userName)) {\r\n errors.userName = `Username contain characters (letters or numbers) @ . _ - +, but cannot contain spaces.`;\r\n }\r\n\r\n if (!data.email) {\r\n errors.email = Lang[\"eamil.required\"];\r\n } else if (\r\n !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(data.email)\r\n ) {\r\n errors.email = Lang[\"invalid.email\"];\r\n }\r\n\r\n if (User.isGBFSAdmin) {\r\n if (!data.companyId) {\r\n errors.companyId = Lang[\"company.id.required\"];\r\n }\r\n if (!data.company) {\r\n errors.company = Lang[\"company.required\"];\r\n }\r\n }\r\n\r\n return errors;\r\n },\r\n onSubmit: (data) => {\r\n if (data) {\r\n return new Promise((res) => {\r\n res(data);\r\n });\r\n } else {\r\n return new Promise((res, rej) => {\r\n rej();\r\n });\r\n }\r\n },\r\n });\r\n\r\n const formikRef = React.useRef();\r\n\r\n React.useEffect(() => {\r\n formikRef.current = formik;\r\n }, [formik]);\r\n\r\n React.useEffect(() => {\r\n if (!initData?.id && !User.isGBFSAdmin) {\r\n formikRef.current.setFieldValue(\"companyId\", getCurrentUserCompanyId());\r\n }\r\n }, [initData]);\r\n\r\n const submit = async () => {\r\n const value = await formik.submitForm().catch((e) => console.log(e));\r\n if (value) {\r\n return value;\r\n }\r\n return false;\r\n };\r\n\r\n React.useImperativeHandle(ref, () => ({\r\n submit,\r\n }));\r\n\r\n const isFormFieldValid = (name: fields) =>\r\n !!(formik.touched[name] && formik.errors[name]);\r\n\r\n const getFormErrorMessage = (name: fields) => {\r\n return (\r\n isFormFieldValid(name) && (\r\n \r\n {formik.errors[name]}\r\n \r\n )\r\n );\r\n };\r\n\r\n const renderFormItems = (fields: fieldType[], options: any = {}) => {\r\n const renderItem = (type: inputType, field: fields, disabled?: boolean) => {\r\n switch (type) {\r\n case \"textarea\":\r\n return (\r\n \r\n );\r\n case \"confirmed\":\r\n return (\r\n \r\n );\r\n case \"number\":\r\n return (\r\n {\r\n formik.setFieldValue(field, e.value);\r\n }}\r\n className={`p-inputtext-lg p-d-block ${\r\n isFormFieldValid(field) ? \"p-invalid\" : \"\"\r\n }`}\r\n />\r\n );\r\n\r\n case \"date\":\r\n return (\r\n \r\n );\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n };\r\n\r\n return fields.map((i: fieldType) => {\r\n const { field, rules, type, label, disabled } = i;\r\n return (\r\n \r\n \r\n {label}\r\n {rules ? \"*\" : \"\"}\r\n {\": \"}\r\n \r\n
\r\n
{renderItem(type, field, disabled)}
\r\n \r\n {getFormErrorMessage(field)}\r\n
\r\n \r\n \r\n );\r\n });\r\n };\r\n\r\n return (\r\n
\r\n
\r\n {renderFormItems(getUserFieldsArray(!initData?.id, User.isGBFSAdmin))}\r\n
\r\n
\r\n );\r\n});\r\n\r\nexport default UserDetail;\r\n","import * as React from \"react\";\r\nimport clsx from \"clsx\";\r\nimport styles from \"../../factoring.module.scss\";\r\nimport { Button } from \"primereact/button\";\r\n\r\nimport { buildFacliSubTitleByExtra } from \"@/utils/common-contents\";\r\nimport {\r\n formatItemValueByFieldType,\r\n convertStrToDate,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport ViewReceivablesTransactions from \"../ViewReceivablesTransactions\";\r\nimport ViewReceivablesTags from \"../ViewReceivablesTags\";\r\nimport { renderExchangeContent } from \"../ReceiveableTable/receivables/receivable-utils\";\r\n\r\nenum FieldItemType {\r\n Customer,\r\n CreateDate,\r\n ScheduleNo,\r\n Branch,\r\n DocumentId,\r\n DocumentDate,\r\n DueDate,\r\n DocumentAmount,\r\n DueAmount,\r\n PurchaseWorkOrder,\r\n PaymentStatus,\r\n InvoiceStatus,\r\n CreditTerm,\r\n}\r\n\r\ninterface IViewEditReceivablesProps {\r\n viewItemSource: any;\r\n onClose: () => void;\r\n activedFactoringLineName: string;\r\n}\r\n\r\nconst ViewReceivables: React.FunctionComponent = (props) => {\r\n const { viewItemSource, onClose, activedFactoringLineName } = props;\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [receivableItemSource, setReceivableItemSource] = React.useState();\r\n\r\n const [loanAccountId, setLoanAccountId] = React.useState(\"\");\r\n const [tagsSource, setTagsSource] = React.useState();\r\n const [showTransactionsView, setShowTransactionsView] = React.useState(false);\r\n\r\n const subTitle = React.useMemo(() => {\r\n return buildFacliSubTitleByExtra(activedFactoringLineName) || \"\";\r\n }, [activedFactoringLineName]);\r\n\r\n React.useEffect(() => {\r\n const initFormData = () => {\r\n LoadingAnimation.show();\r\n setReceivableItemSource(viewItemSource);\r\n setTagsSource(viewItemSource.invoiceCustomTags);\r\n setIsInitCompleted(true);\r\n setLoanAccountId(viewItemSource.loanAccountEncodedKey);\r\n LoadingAnimation.hide();\r\n };\r\n initFormData();\r\n }, [viewItemSource]);\r\n\r\n const addPartialItemStyle = (itemType: FieldItemType) => {\r\n if (itemType === FieldItemType.DueAmount) {\r\n const isPartialApplied = checkIsPartiallyApplied();\r\n if (isPartialApplied) {\r\n return \"gbfs-number-s-dark-green\";\r\n }\r\n }\r\n if (itemType === FieldItemType.PaymentStatus) {\r\n const isOverDue = receivableItemSource.isOverDue;\r\n if (isOverDue) {\r\n return \"gbfs-number-s-dark-red\";\r\n }\r\n }\r\n return \"\";\r\n };\r\n const checkIsPartiallyApplied = () => {\r\n return receivableItemSource.isPartiallyPaid;\r\n };\r\n\r\n const renderItem = (\r\n label: string,\r\n value: any,\r\n dType: GBFSDataType,\r\n itemType: FieldItemType,\r\n keepZero: boolean = false,\r\n currency?: any,\r\n exchangeContent?: any\r\n ) => {\r\n let formatedValue: any;\r\n if (dType === GBFSDataType.Currency) {\r\n formatedValue = renderMoneyWithCurrencyCode(value, currency);\r\n } else {\r\n formatedValue = formatItemValueByFieldType(value, dType, keepZero);\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const renderDueAmountItem = (\r\n label: string,\r\n value: any,\r\n itemType: FieldItemType,\r\n currency: any,\r\n exchangeContent: any\r\n ) => {\r\n return (\r\n
\r\n \r\n
\r\n\r\n \r\n {\r\n setShowTransactionsView((i) => !i);\r\n }}\r\n tooltip={showTransactionsView ? \"Hide Transactions\" : \"View Transactions\"}\r\n tooltipOptions={{ position: \"top\", showDelay: 0 }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const renderPaymentStatusItem = (\r\n label: string,\r\n value: any,\r\n dType: GBFSDataType,\r\n itemType: FieldItemType\r\n ) => {\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const renderItems = () => {\r\n const fistColWith = 355;\r\n const secondColWith = 355;\r\n let branch = receivableItemSource.branch;\r\n if (!!receivableItemSource.branchName) {\r\n branch = `${branch} - ${receivableItemSource.branchName}`;\r\n }\r\n return (\r\n
\r\n {receivableItemSource && (\r\n
\r\n
Receivable Details
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Customer\",\r\n receivableItemSource.customer,\r\n GBFSDataType.Text,\r\n FieldItemType.Customer\r\n )}\r\n
\r\n
\r\n {renderItem(\"Branch\", branch, GBFSDataType.Text, FieldItemType.Branch)}\r\n
\r\n
\r\n {renderItem(\r\n \"Invoice ID\",\r\n receivableItemSource.documentId,\r\n GBFSDataType.Text,\r\n FieldItemType.DocumentId\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Created Date\",\r\n receivableItemSource.createdDate,\r\n GBFSDataType.Date,\r\n FieldItemType.CreateDate\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Purchase / Work Order\",\r\n receivableItemSource.purchaseWorkOrder,\r\n GBFSDataType.Text,\r\n FieldItemType.PurchaseWorkOrder\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Schedule No.\",\r\n receivableItemSource.scheduleNo,\r\n GBFSDataType.Text,\r\n FieldItemType.ScheduleNo\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Invoice Date\",\r\n convertStrToDate(receivableItemSource.documentDate),\r\n GBFSDataType.Date,\r\n FieldItemType.DocumentDate\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Due Date\",\r\n convertStrToDate(receivableItemSource.dueDate),\r\n GBFSDataType.Date,\r\n FieldItemType.DueDate\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Credit Term (Days)\",\r\n receivableItemSource.creditTerm,\r\n GBFSDataType.IntegerNumber,\r\n FieldItemType.CreditTerm\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Invoice Amount\",\r\n receivableItemSource.documentAmount,\r\n GBFSDataType.Currency,\r\n FieldItemType.DocumentAmount,\r\n false,\r\n receivableItemSource?.currency?.fundingSymbol,\r\n renderExchangeContent(\r\n receivableItemSource?.currency,\r\n receivableItemSource?.documentAmountForexReference,\r\n receivableItemSource.documentAmount\r\n )\r\n )}\r\n
\r\n
\r\n {renderDueAmountItem(\r\n \"Due Amount\",\r\n receivableItemSource.dueAmount,\r\n FieldItemType.DueAmount,\r\n receivableItemSource?.currency?.fundingSymbol,\r\n renderExchangeContent(\r\n receivableItemSource?.currency,\r\n receivableItemSource?.dueAmountForexReference,\r\n receivableItemSource.dueAmount\r\n )\r\n )}\r\n
\r\n
\r\n {renderPaymentStatusItem(\r\n \"Payment Status\",\r\n receivableItemSource.accountStateDisplay,\r\n GBFSDataType.Text,\r\n FieldItemType.PaymentStatus\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n )}\r\n
\r\n );\r\n };\r\n\r\n const renderInvoiceTags = () => {\r\n return (\r\n \r\n );\r\n };\r\n\r\n const renderInvoiceTransactions = () => {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n {isInitCompleted && (\r\n
\r\n \r\n
\r\n View Receivable\r\n
{subTitle}
\r\n
\r\n
\r\n
\r\n {renderItems()}\r\n {renderInvoiceTransactions()}\r\n
\r\n {renderInvoiceTags()}\r\n
\r\n
\r\n {\" \"}\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default ViewReceivables;\r\n","import { useFormik } from \"formik\";\r\nimport { InputText } from \"primereact/inputtext\";\r\nimport * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport { changePassword } from \"@/services/IdentityApi\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { Dialog } from \"primereact/components/dialog/Dialog\";\r\nimport { Button } from \"primereact/button\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\n\r\nconst initialValues: { password: string; confirmPassword: string } = {\r\n password: \"\",\r\n confirmPassword: \"\",\r\n};\r\n\r\ntype fields = \"confirmPassword\" | \"password\";\r\n\r\ntype inputType = \"textarea\" | \"input\" | \"confirmed\" | \"number\" | \"date\" | undefined;\r\n\r\ninterface fieldType {\r\n field: fields;\r\n label: string;\r\n rules?: any[];\r\n type?: inputType;\r\n disabled?: boolean;\r\n}\r\n\r\nconst fieldsArray: fieldType[] = [\r\n {\r\n field: \"password\",\r\n label: \"Password\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n },\r\n {\r\n field: \"confirmPassword\",\r\n label: \"Confirm Password*\",\r\n type: \"confirmed\",\r\n },\r\n];\r\n\r\ninterface IUserDetailProps {\r\n setModalVisible: (arg: boolean) => void;\r\n modalVisible: boolean;\r\n userId: string;\r\n}\r\n\r\n// todo: add validate rule, must same with backend\r\nconst UserDetail = React.forwardRef((props: IUserDetailProps, ref: any) => {\r\n const { modalVisible, setModalVisible, userId } = props;\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.errorMessages) {\r\n res?.errorMessages.forEach((i: string) => {\r\n messageHelper.warn(i);\r\n });\r\n } else if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const formik = useFormik({\r\n initialValues: initialValues,\r\n validate: (data) => {\r\n let errors: any = {};\r\n\r\n if (!data.password) {\r\n errors.password = Lang[\"password.required\"];\r\n } else {\r\n if (data.password.length < 6 || data.password.length > 100) {\r\n errors.password = Lang[\"password.length.limit\"];\r\n }\r\n if (!data.password.match(/[a-z]/)) {\r\n errors.password = Lang[\"password.required.[a-z]\"];\r\n }\r\n if (!data.password.match(/[A-Z]/)) {\r\n errors.password = Lang[\"password.required.[A-Z]\"];\r\n }\r\n if (!data.password.match(/[^a-zA-Z0-9]/)) {\r\n errors.password = Lang[\"password.required.non.alphanumeric\"];\r\n }\r\n }\r\n\r\n if (!data.confirmPassword) {\r\n errors.confirmPassword = Lang[\"confirm.password.required\"];\r\n } else if (data.confirmPassword !== data.password) {\r\n errors.confirmPassword = Lang[\"confirm.password.different.with.password\"];\r\n }\r\n\r\n return errors;\r\n },\r\n onSubmit: (data) => {\r\n if (data) {\r\n return new Promise((res) => {\r\n res(data);\r\n });\r\n } else {\r\n return new Promise((res, rej) => {\r\n rej();\r\n });\r\n }\r\n },\r\n });\r\n\r\n const submit = async () => {\r\n const value = await formik.submitForm().catch((e) => console.log(e));\r\n if (value) {\r\n LoadingAnimation.show();\r\n const res = await changePassword({\r\n userId,\r\n password: value.password,\r\n confirmPassword: value.password,\r\n });\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n messageHelper.success(Lang[\"change.password.success\"]);\r\n setModalVisible(false);\r\n } else {\r\n messageHelper.warn(Lang[\"change.password.failed\"]);\r\n }\r\n }\r\n };\r\n\r\n const isFormFieldValid = (name: fields) => !!(formik.touched[name] && formik.errors[name]);\r\n\r\n const getFormErrorMessage = (name: fields) => {\r\n return (\r\n isFormFieldValid(name) && (\r\n \r\n {formik.errors[name]}\r\n \r\n )\r\n );\r\n };\r\n\r\n const renderFormItems = (fields: fieldType[], options: any = {}) => {\r\n const renderItem = (type: inputType, field: fields, disabled?: boolean) => {\r\n return (\r\n \r\n );\r\n };\r\n\r\n return fields.map((i: fieldType) => {\r\n const { field, rules, type, label, disabled } = i;\r\n return (\r\n
\r\n \r\n
\r\n
{renderItem(type, field, disabled)}
\r\n
\r\n {getFormErrorMessage(field)}\r\n
\r\n
\r\n
\r\n );\r\n });\r\n };\r\n\r\n const footer = (\r\n \r\n {\r\n setModalVisible(false);\r\n }}\r\n />\r\n {\r\n submit();\r\n }}\r\n />\r\n \r\n );\r\n\r\n return (\r\n {\r\n setModalVisible(false);\r\n }}\r\n >\r\n
\r\n
\r\n {renderFormItems(fieldsArray)}\r\n
\r\n
\r\n \r\n );\r\n});\r\n\r\nexport default UserDetail;\r\n","import * as React from \"react\";\r\nimport styles from \"./index.module.scss\";\r\nimport {\r\n DeleteUser,\r\n DeleteUserClaims,\r\n DeleteUserRoles,\r\n GetAdminRoleId,\r\n GetGBFSAdminRoleId,\r\n GetUserClaims,\r\n GetUserRoleId,\r\n GetUserRoles,\r\n getUsers as getUsersService,\r\n getUsersByRoles,\r\n} from \"@/services/IdentityApi\";\r\nimport { Column } from \"primereact/column\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Button } from \"primereact/button\";\r\nimport { InputText } from \"primereact/inputtext\";\r\nimport UserDetailModal, {\r\n tabType,\r\n UserClaimValue,\r\n} from \"./UserDetailModal/index\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { confirmDialog } from \"primereact/confirmdialog\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { getCurrentUserCompanyId } from \"@/services/CacheService\";\r\nimport UpdatePassword from \"./UserDetailModal/UpdatePassword\";\r\nimport { TabMenu } from \"primereact/tabmenu\";\r\nimport User from \"@/services/user\";\r\nimport config from \"@/utils/config\";\r\n\r\nconst isMobile = matchMedia(\"(max-width: 40em)\").matches;\r\ninterface IUserManagementProps {}\r\n\r\nconst UserManagement: React.FunctionComponent = () => {\r\n const [users, setUsers] = React.useState([]);\r\n\r\n const [globalFilter, setGlobalFilter] = React.useState(\"\");\r\n const [modalVisible, setModalVisible] = React.useState(false);\r\n\r\n const [selectedUserId, setSelectedUserId] = React.useState(\"\");\r\n\r\n const [\r\n updatePasswordModalVisible,\r\n setUpdatePasswordModalVisible,\r\n ] = React.useState(false);\r\n\r\n const [activeIndex, setActiveIndex] = React.useState(tabType.user);\r\n const [rolesMap, setRolesMap] = React.useState>();\r\n\r\n const timer = React.useRef(null);\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.errorMessages) {\r\n res?.errorMessages.forEach((i: string) => {\r\n messageHelper.warn(i);\r\n });\r\n } else if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const getUsers = React.useCallback(\r\n async (searchText?: string) => {\r\n LoadingAnimation.show();\r\n\r\n let res;\r\n if (User.isGBFSAdmin) {\r\n const roleId = rolesMap?.get(activeIndex);\r\n if (!roleId) {\r\n return;\r\n }\r\n res = await getUsersByRoles(roleId, searchText);\r\n } else {\r\n const params = {\r\n searchText,\r\n claimValue: getCurrentUserCompanyId(),\r\n claimType: \"companyID\",\r\n };\r\n res = await getUsersService(params);\r\n }\r\n\r\n LoadingAnimation.hide();\r\n if (res.users) {\r\n setUsers(res.users);\r\n }\r\n },\r\n\r\n [activeIndex, rolesMap]\r\n );\r\n\r\n React.useEffect(() => {\r\n const getRolesId = async () => {\r\n const [adminRoleRes, userRoleRes, gbfsAdminRoleRes] = await Promise.all([\r\n GetAdminRoleId(),\r\n GetUserRoleId(),\r\n GetGBFSAdminRoleId(),\r\n ]).catch((e) => {\r\n messageHelper.warn(\"Get Roles Id Failed!\");\r\n return [];\r\n });\r\n\r\n let result = new Map();\r\n if (adminRoleRes?.roles?.length === 1) {\r\n result.set(tabType.admin, adminRoleRes.roles[0].id);\r\n }\r\n if (userRoleRes?.roles?.length === 1) {\r\n result.set(tabType.user, userRoleRes.roles[0].id);\r\n }\r\n if (gbfsAdminRoleRes?.roles?.length === 1) {\r\n result.set(tabType.gbfsAdmin, gbfsAdminRoleRes.roles[0].id);\r\n }\r\n setRolesMap(result);\r\n };\r\n\r\n if (!rolesMap) {\r\n getRolesId();\r\n }\r\n getUsers();\r\n }, [getUsers, rolesMap]);\r\n\r\n const getFilterdUser = (searchText: string) => {\r\n setGlobalFilter(searchText);\r\n\r\n if (timer.current) {\r\n clearTimeout(timer.current);\r\n }\r\n\r\n timer.current = setTimeout(() => {\r\n getUsers(searchText);\r\n }, 300);\r\n };\r\n const header = (\r\n
\r\n {\r\n setSelectedUserId(\"\");\r\n setModalVisible(true);\r\n }}\r\n />\r\n \r\n \r\n getFilterdUser(e.target.value)}\r\n placeholder=\"Global Search\"\r\n />\r\n \r\n
\r\n );\r\n\r\n const showUserDetailModal = (data: any) => {\r\n setModalVisible(true);\r\n setSelectedUserId(data.id);\r\n };\r\n\r\n const showUpdatePasswordModal = (data: any) => {\r\n setUpdatePasswordModalVisible(true);\r\n setSelectedUserId(data.id);\r\n };\r\n\r\n const openConfirmDialog = (data: any) => {\r\n /**\r\n * remove user roles,\r\n * if user without other role, we delete the user\r\n * @param userId\r\n */\r\n const removeUser = async (userId: string) => {\r\n if (!rolesMap) {\r\n // if roles map not set, we cannot do next step\r\n messageHelper.warn(\"Network error, please refresh and try again later\");\r\n return;\r\n }\r\n const removeUserRoles = async (userRoles: any) => {\r\n if (userRoles?.some((i: any) => i.id === rolesMap?.get(tabType.user))) {\r\n const roleId = rolesMap?.get(tabType.user);\r\n if (roleId) {\r\n const res = await DeleteUserRoles({\r\n userId,\r\n roleId,\r\n });\r\n hasError(res);\r\n }\r\n }\r\n if (\r\n userRoles?.some((i: any) => i.id === rolesMap?.get(tabType.admin))\r\n ) {\r\n const roleId = rolesMap?.get(tabType.admin);\r\n if (roleId) {\r\n const res = await DeleteUserRoles({\r\n userId,\r\n roleId,\r\n });\r\n hasError(res);\r\n }\r\n }\r\n if (\r\n userRoles?.some((i: any) => i.id === rolesMap?.get(tabType.gbfsAdmin))\r\n ) {\r\n const roleId = rolesMap?.get(tabType.gbfsAdmin);\r\n if (roleId) {\r\n const res = await DeleteUserRoles({\r\n userId,\r\n roleId,\r\n });\r\n hasError(res);\r\n }\r\n }\r\n };\r\n\r\n const removeUserClaims = async () => {\r\n let haveError = false;\r\n\r\n const userClaimsRes = await GetUserClaims(userId);\r\n if (!hasError(userClaimsRes)) {\r\n const userClaimMap = new Map();\r\n\r\n userClaimsRes.claims?.forEach((i: any) => {\r\n userClaimMap.set(i.claimType as UserClaimValue, i.claimId);\r\n });\r\n\r\n if (userClaimMap.get(UserClaimValue.company)) {\r\n const res = await DeleteUserClaims({\r\n userId,\r\n claimId: userClaimMap.get(UserClaimValue.company) as string,\r\n });\r\n if (hasError(res)) {\r\n haveError = true;\r\n }\r\n }\r\n\r\n if (userClaimMap.get(UserClaimValue.companyID)) {\r\n const res = await DeleteUserClaims({\r\n userId,\r\n claimId: userClaimMap.get(UserClaimValue.companyID) as string,\r\n });\r\n if (hasError(res)) {\r\n haveError = true;\r\n }\r\n }\r\n } else {\r\n haveError = true;\r\n }\r\n\r\n if (haveError) {\r\n messageHelper.warn(\r\n \"Delete user claims, please refresh and try again later\"\r\n );\r\n }\r\n };\r\n\r\n const removeUserRolesByActiveIndex = async () => {\r\n const activeIndex2String = {\r\n [tabType.user]: config.userString,\r\n [tabType.admin]: config.adminString,\r\n [tabType.gbfsAdmin]: config.gbfsAdminString,\r\n };\r\n\r\n const Roles2Delete = userRolesRes.roles.filter((i: any) => {\r\n return i.name === activeIndex2String[activeIndex];\r\n });\r\n\r\n const restRolesCount =\r\n userRolesRes.roles?.length - Roles2Delete?.length;\r\n\r\n if (restRolesCount > 0) {\r\n LoadingAnimation.show();\r\n await removeUserRoles(Roles2Delete);\r\n LoadingAnimation.hide();\r\n } else {\r\n LoadingAnimation.show();\r\n const res = await DeleteUser(userId);\r\n LoadingAnimation.hide();\r\n hasError(res);\r\n }\r\n };\r\n\r\n const userRolesRes = await GetUserRoles(userId);\r\n if (userRolesRes.success) {\r\n if (User.isGBFSAdmin) {\r\n await removeUserRolesByActiveIndex();\r\n } else {\r\n const restRoles = userRolesRes.roles?.filter((i: any) => {\r\n return (\r\n i.name !== config.adminString &&\r\n i.name !== config.userString &&\r\n i.id !== config.gbfsAdminString\r\n );\r\n });\r\n\r\n if (restRoles?.length > 0) {\r\n LoadingAnimation.show();\r\n await removeUserRoles(userRolesRes.roles);\r\n await removeUserClaims();\r\n LoadingAnimation.hide();\r\n } else {\r\n LoadingAnimation.show();\r\n const res = await DeleteUser(userId);\r\n LoadingAnimation.hide();\r\n hasError(res);\r\n }\r\n }\r\n\r\n refreshPage();\r\n }\r\n };\r\n\r\n if (data?.id) {\r\n confirmDialog({\r\n message: \"Do you want to delete this user?\",\r\n header: \"Delete Confirmation\",\r\n icon: \"pi pi-info-circle\",\r\n acceptClassName: \"p-button-danger\",\r\n accept: async () => {\r\n removeUser(data.id);\r\n },\r\n });\r\n }\r\n };\r\n\r\n const refreshPage = () => {\r\n getUsers(globalFilter);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n

User Management

\r\n {User.isGBFSAdmin && (\r\n setActiveIndex(e.index)}\r\n />\r\n )}\r\n \r\n {\r\n return (\r\n
\r\n Action\r\n {\r\n showUpdatePasswordModal(data);\r\n }}\r\n title=\"Update Password\"\r\n >\r\n\r\n {\r\n showUserDetailModal(data);\r\n }}\r\n title=\"Edit\"\r\n >\r\n {\r\n openConfirmDialog(data);\r\n }}\r\n >\r\n
\r\n );\r\n }}\r\n >\r\n {\r\n return (\r\n \r\n Name\r\n {rowData.userName}\r\n \r\n );\r\n }}\r\n >\r\n {\r\n return (\r\n \r\n Email\r\n {rowData.email}\r\n \r\n );\r\n }}\r\n >\r\n {\r\n return (\r\n \r\n Phone Number\r\n {rowData.phoneNumber}\r\n \r\n );\r\n }}\r\n >\r\n \r\n
\r\n {modalVisible && (\r\n \r\n )}\r\n\r\n {updatePasswordModalVisible && (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default UserManagement;\r\n","import * as React from \"react\";\r\nimport { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\nimport styles from \"../../..//factoring.module.scss\";\r\n\r\nimport clsx from \"clsx\";\r\nimport { Button } from \"primereact/button\";\r\nimport { Tooltip } from \"primereact/tooltip\";\r\nimport { OverlayPanel } from \"primereact/overlaypanel\";\r\nimport { LegacyRef } from \"react\";\r\nimport { gbfsContentWithNone } from \"@/utils/common-contents\";\r\nimport {\r\n toDateTimesNumber,\r\n toGBFSDateFormatStr,\r\n formatItemValueByFieldType,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport {\r\n ReceivableTypeEnums,\r\n GBFSDataType,\r\n InvoiceStatusEnums,\r\n} from \"@/utils/enums\";\r\nimport {\r\n tagIcon,\r\n pendingVerificationIcon,\r\n expiredIcon,\r\n currencyExchangeIcon,\r\n postdatedIcon,\r\n} from \"@/utils/consts/icon-consts\";\r\n\r\n////////////////////////////////body templates//////////////////////////////////////////////////\r\nexport const customerBodyTemplate = (rowData: any) => {\r\n const customer = `${rowData.customer}`;\r\n return
{customer}
;\r\n};\r\n\r\nexport const branchNameBodyTemplate = (rowData: any) => {\r\n const branchName = `${rowData.branchName || \"\"}`;\r\n return
{branchName}
;\r\n};\r\n\r\nexport const createdDateBodyTemplate = (rowData: any) => {\r\n rowData.createdDateFilter = toDateTimesNumber(rowData.createdDate);\r\n return toGBFSDateFormatStr(rowData.createdDate);\r\n};\r\n\r\nexport const documentDateBodyTemplate = (rowData: any) => {\r\n rowData.documentDateFilter = toDateTimesNumber(rowData.documentDate);\r\n return toGBFSDateFormatStr(rowData.documentDate);\r\n};\r\n\r\nexport const dueDateBodyTemplate = (rowData: any) => {\r\n rowData.dueDateFilter = toDateTimesNumber(rowData.dueDate);\r\n return toGBFSDateFormatStr(rowData.dueDate);\r\n};\r\n\r\nexport const documentAmountBodyTemplate = (rowData: any) => {\r\n // To Do: update field after Manbu deploy\r\n // UAT field name:documentAmount\r\n // Product field name:documentAmountForTablePresent\r\n const val =\r\n rowData.documentAmount || rowData.documentAmountForTablePresent || 0;\r\n const handledValue =\r\n rowData.receivableType === ReceivableTypeEnums.CN ? val * -1 : val;\r\n const forexInfo = rowData.documentAmountForexReference;\r\n\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n return (\r\n
\r\n {exchangeContent}\r\n {renderMoneyWithCurrencyCode(\r\n handledValue,\r\n rowData?.currency?.fundingSymbol\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport const dueAmountBodyTemplate = (rowData: any) => {\r\n // To Do: update field after Manbu deploy\r\n // UAT field name:documentAmount\r\n // Product field name:documentAmountForTablePresent\r\n const valDocumentAmount =\r\n rowData.documentAmount || rowData.documentAmountForTablePresent || 0;\r\n const val = rowData.dueAmount || 0;\r\n\r\n const handledValue =\r\n rowData.receivableType === ReceivableTypeEnums.CN ? val * -1 : val;\r\n\r\n const valRes = renderMoneyWithCurrencyCode(\r\n handledValue,\r\n rowData?.currency?.fundingSymbol\r\n );\r\n\r\n const forexInfo = rowData.dueAmountForexReference;\r\n\r\n const exchangeContent = (\r\n
\r\n {!rowData.currency.isBaseCurrency && val !== 0 && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n\r\n return (\r\n \r\n {exchangeContent}\r\n {valRes}\r\n \r\n );\r\n};\r\n\r\nexport const paymentStatusBodyTemplate = (rowData: any) => {\r\n if (rowData.isOverDue) {\r\n return
{rowData.accountStateDisplay}
\r\n }\r\n return rowData.accountStateDisplay;\r\n}\r\n\r\nexport const getSuitableTagToolTipWidth = (otherTags: any) => {\r\n let tooltipWith = 0;\r\n if (otherTags.length > 1) {\r\n let maxCharLength = 0;\r\n for (let t of otherTags) {\r\n const tLength = t.tag.length;\r\n if (tLength > maxCharLength) {\r\n maxCharLength = tLength;\r\n }\r\n }\r\n if (maxCharLength > 0) {\r\n const pxLength = maxCharLength * 7.5;\r\n tooltipWith = pxLength;\r\n }\r\n }\r\n return tooltipWith;\r\n};\r\n\r\nconst invoiceStatusDisplyArray = [InvoiceStatusEnums.PendingVerification, InvoiceStatusEnums.Others, InvoiceStatusEnums.PastFinancingPeriod, InvoiceStatusEnums.Postdated];\r\nexport const invoiceStatusBodyTemplate = (rowData: any) => {\r\n const invoiceTags = rowData.invoiceCustomTags?.filter((f: any) => f.isOpen);\r\n const isInvoiceClosed = rowData.accountState === 'CLOSED';\r\n const statusList = rowData.invoiceStatusList?.filter((f: InvoiceStatusEnums) => f !== InvoiceStatusEnums.Eligible); /* ignore the eligable status */\r\n const maxHolderCount = 3 - (statusList?.length || 0);\r\n let renderedHolderCount = 0;\r\n return (\r\n
\r\n {!isInvoiceClosed && ( /* show invoice status icon when not Paid */\r\n
\r\n {invoiceStatusDisplyArray.map((m: any, i: any) => {\r\n const e = statusList?.find((f: any) => f === m);\r\n if (e) {\r\n if (m === InvoiceStatusEnums.Others) {\r\n const otherTags = invoiceTags?.filter((f: any) => f.tagType === InvoiceStatusEnums.Others);\r\n const tooltipWith = getSuitableTagToolTipWidth(otherTags);\r\n const rowKey = rowData.loanAccountEncodedKey;\r\n return (\r\n
\r\n {otherTags.map((m: any, i: any) => {\r\n return 260 ? \"hide-arrow\" : \"\"}\r\n target={\".tag-icon\" + rowKey}\r\n position=\"bottom\"\r\n content={m.tag}\r\n style={{ width: tooltipWith > 0 ? tooltipWith.toString() + \"px\" : \"auto\", marginTop: i * 29 }} />\r\n })}\r\n \r\n
\r\n )\r\n } else {\r\n const tagItem = invoiceTags?.find((f: any) => f.tagType === e);\r\n let imgSrc = tagIcon;\r\n if (e === InvoiceStatusEnums.PendingVerification) {\r\n imgSrc = pendingVerificationIcon;\r\n } else if (e === InvoiceStatusEnums.PastFinancingPeriod) {\r\n imgSrc = expiredIcon;\r\n } else if (e === InvoiceStatusEnums.Postdated) {\r\n imgSrc = postdatedIcon;\r\n }\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n } else {\r\n /* show a empty palaceholder, just to take a position*/\r\n if (renderedHolderCount < maxHolderCount) {\r\n renderedHolderCount += 1;\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n return null\r\n\r\n }\r\n })}\r\n
)}\r\n
\r\n )\r\n}\r\nexport const tagOpenDateBodyTemplate = (rowData: any) => {\r\n rowData.tagOpenDateFilter = toDateTimesNumber(rowData.tagOpenDate);\r\n return toGBFSDateFormatStr(rowData.tagOpenDate);\r\n};\r\n\r\nexport const settingOverlayPanel = (\r\n viewCustomerBranchSettingSource: any,\r\n op: LegacyRef\r\n) => {\r\n const renderItem = (\r\n label: string,\r\n value: any,\r\n dType: GBFSDataType,\r\n noMargin?: boolean,\r\n keepZero?: boolean\r\n ) => {\r\n return (\r\n
\r\n \r\n {label}\r\n \r\n \r\n
\r\n );\r\n };\r\n const cbSetting = viewCustomerBranchSettingSource || {};\r\n return (\r\n \r\n
\r\n {renderItem(\"Customer\", cbSetting.customer, GBFSDataType.Text)}\r\n {renderItem(\r\n \"Customer Limit\",\r\n cbSetting.customerLimit,\r\n GBFSDataType.IntegerNumber\r\n )}\r\n {renderItem(\"Branch\", cbSetting.branch, GBFSDataType.Text)}\r\n {renderItem(\"BranchName\", cbSetting.branchName, GBFSDataType.Text)}\r\n {renderItem(\r\n \"Credit Term\",\r\n cbSetting.creditTermDays,\r\n GBFSDataType.IntegerNumber,\r\n false,\r\n true\r\n )}\r\n {renderItem(\r\n \"Financing Period (Days)\",\r\n cbSetting.financingPeriodDays,\r\n GBFSDataType.IntegerNumber,\r\n false,\r\n true\r\n )}\r\n {renderItem(\r\n \"Invoice Limit\",\r\n cbSetting.invoiceVerificationLimit,\r\n GBFSDataType.IntegerNumber,\r\n false,\r\n true\r\n )}\r\n {renderItem(\r\n \"Initial Payment (%)\",\r\n cbSetting.initialPaymentPercentage,\r\n GBFSDataType.DecimalNumber,\r\n false,\r\n true\r\n )}\r\n {renderItem(\r\n \"Factoring Charge (%)\",\r\n cbSetting.factoringChargePercentage,\r\n GBFSDataType.DecimalNumber,\r\n true,\r\n true\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const settingsViewBodyTemplate = (\r\n rowData: any,\r\n setViewCustomerBranchSettingSource: any,\r\n op: any\r\n) => {\r\n const customerBranchSetting = rowData.customerBranchSetting;\r\n return (\r\n \r\n {\r\n setViewCustomerBranchSettingSource(customerBranchSetting);\r\n op.current?.toggle(e, null);\r\n }}\r\n >\r\n \r\n );\r\n};\r\n\r\nexport const actionBodyTemplate = (\r\n rowData: any,\r\n setViewEditItemSource: any\r\n) => {\r\n return (\r\n {\r\n setViewEditItemSource(rowData);\r\n }}\r\n >\r\n );\r\n};\r\n\r\n////////////////////////////////body templates end//////////////////////////////////////////////////\r\n\r\nexport const footerGroup = (\r\n showBranchNameCol: boolean,\r\n showPwoCol: boolean,\r\n showCreditTermCol: boolean,\r\n receivablesFilteredSource: any[],\r\n showOpenDateCol: boolean\r\n) => {\r\n const getDocumentAmountTotalFooter = () => {\r\n return getDocumentAmountTotalFooterValue(receivablesFilteredSource);\r\n };\r\n\r\n const getDueAmountTotalFooter = () => {\r\n return getDueAmountTotalFooterValue(receivablesFilteredSource);\r\n };\r\n let prevColSpan = 11;\r\n if (showBranchNameCol) {\r\n prevColSpan += 1;\r\n }\r\n if (showPwoCol) {\r\n prevColSpan += 1;\r\n }\r\n if (showCreditTermCol) {\r\n prevColSpan += 1;\r\n }\r\n\r\n let nextColSpan = 4;\r\n if (showOpenDateCol) {\r\n nextColSpan = 5;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst getDocumentAmountTotalFooterValue = (\r\n receivablesFilteredSource: any[]\r\n) => {\r\n let total = 0;\r\n const invoicesSource = receivablesFilteredSource.filter(\r\n (f) => f.receivableType === ReceivableTypeEnums.IN\r\n );\r\n for (let s of invoicesSource) {\r\n // To Do: update field after Manbu deploy\r\n // UAT field name:documentAmount\r\n // Product field name:documentAmountForTablePresent\r\n total += s.documentAmount || s.documentAmountForTablePresent || 0;\r\n }\r\n const creditNotesSource = receivablesFilteredSource.filter(\r\n (f) => f.receivableType === ReceivableTypeEnums.CN\r\n );\r\n for (let s of creditNotesSource) {\r\n // To Do: update field after Manbu deploy\r\n // UAT field name:documentAmount\r\n // Product field name:documentAmountForTablePresent\r\n total -= s.documentAmount || s.documentAmountForTablePresent || 0;\r\n }\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n receivablesFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n};\r\n\r\nconst getDueAmountTotalFooterValue = (receivablesFilteredSource: any[]) => {\r\n let total = 0;\r\n const invoicesSource = receivablesFilteredSource.filter(\r\n (f) => f.receivableType === ReceivableTypeEnums.IN\r\n );\r\n for (let s of invoicesSource) {\r\n total += s.dueAmount || 0;\r\n }\r\n const creditNotesSource = receivablesFilteredSource.filter(\r\n (f) => f.receivableType === ReceivableTypeEnums.CN\r\n );\r\n for (let s of creditNotesSource) {\r\n total -= s.dueAmount || 0;\r\n }\r\n\r\n return renderMoneyWithCurrencyCode(\r\n total,\r\n receivablesFilteredSource[0]?.currency?.fundingSymbol\r\n );\r\n};\r\n","import React from \"react\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\nimport { FilterDropdownColumnType } from \"../ReceivableTable\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { InputNumber } from \"primereact/inputnumber\";\r\nimport { Checkbox } from \"primereact/checkbox\";\r\nimport clsx from \"clsx\";\r\nimport {\r\n getFilterMatchModel,\r\n} from \"@/utils/common-helper\";\r\n\r\nexport const onInvoiceStatusCustomFilter = (value: any[], filter: any[]) => {\r\n if (filter?.length > 0) {\r\n const hasVal = value?.filter((f) => filter.indexOf(f.tag) > -1).length > 0;\r\n return hasVal;\r\n }\r\n return false;\r\n};\r\n\r\nexport const renderCustomerFilter = (\r\n receivablesSourceRef: any,\r\n selFilterCustomers: any[],\r\n setSelFilterCustomers: React.Dispatch>,\r\n customerSource: any[],\r\n callback: Function\r\n) => {\r\n const onCustomerFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n callback(FilterDropdownColumnType.Customer);\r\n }\r\n receivablesSourceRef.current?.filter(event.value, \"customer\", \"in\");\r\n setSelFilterCustomers(event.value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const renderCreditTermFilter = (\r\n receivablesSourceRef: any,\r\n filterCreditTerm: any,\r\n selFilterCreditTermCondition: any,\r\n setSelFilterCreditTermCondition: React.Dispatch>,\r\n setFilterCreditTerm: React.Dispatch>,\r\n conditionFilterSelectors: any[]\r\n) => {\r\n const onCreditTermFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterCreditTerm, \"creditTerm\", receivablesSourceRef);\r\n setSelFilterCreditTermCondition(event.value);\r\n };\r\n\r\n const onCreditTermFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterCreditTermCondition, event.value, \"creditTerm\", receivablesSourceRef);\r\n setFilterCreditTerm(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const renderOverDueDaysFilter = (\r\n receivablesSourceRef: any,\r\n filterOverDueDays: any,\r\n selFilterOverDueDaysCondition: any,\r\n setSelFilterOverDueDaysCondition: React.Dispatch>,\r\n setFilterOverDueDays: React.Dispatch>,\r\n conditionFilterSelectors: any[]\r\n) => {\r\n const onOverDueDaysFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterOverDueDays, \"overDueDays\", receivablesSourceRef);\r\n setSelFilterOverDueDaysCondition(event.value);\r\n };\r\n\r\n const onOverDueDaysFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterOverDueDaysCondition, event.value, \"overDueDays\", receivablesSourceRef);\r\n setFilterOverDueDays(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const renderDocumentAmountFilter = (\r\n receivablesSourceRef: any,\r\n filterDocumentAmount: any,\r\n selFilterDocumentAmountCondition: any,\r\n setSelFilterDocumentAmountCondition: React.Dispatch>,\r\n setFilterDocumentAmount: React.Dispatch>,\r\n conditionFilterSelectors: any[]\r\n) => {\r\n const onDocumentAmountFilterChangeCondition = (event: any) => {\r\n doFilterNumber(\r\n event.value,\r\n filterDocumentAmount,\r\n \"documentAmountForTablePresent\",\r\n receivablesSourceRef\r\n );\r\n setSelFilterDocumentAmountCondition(event.value);\r\n };\r\n\r\n const onDocumentAmountFilterChangeValue = (event: any) => {\r\n doFilterNumber(\r\n selFilterDocumentAmountCondition,\r\n event.value,\r\n \"documentAmountForTablePresent\",\r\n receivablesSourceRef\r\n );\r\n setFilterDocumentAmount(event.value);\r\n };\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const renderDueAmountFilter = (\r\n receivablesSourceRef: any,\r\n filterDueAmount: any,\r\n selFilterDueAmountCondition: any,\r\n setSelFilterDueAmountCondition: React.Dispatch>,\r\n setFilterDueAmount: React.Dispatch>,\r\n conditionFilterSelectors: any[]\r\n) => {\r\n const onDueAmountFilterChangeCondition = (event: any) => {\r\n doFilterNumber(event.value, filterDueAmount, \"dueAmount\", receivablesSourceRef);\r\n setSelFilterDueAmountCondition(event.value);\r\n };\r\n\r\n const onDueAmountFilterChangeValue = (event: any) => {\r\n doFilterNumber(selFilterDueAmountCondition, event.value, \"dueAmount\", receivablesSourceRef);\r\n setFilterDueAmount(event.value);\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nconst doFilterNumber = (\r\n condition: string,\r\n filterNumber: number | undefined,\r\n field: string,\r\n receivablesSourceRef: any\r\n) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber !== undefined) {\r\n var fm = getFilterMatchModel(condition);\r\n receivablesSourceRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n receivablesSourceRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n};\r\n\r\nexport const renderBranchFilter = (\r\n receivablesSourceRef: any,\r\n selFilterBranch: any[],\r\n setSelFilterBranch: React.Dispatch>,\r\n branchsSource: any[],\r\n callback: Function\r\n) => {\r\n const onBranchFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n callback(FilterDropdownColumnType.Branch);\r\n }\r\n receivablesSourceRef.current?.filter(event.value, \"branch\", \"in\");\r\n setSelFilterBranch(event.value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const renderTypeFilter = (\r\n receivablesSourceRef: any,\r\n selFilterType: any[],\r\n setSelFilterType: React.Dispatch>,\r\n typesSource: any[],\r\n callback: Function\r\n) => {\r\n const onTypeFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n callback(FilterDropdownColumnType.ReceivableType);\r\n }\r\n receivablesSourceRef.current?.filter(event.value, \"receivableTypeDisplay\", \"in\");\r\n setSelFilterType(event.value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const renderStatusFilter = (\r\n receivablesSourceRef: any,\r\n selFilterStatus: any[],\r\n setSelFilterStatus: React.Dispatch>,\r\n statusSource: any[],\r\n callback: Function\r\n) => {\r\n const onStatusFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n callback(FilterDropdownColumnType.PaymentStatus);\r\n }\r\n receivablesSourceRef.current?.filter(event.value, \"accountStateDisplay\", \"in\");\r\n setSelFilterStatus(event.value);\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const renderInvoiceStatusFilter = (\r\n receivablesSourceRef: any,\r\n selFilterInvoiceStatus: any[],\r\n setSelFilterInvoiceStatus: React.Dispatch>,\r\n invoiceStatusSource: any[],\r\n callback: Function\r\n) => {\r\n const onInvoiceStatusFilterChange = (event: any) => {\r\n if (event.value.length > 0) {\r\n callback(FilterDropdownColumnType.InvoicesStatus);\r\n }\r\n receivablesSourceRef.current?.filter(event.value, \"invoiceFilterTags\", \"custom\");\r\n setSelFilterInvoiceStatus(event.value);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const renderBulkReassignReverseCheckboxFilter = (\r\n receivablesFilteredSource: any[],\r\n bulkCheckedItems: any[],\r\n setBulkCheckedItems: React.Dispatch>\r\n) => {\r\n return renderCommonBulkCheckboxFilter(\r\n receivablesFilteredSource,\r\n bulkCheckedItems,\r\n setBulkCheckedItems\r\n );\r\n};\r\n\r\nconst renderCommonBulkCheckboxFilter = (\r\n receivablesFilteredSource: any[],\r\n bulkCheckedItems: any[],\r\n setBulkCheckedItems: React.Dispatch>\r\n) => {\r\n const currentBulkableSource = receivablesFilteredSource;\r\n const getBulkItemCheckedAllStatus = () => {\r\n const isAllChecked =\r\n bulkCheckedItems.length > 0 && bulkCheckedItems.length === currentBulkableSource.length;\r\n return isAllChecked;\r\n };\r\n const setBulkCheckedAllStatus = (checked: boolean) => {\r\n if (checked) {\r\n const items = [];\r\n for (let s of currentBulkableSource) {\r\n const checkedItem = {\r\n encodedKey: s.loanAccountEncodedKey,\r\n type: s.receivableType,\r\n };\r\n items.push(checkedItem);\r\n }\r\n\r\n setBulkCheckedItems(items);\r\n } else {\r\n setBulkCheckedItems([]);\r\n }\r\n };\r\n const getCheckboxDisabled = () => {\r\n const isResultShow =\r\n currentBulkableSource.filter((f) => f.success !== null && f.success !== undefined).length > 0;\r\n return isResultShow;\r\n };\r\n return (\r\n
\r\n {\r\n setBulkCheckedAllStatus(e.checked);\r\n }}\r\n checked={getBulkItemCheckedAllStatus()}\r\n >\r\n
\r\n );\r\n};\r\n\r\nexport const renderBulkEditTagCheckboxFilter = (\r\n receivablesFilteredSource: any[],\r\n bulkCheckedItems: any[],\r\n setBulkCheckedItems: React.Dispatch>,\r\n setReceivablesFilteredSource: React.Dispatch>,\r\n showingBulkResult: boolean\r\n) => {\r\n const currentBulkableSource = receivablesFilteredSource;\r\n let tagGroup: any;\r\n if (bulkCheckedItems?.length > 0) {\r\n tagGroup = bulkCheckedItems[0].tag;\r\n }\r\n const getBulkItemCheckedAllStatus = () => {\r\n const isAllChecked =\r\n bulkCheckedItems.length > 0 &&\r\n bulkCheckedItems.length ===\r\n currentBulkableSource.filter((f) =>\r\n (f.invoiceCustomTags as any[])?.find(\r\n (f) => f.tag === tagGroup?.tag && f.tagStatus === tagGroup?.tagStatus\r\n )\r\n ).length;\r\n return isAllChecked;\r\n };\r\n const setBulkCheckedAllStatus = (checked: boolean) => {\r\n if (checked) {\r\n const items = [];\r\n const tagGroupSource = currentBulkableSource.filter((f) =>\r\n (f.invoiceCustomTags as any[])?.find(\r\n (f) => f.tag === tagGroup?.tag && f.tagStatus === tagGroup?.tagStatus\r\n )\r\n );\r\n for (let s of tagGroupSource) {\r\n const tag = (s.invoiceCustomTags as any[])?.find(\r\n (f) => f.tag === tagGroup?.tag && f.tagStatus === tagGroup?.tagStatus\r\n );\r\n const checkedItem = {\r\n encodedKey: s.loanAccountEncodedKey,\r\n type: s.receivableType,\r\n tag: tag,\r\n };\r\n items.push(checkedItem);\r\n }\r\n setBulkCheckedItems(items);\r\n } else {\r\n setBulkCheckedItems([]);\r\n setReceivablesFilteredSource((pre) => {\r\n for (let p of pre) {\r\n const sTags = p.invoiceCustomTags;\r\n if (sTags) {\r\n for (let t of sTags) {\r\n t.disabled = false;\r\n }\r\n }\r\n }\r\n return [...pre];\r\n });\r\n }\r\n };\r\n const getCheckboxDisabled = () => {\r\n return showingBulkResult || bulkCheckedItems?.length === 0;\r\n };\r\n\r\n return (\r\n
\r\n {\r\n setBulkCheckedAllStatus(e.checked);\r\n }}\r\n checked={getBulkItemCheckedAllStatus()}\r\n >\r\n
\r\n );\r\n};\r\n\r\nexport const renderBulkAddTagCheckboxFilter = (\r\n receivablesFilteredSource: any[],\r\n bulkCheckedItems: any[],\r\n setBulkCheckedItems: React.Dispatch>\r\n) => {\r\n return renderCommonBulkCheckboxFilter(\r\n receivablesFilteredSource,\r\n bulkCheckedItems,\r\n setBulkCheckedItems\r\n );\r\n};\r\n\r\nexport const renderClearFilter = (\r\n receivablesSourceRef: any,\r\n setReceivablesFilteredSource: React.Dispatch>,\r\n setSelFilterCustomers: React.Dispatch>,\r\n setFilterCreditTerm: React.Dispatch>,\r\n setFilterDocumentAmount: React.Dispatch>,\r\n setFilterDueAmount: React.Dispatch>,\r\n setSelFilterStatus: React.Dispatch>,\r\n setSelFilterInvoiceStatus: React.Dispatch>,\r\n setSelFilterType: React.Dispatch>,\r\n setSelFilterBranch: React.Dispatch>,\r\n setDropdownSource: Function,\r\n currentFilterDropdownColumnTypeCallback: Function\r\n) => {\r\n const handleClearFilters = () => {\r\n clearFilters(\r\n receivablesSourceRef,\r\n setReceivablesFilteredSource,\r\n setSelFilterCustomers,\r\n setFilterCreditTerm,\r\n setFilterDocumentAmount,\r\n setFilterDueAmount,\r\n setSelFilterStatus,\r\n setSelFilterInvoiceStatus,\r\n setSelFilterType,\r\n setSelFilterBranch,\r\n setDropdownSource,\r\n currentFilterDropdownColumnTypeCallback\r\n );\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const clearFilters = (\r\n receivablesSourceRef: any,\r\n setReceivablesFilteredSource: React.Dispatch>,\r\n setSelFilterCustomers: React.Dispatch>,\r\n setFilterCreditTerm: React.Dispatch>,\r\n setFilterDocumentAmount: React.Dispatch>,\r\n setFilterDueAmount: React.Dispatch>,\r\n setSelFilterStatus: React.Dispatch>,\r\n setSelFilterInvoiceStatus: React.Dispatch>,\r\n setSelFilterType: React.Dispatch>,\r\n setSelFilterBranch: React.Dispatch>,\r\n setDropdownSource: Function,\r\n currentFilterDropdownColumnTypeCallback: Function\r\n) => {\r\n setSelFilterCustomers(undefined);\r\n setFilterCreditTerm(undefined);\r\n setFilterDocumentAmount(undefined);\r\n setFilterDueAmount(undefined);\r\n setSelFilterStatus(undefined);\r\n\r\n setSelFilterInvoiceStatus(undefined);\r\n setSelFilterType(undefined);\r\n setSelFilterBranch(undefined);\r\n currentFilterDropdownColumnTypeCallback(undefined);\r\n const calCreatedDateFilterInput = document.getElementById(\r\n \"calCreatedDateFilter\"\r\n ) as HTMLInputElement;\r\n if (calCreatedDateFilterInput) {\r\n calCreatedDateFilterInput.value = \"\";\r\n }\r\n const calDocumentDateFilterInput = document.getElementById(\r\n \"calDocumentDateFilter\"\r\n ) as HTMLInputElement;\r\n if (calDocumentDateFilterInput) {\r\n calDocumentDateFilterInput.value = \"\";\r\n }\r\n const calDueDateFilterInput = document.getElementById(\"calDueDateFilter\") as HTMLInputElement;\r\n if (calDueDateFilterInput) {\r\n calDueDateFilterInput.value = \"\";\r\n }\r\n const calTagOpenDateFilterInput = document.getElementById(\r\n \"calTagOpenDateFilter\"\r\n ) as HTMLInputElement;\r\n if (calTagOpenDateFilterInput) {\r\n calTagOpenDateFilterInput.value = \"\";\r\n }\r\n\r\n receivablesSourceRef.current?.reset();\r\n const source = receivablesSourceRef.current?.props.value || [];\r\n setReceivablesFilteredSource(source);\r\n setDropdownSource(source);\r\n};\r\n","import clsx from \"clsx\";\r\nimport React from \"react\";\r\nimport { Button } from \"primereact/button\";\r\n\r\n\r\nexport const branchHeader = (showBranchNameCol: boolean, setShowBranchNameCol: React.Dispatch>) => {\r\n return (\r\n Branch\r\n
\r\n \r\n
\r\n
)\r\n}\r\n\r\nexport const scheduleNoHeader = (showPwoCol: boolean, setShowPwoCol: React.Dispatch>) => {\r\n return (\r\n Schedule No.\r\n
\r\n \r\n
\r\n
)\r\n}\r\n\r\nexport const documentDateHeader = (showCreditTermCol: boolean, setShowCreditTermCol: React.Dispatch>) => {\r\n return (\r\n Document Date\r\n
\r\n \r\n
\r\n
)\r\n}\r\n\r\nexport const invoiceStatusHeader = (showOpenDateCol: boolean, setShowOpenDateCol: React.Dispatch>) => {\r\n return (\r\n Invoice Status\r\n
\r\n \r\n
\r\n
)\r\n}","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport {\r\n convertMambuErrorMessage,\r\n formatItemValueByFieldType,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { getInvoiceRepaymentTransactions } from \"@/services/factoring\";\r\nimport { renderExchangeContentForDetailTable } from \"@/page/Factoring/utils\";\r\ninterface IViewReceivablesTransactionsProps {\r\n loanAccountEncodedKey: string;\r\n}\r\n\r\nconst ViewReceivablesTransactions: React.FunctionComponent<\r\n IViewReceivablesTransactionsProps\r\n> = (props) => {\r\n const { loanAccountEncodedKey } = props;\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [transactionSource, setTransactionSource] = React.useState([]);\r\n const transactionSourceRef = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n const loadSource = async () => {\r\n LoadingAnimation.show();\r\n const res = await getInvoiceRepaymentTransactions(loanAccountEncodedKey);\r\n if (res.success) {\r\n const source = res.result;\r\n if (source) {\r\n setTransactionSource(source);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n setIsInitCompleted(true);\r\n LoadingAnimation.hide();\r\n };\r\n loadSource();\r\n }, [loanAccountEncodedKey]);\r\n\r\n const renderTransactions = () => {\r\n const valueDateBodyTemplate = (rowData: any) => {\r\n return formatItemValueByFieldType(rowData.valueDate, GBFSDataType.Date);\r\n };\r\n const transactionTypeBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n {`${rowData.transactionType} ${rowData.transactionReferenceTypeDesc}`}\r\n
\r\n );\r\n };\r\n const referenceBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n {rowData.reference || \"\"}\r\n
\r\n );\r\n };\r\n const amountBodyTemplate = (rowData: any) => {\r\n const val = rowData.amount || 0;\r\n return (\r\n
\r\n {renderExchangeContentForDetailTable(rowData?.currency, rowData?.amountInCurrency)}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n };\r\n const dueAmountBodyTemplate = (rowData: any) => {\r\n const val = rowData.dueAmount || 0;\r\n return (\r\n
\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n return
{isInitCompleted && renderTransactions()}
;\r\n};\r\n\r\nexport default ViewReceivablesTransactions;\r\n","import * as React from \"react\";\r\nimport clsx from \"clsx\";\r\nimport { Button } from \"primereact/button\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport { guid, toGBFSDateFormatStr } from \"@/utils/common-helper\";\r\nimport {\r\n pendingVerificationIcon,\r\n expiredIcon,\r\n tagIcon,\r\n postdatedIcon,\r\n} from \"@/utils/consts/icon-consts\";\r\nimport { InvoiceStatusEnums } from \"@/utils/enums\";\r\n\r\ninterface IFactoringLineViewEditReceivablesTagsProps {\r\n viewItemTagsSource: any;\r\n paymentStatus: string;\r\n}\r\n\r\nconst invoiceTagCellItem = {\r\n value: null,\r\n oldValue: null,\r\n required: true,\r\n showRequired: false,\r\n};\r\nconst emptyInvoiceTagItem = {\r\n key: guid(),\r\n tag: { ...invoiceTagCellItem },\r\n tagStatus: { ...invoiceTagCellItem },\r\n tagRemarks: { ...invoiceTagCellItem, required: false },\r\n tagType: null,\r\n isOpen: null,\r\n openDate: null,\r\n resolvedDate: null,\r\n patchPathIndex: 0,\r\n isNew: true,\r\n success: null,\r\n enterResult: null,\r\n};\r\n\r\nconst ViewReceivablesTags: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { viewItemTagsSource } = props;\r\n const [receivableTagsSource, setReceivableTagsSource] = React.useState(\r\n []\r\n );\r\n\r\n React.useEffect(() => {\r\n const buildInvoiceTagsSource = () => {\r\n const tags = viewItemTagsSource || [];\r\n setReceivableTagsSource(\r\n tags.map((t: any) => {\r\n return {\r\n ...emptyInvoiceTagItem,\r\n tag: { ...invoiceTagCellItem, value: t.tag },\r\n tagStatus: { ...invoiceTagCellItem, value: t.tagStatus },\r\n tagRemarks: {\r\n ...invoiceTagCellItem,\r\n required: false,\r\n value: t.tagRemarks,\r\n },\r\n tagType: t.tagType,\r\n isOpen: t.isOpen,\r\n openDate: t.openDate,\r\n resolvedDate: t.resolvedDate,\r\n patchPathIndex: t.patchPathIndex,\r\n inEdit: false,\r\n isNew: false,\r\n };\r\n })\r\n );\r\n };\r\n\r\n buildInvoiceTagsSource();\r\n }, [viewItemTagsSource]);\r\n\r\n const invoiceTagBodyTemplate = (rowData: any) => {\r\n const getTagIconByType = (tagType: any) => {\r\n if (tagType === InvoiceStatusEnums.PendingVerification) {\r\n return pendingVerificationIcon;\r\n } else if (tagType === InvoiceStatusEnums.PastFinancingPeriod) {\r\n return expiredIcon;\r\n } else if (tagType === InvoiceStatusEnums.Postdated) {\r\n return postdatedIcon;\r\n } else {\r\n return tagIcon;\r\n }\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const invoiceTagStatusBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n
{rowData.tagStatus.value}
\r\n
\r\n );\r\n };\r\n\r\n const invoiceTagStatusOpenDateBodyTemplate = (rowData: any) => {\r\n return
{toGBFSDateFormatStr(rowData.openDate)}
;\r\n };\r\n\r\n const invoiceTagStatusResolvedDateBodyTemplate = (rowData: any) => {\r\n return
{toGBFSDateFormatStr(rowData.resolvedDate)}
;\r\n };\r\n\r\n const invoiceTagRemarksBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n
{rowData.tagRemarks.value}
\r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ViewReceivablesTags;\r\n","import * as React from \"react\";\r\nimport clsx from \"clsx\";\r\nimport styles from \"../..//factoring.module.scss\";\r\nimport { Button } from \"primereact/button\";\r\nimport {\r\n formatItemValueByFieldType,\r\n convertStrToDate,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport ViewCreditNoteTransactions from \"../ViewCreditNoteTransactions\";\r\nimport { buildFacliSubTitleByExtra } from \"@/utils/common-contents\";\r\nimport { renderExchangeContent } from \"../ReceiveableTable/receivables/receivable-utils\";\r\n\r\ninterface IFactoringLineViewEditCreditNotesProps {\r\n viewItemSource: any;\r\n onClose: () => void;\r\n activedFactoringLineName: string;\r\n}\r\n\r\nenum FieldItemType {\r\n Customer,\r\n CreateDate,\r\n ScheduleNo,\r\n Branch,\r\n BranchName,\r\n DocumentId,\r\n DocumentDate,\r\n DocumentAmount,\r\n DueAmount,\r\n PaymentStatus,\r\n}\r\n\r\nconst ViewCreditNotes: React.FunctionComponent = (\r\n props\r\n) => {\r\n const { viewItemSource, onClose, activedFactoringLineName } = props;\r\n const [showTransactionsView, setShowTransactionsView] = React.useState(false);\r\n\r\n const subTitle = React.useMemo(() => {\r\n return buildFacliSubTitleByExtra(activedFactoringLineName) || \"\";\r\n }, [activedFactoringLineName]);\r\n\r\n const addPartialItemStyle = (itemType: FieldItemType) => {\r\n if (itemType === FieldItemType.DueAmount) {\r\n const isPartialApplied = viewItemSource.isPartiallyPaid;\r\n if (isPartialApplied) {\r\n return \"gbfs-number-s-dark-green\";\r\n }\r\n }\r\n if (itemType === FieldItemType.PaymentStatus) {\r\n const isOverDue = viewItemSource.isOverDue;\r\n if (isOverDue) {\r\n return \"gbfs-number-s-dark-red\";\r\n }\r\n }\r\n return \"\";\r\n };\r\n\r\n const renderItem = (\r\n label: string,\r\n value: any,\r\n dType: GBFSDataType,\r\n itemType: FieldItemType,\r\n currency?: any,\r\n exchangeContent?: any\r\n ) => {\r\n let formatedValue: any;\r\n if (dType === GBFSDataType.Currency) {\r\n formatedValue = renderMoneyWithCurrencyCode(value, currency);\r\n } else {\r\n formatedValue = formatItemValueByFieldType(value, dType);\r\n }\r\n return (\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const renderStatusItem = (\r\n label: string,\r\n value: any,\r\n dType: GBFSDataType,\r\n itemType: FieldItemType\r\n ) => {\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n const renderAmountItem = (\r\n label: string,\r\n value: any,\r\n itemType: FieldItemType,\r\n currency?: any,\r\n exchangeContent?: any\r\n ) => {\r\n return (\r\n
\r\n \r\n
\r\n\r\n
\r\n {\r\n setShowTransactionsView((i) => !i);\r\n }}\r\n tooltip={showTransactionsView ? \"Hide Transactions\" : \"View Transactions\"}\r\n tooltipOptions={{ position: \"top\", showDelay: 0 }}\r\n >\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const renderItems = () => {\r\n const fistColWith = 355;\r\n const secondColWith = 355;\r\n const branchName = viewItemSource.branchName;\r\n const branchValue = viewItemSource.branch + (branchName ? ` - ${branchName}` : \"\");\r\n return (\r\n
\r\n {viewItemSource && (\r\n
\r\n
Credit Note Details
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Customer\",\r\n viewItemSource.customer,\r\n GBFSDataType.Text,\r\n FieldItemType.Customer\r\n )}\r\n
\r\n
\r\n {renderItem(\"Branch\", branchValue, GBFSDataType.Text, FieldItemType.Branch)}\r\n
\r\n
\r\n {renderItem(\r\n \"Credit Note ID\",\r\n viewItemSource.documentId,\r\n GBFSDataType.Text,\r\n FieldItemType.DocumentId\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Created Date\",\r\n viewItemSource.createdDate,\r\n GBFSDataType.Date,\r\n FieldItemType.CreateDate\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Credit Note Date\",\r\n convertStrToDate(viewItemSource.documentDate),\r\n GBFSDataType.Date,\r\n FieldItemType.DocumentDate\r\n )}\r\n
\r\n
\r\n {renderItem(\r\n \"Schedule No.\",\r\n viewItemSource.scheduleNo,\r\n GBFSDataType.Text,\r\n FieldItemType.ScheduleNo\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {renderItem(\r\n \"Credit Note Amount\",\r\n viewItemSource.documentAmount,\r\n GBFSDataType.Currency,\r\n FieldItemType.DocumentAmount,\r\n viewItemSource?.currency?.fundingSymbol,\r\n renderExchangeContent(\r\n viewItemSource?.currency,\r\n viewItemSource?.documentAmountForexReference,\r\n viewItemSource.documentAmount\r\n )\r\n )}\r\n
\r\n
\r\n {renderAmountItem(\r\n \"Unapplied Amount\",\r\n viewItemSource.dueAmount,\r\n FieldItemType.DueAmount,\r\n viewItemSource?.currency?.fundingSymbol,\r\n renderExchangeContent(\r\n viewItemSource?.currency,\r\n viewItemSource?.dueAmountForexReference,\r\n viewItemSource.documentAmount\r\n )\r\n )}\r\n
\r\n
\r\n {renderStatusItem(\r\n \"Credit Note Status\",\r\n viewItemSource.accountStateDisplay,\r\n GBFSDataType.Text,\r\n FieldItemType.PaymentStatus\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n )}\r\n
\r\n );\r\n };\r\n\r\n const renderCreditNotesTransactions = () => {\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n View Credit Note\r\n
{subTitle}
\r\n
\r\n
\r\n {renderItems()}\r\n {renderCreditNotesTransactions()}\r\n
\r\n
\r\n {\r\n onClose();\r\n }}\r\n >\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ViewCreditNotes;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport clsx from \"clsx\";\r\nimport { getCreditNotesTransactions } from \"@/services/factoring\";\r\nimport {\r\n convertMambuErrorMessage,\r\n formatItemValueByFieldType,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { renderExchangeContentForDetailTable } from \"@/page/Factoring/utils\";\r\n\r\ninterface IViewCreditNoteTransactionsProps {\r\n depositAccountEncodedKey: string;\r\n showAtPage: boolean;\r\n}\r\n\r\nconst ViewCreditNoteTransactions: React.FunctionComponent<\r\n IViewCreditNoteTransactionsProps\r\n> = (props) => {\r\n const { depositAccountEncodedKey, showAtPage } = props;\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [transactionSource, setTransactionSource] = React.useState([]);\r\n const transactionSourceRef = React.useRef(null);\r\n const narrowFirstCol = !showAtPage;\r\n\r\n React.useEffect(() => {\r\n const loadSource = async () => {\r\n LoadingAnimation.show();\r\n const res = await getCreditNotesTransactions(depositAccountEncodedKey);\r\n if (res.success) {\r\n const source = res.result;\r\n if (source) {\r\n setTransactionSource(source);\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n setIsInitCompleted(true);\r\n LoadingAnimation.hide();\r\n };\r\n\r\n loadSource();\r\n }, [depositAccountEncodedKey]);\r\n\r\n const renderTransactions = () => {\r\n const valueDateBodyTemplate = (rowData: any) => {\r\n return formatItemValueByFieldType(rowData.valueDate, GBFSDataType.Date);\r\n };\r\n const transactionTypeBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n {`${rowData.transactionType} ${rowData.transactionReferenceTypeDesc}`}\r\n
\r\n );\r\n };\r\n const referenceBodyTemplate = (rowData: any) => {\r\n return (\r\n
\r\n {rowData.reference || \"\"}\r\n
\r\n );\r\n };\r\n const amountBodyTemplate = (rowData: any) => {\r\n const val = rowData.amount || 0;\r\n return (\r\n
\r\n {renderExchangeContentForDetailTable(rowData?.currency, rowData?.amountInCurrency)}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n };\r\n const dueAmountBodyTemplate = (rowData: any) => {\r\n const val = rowData.dueAmount || 0;\r\n return (\r\n
\r\n {renderExchangeContentForDetailTable(\r\n rowData?.currency,\r\n rowData?.dueAmountInCurrency\r\n )}\r\n {renderMoneyWithCurrencyCode(val, rowData?.currency?.fundingSymbol)}\r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n return
{isInitCompleted && renderTransactions()}
;\r\n};\r\n\r\nexport default ViewCreditNoteTransactions;\r\n","import * as React from \"react\";\r\nimport { DataTable, DataTablePageParams } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport styles from \"../../factoring.module.scss\";\r\nimport clsx from \"clsx\";\r\n\r\nimport { OverlayPanel } from \"primereact/overlaypanel\";\r\nimport * as rGridBodys from \"./receivables/receivable-grid-body\";\r\nimport * as rGridFilters from \"./receivables/receivable-grid-filters\";\r\nimport * as rGridHeaders from \"./receivables/receivable-grid-header\";\r\nimport * as rUtils from \"./receivables/receivable-utils\";\r\nimport { conditionFilterSelectors } from \"@/utils/consts/commons\";\r\nimport { ReceivableTypeEnums } from \"@/utils/enums\";\r\nimport {\r\n convertMambuErrorMessage,\r\n convertStrToDate,\r\n getTodayDate,\r\n getYearMonthDropdownOptions,\r\n toDateTimesNumber,\r\n} from \"@/utils/common-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { getReceivablesForFactoringLine, RunLoadReceivablesTask } from \"@/services/factoring\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport ViewReceivables from \"../ViewReceivables\";\r\nimport ViewCreditNotes from \"../ViewCreditNotes\";\r\nimport { getCurrencyOptions } from \"@/page/Factoring/utils\";\r\nimport { MultiSelect } from \"primereact/multiselect\";\r\nimport DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { runLongRequestMethod } from \"@/utils/message-hub-helper\";\r\n\r\ninterface IFactoringLineReceivablesProps {\r\n factoringLineId: string;\r\n activedFactoringLineName: string;\r\n}\r\n\r\nexport enum FilterDropdownColumnType {\r\n Customer,\r\n Branch,\r\n ReceivableType,\r\n PaymentStatus,\r\n InvoicesStatus,\r\n}\r\n\r\nlet mounted = false;\r\nlet currentFilterDropdownColumnType: any;\r\nconst ReceivableTable: React.FunctionComponent = (props) => {\r\n const { factoringLineId, activedFactoringLineName } = props;\r\n const defaultCondition = conditionFilterSelectors[4];\r\n const [isInitCompleted, setIsInitCompleted] = React.useState(false);\r\n const [receivablesSource, setReceivablesSource] = React.useState([]);\r\n const [receivablesFilteredSource, setReceivablesFilteredSource] = React.useState([]);\r\n\r\n const [selFilterBranch, setSelFilterBranch] = React.useState();\r\n const [selFilterType, setSelFilterType] = React.useState();\r\n const [selFilterStatus, setSelFilterStatus] = React.useState();\r\n const [selFilterInvoiceStatus, setSelFilterInvoiceStatus] = React.useState();\r\n const [selFilterCustomers, setSelFilterCustomers] = React.useState();\r\n const [selFilterCreditTermCondition, setSelFilterCreditTermCondition] =\r\n React.useState(defaultCondition);\r\n const [filterCreditTerm, setFilterCreditTerm] = React.useState(undefined);\r\n const [selFilterOverDueDaysCondition, setSelFilterOverDueDaysCondition] =\r\n React.useState(defaultCondition);\r\n const [filterOverDueDays, setFilterOverDueDays] = React.useState(undefined);\r\n const [selFilterDocumentAmountCondition, setSelFilterDocumentAmountCondition] =\r\n React.useState(defaultCondition);\r\n const [filterDocumentAmount, setFilterDocumentAmount] =\r\n React.useState(undefined);\r\n const [selFilterDueAmountCondition, setSelFilterDueAmountCondition] =\r\n React.useState(defaultCondition);\r\n const [filterDueAmount, setFilterDueAmount] = React.useState(undefined);\r\n const [statusSource, setStatusSource] = React.useState([]);\r\n const [customerSource, setCustomerSource] = React.useState([]);\r\n const [branchsSource, setBranchsSource] = React.useState([]);\r\n const [typesSource, setTypesSource] = React.useState([]);\r\n const [invoiceStatusSource, setInvoiceStatusSource] = React.useState([]);\r\n const [showBranchNameCol, setShowBranchNameCol] = React.useState(false);\r\n const [showPwoCol, setShowPwoCol] = React.useState(false);\r\n const [showCreditTermCol, setShowCreditTermCol] = React.useState(false);\r\n const [showOpenDateCol, setShowOpenDateCol] = React.useState(false);\r\n const [viewCustomerBranchSettingSource, setViewCustomerBranchSettingSource] =\r\n React.useState(null);\r\n const [viewEditItemSource, setViewEditItemSource] = React.useState(null);\r\n const receivablesSourceRef = React.useRef(null);\r\n\r\n const [choosenCurreny, setChoosenCurreny] = React.useState();\r\n const [currencyOptions, setCurrencyOptions] =\r\n React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >();\r\n\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n const [selectedMonth, setSelectedMonth] = React.useState();\r\n const [monthOptions, setMonthOptions] = React.useState();\r\n const [page, setPage] = React.useState();\r\n\r\n React.useEffect(() => {\r\n const getMonthOptions = (date: any) => {\r\n if (date) {\r\n const beginDate = convertStrToDate(date);\r\n const endDate = getTodayDate();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n };\r\n\r\n // const loadSource = async () => {\r\n // LoadingAnimation.show();\r\n // const res = await getReceivablesForFactoringLine(factoringLineId);\r\n // if (res.success) {\r\n // if (mounted) {\r\n // const source = res.result;\r\n // if (source) {\r\n // let activationDate: string = \"\";\r\n // for (let s of source) {\r\n // if (activationDate) {\r\n // activationDate = s.createdDate < activationDate ? s.createdDate : activationDate;\r\n // } else {\r\n // activationDate = s.createdDate;\r\n // }\r\n // //add a custom filter field for invoice tags\r\n // const invoiceTags = s.invoiceCustomTags?.filter((f: any) => f.isOpen);\r\n // const isInvoiceClosed = s.accountState === \"CLOSED\";\r\n // if (!isInvoiceClosed) {\r\n // s.invoiceFilterTags = invoiceTags;\r\n // }\r\n // }\r\n // const handleSouce = source.map((i: any) => {\r\n // return {\r\n // ...i,\r\n // createdDateFilter: toDateTimesNumber(i.createdDate),\r\n // documentDateFilter: toDateTimesNumber(i.documentDate),\r\n // dueDateFilter: toDateTimesNumber(i.dueDate),\r\n // };\r\n // });\r\n\r\n // const newMonthOptions = getMonthOptions(activationDate);\r\n // setMonthOptions(newMonthOptions);\r\n // setSelectedMonth(newMonthOptions[newMonthOptions.length - 1]?.value);\r\n\r\n // setReceivablesSource(handleSouce);\r\n // setReceivablesFilteredSource(handleSouce);\r\n // setDropdownSource(handleSouce);\r\n\r\n // setCurrencyOptions(getCurrencyOptions(handleSouce));\r\n // }\r\n // }\r\n // } else {\r\n // messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n // }\r\n // setIsInitCompleted(true);\r\n // LoadingAnimation.hide();\r\n // };\r\n\r\n const loadSource = async () => {\r\n const doLoadSource = async (connectionId: any) => {\r\n LoadingAnimation.show();\r\n await RunLoadReceivablesTask(factoringLineId, connectionId);\r\n };\r\n const loadCompleted = (res: any) => {\r\n if (mounted && res.success) {\r\n const source = res.result;\r\n if (source) {\r\n let activationDate: string = \"\";\r\n for (let s of source) {\r\n if (activationDate) {\r\n activationDate = s.createdDate < activationDate ? s.createdDate : activationDate;\r\n } else {\r\n activationDate = s.createdDate;\r\n }\r\n //add a custom filter field for invoice tags\r\n const invoiceTags = s.invoiceCustomTags?.filter((f: any) => f.isOpen);\r\n const isInvoiceClosed = s.accountState === \"CLOSED\";\r\n if (!isInvoiceClosed) {\r\n s.invoiceFilterTags = invoiceTags;\r\n }\r\n }\r\n const handleSouce = source.map((i: any) => {\r\n return {\r\n ...i,\r\n createdDateFilter: toDateTimesNumber(i.createdDate),\r\n documentDateFilter: toDateTimesNumber(i.documentDate),\r\n dueDateFilter: toDateTimesNumber(i.dueDate),\r\n };\r\n });\r\n\r\n const newMonthOptions = getMonthOptions(activationDate);\r\n setMonthOptions(newMonthOptions);\r\n setSelectedMonth(newMonthOptions[newMonthOptions.length - 1]?.value);\r\n\r\n setReceivablesSource(handleSouce);\r\n setReceivablesFilteredSource(handleSouce);\r\n setDropdownSource(handleSouce);\r\n\r\n setCurrencyOptions(getCurrencyOptions(handleSouce));\r\n }\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n setIsInitCompleted(true);\r\n LoadingAnimation.hide();\r\n };\r\n runLongRequestMethod(loadCompleted, doLoadSource);\r\n };\r\n\r\n mounted = true;\r\n\r\n if (factoringLineId) {\r\n loadSource();\r\n }\r\n\r\n return () => {\r\n mounted = false;\r\n };\r\n }, [factoringLineId]);\r\n\r\n const setDropdownSource = (source: any) => {\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.PaymentStatus) {\r\n const status = rUtils.getStatusSource(source);\r\n setStatusSource(status);\r\n }\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.InvoicesStatus) {\r\n const invoiceStatus = rUtils.getInvoiceStatusSource(source);\r\n setInvoiceStatusSource(invoiceStatus);\r\n }\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.Customer) {\r\n const customers = rUtils.getCustomerSource(source);\r\n setCustomerSource(customers);\r\n }\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.ReceivableType) {\r\n const tSource = rUtils.getTypesSource(source);\r\n setTypesSource(tSource);\r\n }\r\n if (currentFilterDropdownColumnType !== FilterDropdownColumnType.Branch) {\r\n const bSource = rUtils.getBranchSource(source);\r\n setBranchsSource(bSource);\r\n }\r\n currentFilterDropdownColumnType = undefined;\r\n };\r\n\r\n const settingsViewBodyTemplateRender = (rowData: any) => {\r\n return rGridBodys.settingsViewBodyTemplate(\r\n rowData,\r\n setViewCustomerBranchSettingSource,\r\n settingsViewOp\r\n );\r\n };\r\n\r\n const invoiceStatusBodyTemplateRender = (rowData: any) => {\r\n return rGridBodys.invoiceStatusBodyTemplate(rowData);\r\n };\r\n\r\n const settingsViewOp = React.useRef(null);\r\n\r\n const tryScrollToTop = () => {\r\n const dom = document.getElementsByClassName(\"p-datatable-scrollable-body\")[0];\r\n if (dom) {\r\n dom.scrollTop = 0;\r\n }\r\n };\r\n\r\n return (\r\n
\r\n {isInitCompleted && (\r\n
\r\n {\r\n if (filteredData) {\r\n setReceivablesFilteredSource(filteredData);\r\n setDropdownSource(filteredData);\r\n }\r\n }}\r\n footerColumnGroup={rGridBodys.footerGroup(\r\n showBranchNameCol,\r\n showPwoCol,\r\n showCreditTermCol,\r\n receivablesFilteredSource,\r\n showOpenDateCol\r\n )}\r\n rowHover\r\n paginator={true}\r\n rows={page?.rows || 20}\r\n currentPageReportTemplate=\"Showing {first} to {last} of {totalRecords} items\"\r\n paginatorTemplate=\"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown\"\r\n rowsPerPageOptions={[20, 50, 100]}\r\n sortField=\"createdDateFilter\"\r\n sortOrder={-1}\r\n scrollable={true}\r\n scrollHeight=\"calc(100vh - 400px)\"\r\n header={\r\n {\r\n setChoosenCurreny(e.value);\r\n receivablesSourceRef.current?.filter(e.value, \"currency.currencyCode\", \"in\");\r\n }}\r\n placeholder=\"Currency\"\r\n style={{ display: \"inline-flex\" }}\r\n />\r\n }\r\n first={page?.first || 0}\r\n onPage={(e) => {\r\n setPage(e);\r\n tryScrollToTop();\r\n }}\r\n >\r\n {\r\n return \"\";\r\n }}\r\n style={{ padding: 0, width: 0 }}\r\n />\r\n \r\n {\r\n currentFilterDropdownColumnType = o;\r\n }\r\n )}\r\n style={{ width: \"200px\" }}\r\n >\r\n {\r\n currentFilterDropdownColumnType = o;\r\n }\r\n )}\r\n style={{ width: \"90px\" }}\r\n >\r\n {showBranchNameCol && (\r\n \r\n )}\r\n \r\n Created Date\r\n \r\n {\r\n setSelectedMonth(e.value);\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select month\"\r\n />\r\n \r\n \r\n }\r\n field=\"createdDateFilter\"\r\n sortable\r\n filter\r\n body={rGridBodys.createdDateBodyTemplate}\r\n filterElement={\r\n {\r\n setSelectedMonth(undefined);\r\n }}\r\n defaultMonth={monthOptions?.[monthOptions.length - 1]?.value}\r\n />\r\n }\r\n style={{ width: \"210px\" }}\r\n >\r\n \r\n {showPwoCol && (\r\n \r\n )}\r\n {\r\n currentFilterDropdownColumnType = o;\r\n }\r\n )}\r\n style={{ width: \"65px\" }}\r\n >\r\n \r\n \r\n }\r\n style={{ width: \"143px\" }}\r\n >\r\n {showCreditTermCol && (\r\n \r\n )}\r\n \r\n }\r\n style={{ width: \"143px\" }}\r\n >\r\n \r\n \r\n \r\n {\r\n currentFilterDropdownColumnType = o;\r\n }\r\n )}\r\n >\r\n {\r\n currentFilterDropdownColumnType = o;\r\n }\r\n )}\r\n body={invoiceStatusBodyTemplateRender}\r\n >\r\n {showOpenDateCol && (\r\n \r\n }\r\n style={{ width: \"120px\" }}\r\n >\r\n )}\r\n {\r\n return rGridBodys.actionBodyTemplate(rowData, setViewEditItemSource);\r\n }}\r\n filter\r\n filterElement={rGridFilters.renderClearFilter(\r\n receivablesSourceRef,\r\n setReceivablesFilteredSource,\r\n setSelFilterCustomers,\r\n setFilterCreditTerm,\r\n setFilterDocumentAmount,\r\n setFilterDueAmount,\r\n setSelFilterStatus,\r\n setSelFilterInvoiceStatus,\r\n setSelFilterType,\r\n setSelFilterBranch,\r\n setDropdownSource,\r\n (o: any) => {\r\n currentFilterDropdownColumnType = o;\r\n setClearFilter((i) => i + 1);\r\n setSelectedMonth(monthOptions?.[monthOptions.length - 1]?.value);\r\n }\r\n )}\r\n style={{ width: \"40px\" }}\r\n />\r\n \r\n
\r\n )}\r\n {rGridBodys.settingOverlayPanel(viewCustomerBranchSettingSource, settingsViewOp)}\r\n\r\n {viewEditItemSource && viewEditItemSource.receivableType === ReceivableTypeEnums.IN && (\r\n {\r\n setViewEditItemSource(undefined);\r\n }}\r\n activedFactoringLineName={activedFactoringLineName}\r\n />\r\n )}\r\n\r\n {viewEditItemSource && viewEditItemSource.receivableType === ReceivableTypeEnums.CN && (\r\n {\r\n setViewEditItemSource(undefined);\r\n }}\r\n activedFactoringLineName={activedFactoringLineName}\r\n />\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ReceivableTable;\r\n","import * as signalR from '@microsoft/signalr';\r\nimport config from './config';\r\nimport { messageHelper } from './message-helper';\r\n\r\nexport const runLongRequestMethod = (receiveMsgHandler: Function, doActionHandler: Function) => {\r\n const protocol = new signalR.JsonHubProtocol();\r\n // const transport = signalR.HttpTransportType.WebSockets;\r\n // const options = {\r\n // transport,\r\n // skipNegotiation: true,\r\n // };\r\n const sr = new signalR.HubConnectionBuilder()\r\n .withUrl(`${config.factoringApi}/api/MessageHub`)\r\n .withHubProtocol(protocol)\r\n .withAutomaticReconnect()\r\n .build();\r\n sr.on(\"onLoadCompleted\", (msg: any) => {\r\n if (receiveMsgHandler) {\r\n receiveMsgHandler(msg);\r\n }\r\n sr.stop();\r\n });\r\n // sr.serverTimeoutInMilliseconds = 60 * 1000 * 60 * 24;\r\n sr.on('connected', async (connectionId) => {\r\n if (doActionHandler) {\r\n await doActionHandler(connectionId);\r\n }\r\n })\r\n // sr.on('ReceiveMessage', () => { })\r\n sr.start().then(async () => {\r\n // connectionRef.current = sr;\r\n }).catch((err: any) => {\r\n messageHelper.warn('SignalR Connection Error: ' + err);\r\n });\r\n sr.onreconnected(() => {\r\n console.log(\"reconnected\")\r\n });\r\n};","import * as React from \"react\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { GetLoanModuleDropdownSource, LoadPrintLoanStatement } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { convertStrToDate, getLastMonth, getYearMonthDropdownOptions, YearMonthDropdownOptions } from \"@/utils/common-helper\";\r\nimport { Button } from \"primereact/button\";\r\nimport { GBFSPrint } from \"@/utils/print-helper\";\r\n\r\nconst getMonthOptions = (activationDate: any) => {\r\n if (activationDate) {\r\n const beginDate = convertStrToDate(activationDate);\r\n const endDate = getLastMonth();\r\n return getYearMonthDropdownOptions(beginDate, endDate);\r\n }\r\n return [];\r\n};\r\n\r\ntype FieldType = \"loanProduct\" | \"accountNumber\" | \"statementMonth\";\r\nenum FieldEnum {\r\n loanProduct = \"loanProduct\",\r\n accountNumber = \"accountNumber\",\r\n statementMonth = \"statementMonth\",\r\n}\r\n\r\ninterface formFieldType {\r\n field: FieldType;\r\n label: string;\r\n options?: any[];\r\n onChange?: (arg: any) => void;\r\n value?: string;\r\n}\r\n\r\ninterface ISelectAccountProps {\r\n onSearch: (accountId?: string, month?: string) => Promise;\r\n}\r\n\r\nconst SelectAccountAndMonth: React.FunctionComponent = (props) => {\r\n const { onSearch } = props;\r\n\r\n const [productOptions, setProductOptions] = React.useState([]);\r\n const [accountOptions, setAccountOptions] = React.useState([]);\r\n const [monthOptions, setMonthOptions] = React.useState([]);\r\n\r\n const [chooseProduct, setChooseProduct] = React.useState();\r\n const [chooseAccount, setChooseAccount] = React.useState();\r\n const [chooseMonth, setChooseMonth] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n React.useEffect(() => {\r\n const setMonth = (chooseAccount: Loan.DropdownListItem) => {\r\n const activationDate = chooseAccount?.object?.activationDate;\r\n const newMonthOptions = getMonthOptions(activationDate);\r\n setMonthOptions(newMonthOptions);\r\n setChooseMonth(newMonthOptions?.[0]?.value);\r\n };\r\n\r\n const getLoanModuleDropdownSource = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetLoanModuleDropdownSource();\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n setProductOptions(res.result?.productDropdownList || []);\r\n setAccountOptions(res.result?.accountDropdownList || []);\r\n\r\n // set default value\r\n setChooseProduct(res.result?.productDropdownList?.[0]?.value);\r\n const newAccountOptions = res.result?.accountDropdownList?.filter(\r\n (i) => i.object?.productEncodedKey === res.result?.productDropdownList?.[0]?.value\r\n );\r\n setChooseAccount(newAccountOptions?.[0]?.value);\r\n setMonth(newAccountOptions?.[0]);\r\n onSearch(newAccountOptions?.[0]?.value);\r\n }\r\n };\r\n getLoanModuleDropdownSource();\r\n }, [onSearch]);\r\n\r\n const fieldsArray: formFieldType[] = React.useMemo(() => {\r\n const trySetAccount = (newChooseProduct: string) => {\r\n const newAccountOptions = accountOptions?.filter(\r\n (i) => i.object?.productEncodedKey === newChooseProduct\r\n );\r\n setChooseAccount(newAccountOptions?.[0]?.value);\r\n\r\n trySetMonth(newAccountOptions?.[0]?.value);\r\n };\r\n\r\n const trySetMonth = (newChooseAccount: string) => {\r\n const activationDate = accountOptions.find((i) => i.value === newChooseAccount)?.object\r\n ?.activationDate;\r\n const newMonthOptions = getMonthOptions(activationDate);\r\n setMonthOptions(newMonthOptions);\r\n setChooseMonth(newMonthOptions?.[0]?.value);\r\n };\r\n\r\n return [\r\n {\r\n field: FieldEnum.loanProduct,\r\n label: \"Product\",\r\n options: productOptions,\r\n onChange: (e: any) => {\r\n setChooseProduct(e.target.value);\r\n trySetAccount(e.target.value);\r\n },\r\n value: chooseProduct,\r\n },\r\n {\r\n field: FieldEnum.accountNumber,\r\n label: \"Account\",\r\n options: accountOptions?.filter((i) => i.object?.productEncodedKey === chooseProduct),\r\n hide: !chooseProduct,\r\n onChange: (e: any) => {\r\n setChooseAccount(e.target.value);\r\n trySetMonth(e.target.value);\r\n },\r\n value: chooseAccount,\r\n },\r\n {\r\n field: FieldEnum.statementMonth,\r\n label: \"Statement Month\",\r\n options: monthOptions,\r\n hide: !chooseAccount,\r\n onChange: (e: any) => {\r\n setChooseMonth(e.target.value);\r\n },\r\n value: chooseMonth,\r\n },\r\n ].filter((i) => !i.hide);\r\n }, [productOptions, accountOptions, monthOptions, chooseProduct, chooseAccount, chooseMonth]);\r\n\r\n React.useEffect(() => {\r\n onSearch(chooseAccount, chooseMonth);\r\n }, [onSearch, chooseAccount, chooseMonth]);\r\n\r\n const downloadLoanStatement = async () => {\r\n if (chooseAccount && chooseMonth) {\r\n LoadingAnimation.show();\r\n const res = await LoadPrintLoanStatement(chooseAccount, chooseMonth);\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n GBFSPrint(res.result.printContents, \"Statement\", \"pdf\", true);\r\n }\r\n }\r\n };\r\n\r\n return (\r\n
\r\n
\r\n {fieldsArray.map((i: formFieldType) => {\r\n const { field, label, options, onChange, value } = i;\r\n return (\r\n
\r\n \r\n {label}\r\n \r\n
\r\n {\r\n onChange?.(e);\r\n }}\r\n />\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n {chooseAccount && chooseMonth && (\r\n {\r\n downloadLoanStatement();\r\n }}\r\n label=\"Download\"\r\n icon=\"pi pi-download\"\r\n className=\"p-button-secondary p-mr-2 p-mb-2\"\r\n style={{\r\n alignSelf: \"flex-end\",\r\n justifySelf: \"flex-end\",\r\n }}\r\n />\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default SelectAccountAndMonth;\r\n","import { Dropdown } from \"primereact/dropdown\";\r\nimport * as React from \"react\";\r\nimport { GetFactoringLines } from \"@/services/factoring\";\r\nimport { convertMambuErrorMessage } from \"@/utils/common-helper\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport ReceivableTable from \"./components/ReceiveableTable/ReceivableTable\";\r\nimport styles from \"./index.module.scss\";\r\n\r\nconst getFactoringLinesName = (factoringLineName: any) => {\r\n if (!factoringLineName) {\r\n return \"\";\r\n }\r\n const { name, id, accountReference } = factoringLineName;\r\n return `${name} ${id} ${accountReference ? `- ${accountReference}` : \"\"}`;\r\n};\r\n\r\nconst getFactoringLinesNameExcludeId = (factoringLineName: any) => {\r\n if (!factoringLineName) {\r\n return \"\";\r\n }\r\n const { name, accountReference } = factoringLineName;\r\n return `${name} ${accountReference ? `- ${accountReference}` : \"\"}`;\r\n};\r\ninterface IFundingAvailablityProps {}\r\n\r\nconst ScheduleOfInvoices: React.FunctionComponent = (\r\n props\r\n) => {\r\n const [factoringLines, setFactoringLines] = React.useState([]);\r\n const [activedFactoringLine, setActivedFactoringLine] = React.useState();\r\n const [\r\n activedFactoringLineName,\r\n setActivedFactoringLineName,\r\n ] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n React.useEffect(() => {\r\n const getInitData = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetFactoringLines();\r\n LoadingAnimation.hide();\r\n if (\r\n mountedRef.current &&\r\n res.success &&\r\n res.result &&\r\n res.result?.length > 0\r\n ) {\r\n setFactoringLines(res.result);\r\n setActivedFactoringLine(res.result[0]?.id);\r\n setActivedFactoringLineName(\r\n getFactoringLinesNameExcludeId(res.result[0])\r\n );\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n }\r\n };\r\n\r\n getInitData();\r\n }, []);\r\n\r\n return (\r\n
\r\n

Schedule Of Invoices

\r\n
\r\n
\r\n
\r\n
\r\n {\r\n return {\r\n text: getFactoringLinesName(i),\r\n value: i.id,\r\n };\r\n })}\r\n onChange={(e) => {\r\n setActivedFactoringLine(e.value);\r\n\r\n setActivedFactoringLineName(\r\n getFactoringLinesNameExcludeId(\r\n factoringLines?.find((i) => i.id === e.value)\r\n )\r\n );\r\n }}\r\n className=\"p-column-filter\"\r\n placeholder=\"Select Factoring Line\"\r\n style={{ maxWidth: \"400px\" }}\r\n />\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ScheduleOfInvoices;\r\n","import * as React from \"react\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { GetLoanModuleDropdownSource } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\n\r\ntype FieldType = \"loanProduct\" | \"accountNumber\";\r\nenum FieldEnum {\r\n loanProduct = \"loanProduct\",\r\n accountNumber = \"accountNumber\",\r\n}\r\n\r\nexport interface formFieldType {\r\n field: FieldType;\r\n label: string;\r\n options?: any[];\r\n rules?: any[];\r\n onChange?: (arg: any) => void;\r\n value?: string;\r\n}\r\n\r\nexport enum productEnum {\r\n factoring = \"Factoring\",\r\n merchantCashAdvance = \"Merchant Cash Advance\",\r\n}\r\n\r\ninterface ISelectAccountProps {\r\n onSearch: (arg: any) => void;\r\n}\r\n\r\nconst SelectAccount: React.FunctionComponent = (props) => {\r\n const { onSearch } = props;\r\n\r\n const [productOptions, setProductOptions] = React.useState([]);\r\n const [accountOptions, setAccountOptions] = React.useState([]);\r\n\r\n const [chooseProduct, setChooseProduct] = React.useState();\r\n const [chooseAccount, setChooseAccount] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n React.useEffect(() => {\r\n const getLoanModuleDropdownSource = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetLoanModuleDropdownSource();\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n setProductOptions(res.result?.productDropdownList || []);\r\n setAccountOptions(res.result?.accountDropdownList || []);\r\n\r\n // set default value\r\n setChooseProduct(res.result?.productDropdownList?.[0]?.value);\r\n const newAccountOptions = res.result?.accountDropdownList?.filter(\r\n (i) => i.object?.productEncodedKey === res.result?.productDropdownList?.[0]?.value\r\n );\r\n setChooseAccount(newAccountOptions?.[0]?.value);\r\n onSearch(newAccountOptions?.[0]?.value);\r\n }\r\n };\r\n getLoanModuleDropdownSource();\r\n }, [onSearch]);\r\n\r\n const fieldsArray: formFieldType[] = React.useMemo(() => {\r\n return [\r\n {\r\n field: FieldEnum.loanProduct,\r\n label: \"Product\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n options: productOptions,\r\n onChange: (e: any) => {\r\n setChooseProduct(e.target.value);\r\n const newAccountOptions = accountOptions?.filter(\r\n (i) => i.object?.productEncodedKey === e.target.value\r\n );\r\n setChooseAccount(newAccountOptions?.[0]?.value);\r\n onSearch(newAccountOptions?.[0]?.value);\r\n },\r\n value: chooseProduct,\r\n },\r\n {\r\n field: FieldEnum.accountNumber,\r\n label: \"Account\",\r\n rules: [\r\n {\r\n required: true,\r\n },\r\n ],\r\n options: accountOptions?.filter((i) => i.object?.productEncodedKey === chooseProduct),\r\n hide: !chooseProduct,\r\n onChange: (e: any) => {\r\n onSearch(e.target.value);\r\n setChooseAccount(e.target.value);\r\n },\r\n value: chooseAccount,\r\n },\r\n ].filter((i) => !i.hide);\r\n }, [productOptions, accountOptions, chooseProduct, onSearch, chooseAccount]);\r\n\r\n return (\r\n
\r\n
\r\n {fieldsArray.map((i: formFieldType) => {\r\n const { field, label, options, onChange, value } = i;\r\n return (\r\n
\r\n \r\n {label}\r\n \r\n
\r\n {\r\n onChange?.(e);\r\n }}\r\n style={{ maxWidth: 330 }}\r\n />\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SelectAccount;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport {\r\n getFilterMatchModel,\r\n renderMoneyWithCurrencyCode,\r\n toGBFSDateFormatStr,\r\n} from \"@/utils/common-helper\";\r\nimport DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\n\r\ninterface ILoanStatementTableProps {\r\n tableData: Loan.LoanStatementListItem[];\r\n}\r\n\r\nconst LoanStatementTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n\r\n const [options, setOptions] =\r\n React.useState<{\r\n transactionType: {\r\n label: string;\r\n value: string;\r\n }[];\r\n }>();\r\n\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const [displayedData, setDisplayedData] = React.useState();\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n const getOptions = (tableData: Loan.LoanStatementListItem[]) => {\r\n const compareFunction = (a: any, b: any) => {\r\n if (a === b) {\r\n return 0;\r\n }\r\n return a < b ? -1 : 1;\r\n };\r\n\r\n const result: {\r\n transactionType: {\r\n label: string;\r\n value: string;\r\n }[];\r\n } = {\r\n transactionType: [],\r\n };\r\n\r\n const transactionTypeSet = new Set();\r\n\r\n tableData.forEach((i) => {\r\n if (i.transactionType && !transactionTypeSet.has(i.transactionType)) {\r\n result.transactionType.push({\r\n label: i.transactionType,\r\n value: i.transactionType,\r\n });\r\n }\r\n\r\n transactionTypeSet.add(i.transactionType);\r\n });\r\n\r\n result.transactionType.sort(compareFunction);\r\n\r\n return result;\r\n };\r\n\r\n const clearBeforeFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n };\r\n\r\n if (tableData) {\r\n setOptions(getOptions(tableData));\r\n } else {\r\n setOptions({\r\n transactionType: [],\r\n });\r\n }\r\n\r\n clearBeforeFilters();\r\n setDisplayedData(tableData);\r\n }, [tableData]);\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const clearFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n setDisplayedData(tableData);\r\n };\r\n\r\n const footerColumnGroup = () => {\r\n const totalDebit = displayedData?.reduce((preValue, currentItem) => {\r\n preValue += currentItem.debit || 0;\r\n return preValue;\r\n }, 0);\r\n return (\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n {\r\n setDisplayedData(value);\r\n }}\r\n >\r\n {\r\n return toGBFSDateFormatStr(rowData?.valueDate as any);\r\n }}\r\n filter\r\n filterElement={}\r\n style={{ width: 120 }}\r\n >\r\n \r\n }\r\n style={{ width: 130 }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.debit as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.credit as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.outstandingBalance as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n {\r\n return rowData?.feeAppliedName as any;\r\n }}\r\n filter\r\n filterMatchMode=\"contains\"\r\n style={{ width: 140 }}\r\n >\r\n \r\n }\r\n >\r\n \r\n );\r\n};\r\n\r\nexport default LoanStatementTable;\r\n","import * as React from \"react\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport SelectAccountAndMonth from \"./components/SelectAccountAndMonth\";\r\nimport { GetLoanStatement } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport LoanStatementTable from \"./components/LoanStatementTable\";\r\nimport { toDateTimesNumber } from \"@/utils/common-helper\";\r\n\r\nconst LoanStatement: React.FunctionComponent = () => {\r\n const [tableData, setTableData] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const onSearch = React.useCallback(async (accountId?: string, month?: string) => {\r\n if (!accountId || !month) {\r\n setTableData(undefined);\r\n return;\r\n }\r\n LoadingAnimation.show();\r\n const res = await GetLoanStatement(accountId, month);\r\n LoadingAnimation.hide();\r\n\r\n if (!hasError(res)) {\r\n setTableData(\r\n res.result?.map((i) => {\r\n return {\r\n ...i,\r\n valueDate: toDateTimesNumber(i.valueDate as any) as any,\r\n };\r\n })\r\n );\r\n }\r\n }, []);\r\n\r\n return (\r\n
\r\n
\r\n Loan Statement\r\n
\r\n
\r\n
\r\n \r\n {tableData && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default LoanStatement;\r\n","import * as React from \"react\";\r\nimport { Dropdown, DropdownChangeParams } from \"primereact/dropdown\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport { GetMCALoanAccountsSource, LoadPrintLoanMCAStatement } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport { toOrignalDateOnlyFormatStr } from \"@/utils/common-helper\";\r\nimport { Button } from \"primereact/button\";\r\nimport { GBFSPrint } from \"@/utils/print-helper\";\r\nimport moment from \"moment\";\r\nimport CustomDateRangeSelector from \"@/components/CustomDateRangeSelector\";\r\n\r\nenum FieldEnum {\r\n accountNumber = \"accountNumber\",\r\n product = 'product',\r\n}\r\n\r\nconst getDateRangeStr = (\r\n dateRange?: Date[]\r\n) => {\r\n const [startDate, endDate] = dateRange || [];\r\n\r\n if (startDate && endDate) {\r\n const startDateStr = toOrignalDateOnlyFormatStr(startDate);\r\n const endDateStr = toOrignalDateOnlyFormatStr(endDate);\r\n return [startDateStr, endDateStr]\r\n }\r\n return []\r\n}\r\n\r\ninterface ISelectAccountProps {\r\n onSearch: (loanAccountId?: string, beginDate?: string, endDate?: string) => Promise;\r\n}\r\n\r\nconst lastFriday = moment(new Date()).add(-1, 'week').weekday(5).toDate();\r\n\r\nconst SelectAccount: React.FunctionComponent = (props) => {\r\n const { onSearch } = props;\r\n\r\n const [productOptions, setProductOptions] = React.useState([]);\r\n const [accountOptions, setAccountOptions] = React.useState([]);\r\n\r\n const [chooseProduct, setChooseProduct] = React.useState();\r\n const [chooseAccount, setChooseAccount] = React.useState();\r\n const [dateRange, setDateRange] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const updateDefaultDateRange = React.useCallback((newChooseAccount?: Loan.DropdownListItem) => {\r\n const maxDate = newChooseAccount?.object?.endDate ? new Date(newChooseAccount?.object?.endDate) : lastFriday;\r\n\r\n const activationDate = newChooseAccount?.object?.activationDate;\r\n const aMounthAgo = moment(maxDate).add(-1, \"months\");\r\n\r\n // Avoid time exceeding [min, max]\r\n const startDate = moment(activationDate).isSameOrBefore(aMounthAgo) ? aMounthAgo : moment(activationDate);\r\n\r\n setDateRange([\r\n startDate.toDate(),\r\n maxDate,\r\n ])\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n const getMCALoanAccountsSource = async () => {\r\n LoadingAnimation.show();\r\n const res = await GetMCALoanAccountsSource();\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n setProductOptions(res.result?.productDropdownList || []);\r\n setAccountOptions(res.result?.accountDropdownList || []);\r\n\r\n setChooseProduct(res.result?.productDropdownList?.[0]?.value);\r\n const newAccountOptions = res.result?.accountDropdownList?.filter(\r\n (i) => i.object?.productEncodedKey === res.result?.productDropdownList?.[0]?.value\r\n );\r\n const defaultAccount = newAccountOptions?.[0];\r\n setChooseAccount(defaultAccount?.value);\r\n updateDefaultDateRange(defaultAccount)\r\n }\r\n };\r\n getMCALoanAccountsSource();\r\n }, [updateDefaultDateRange]);\r\n\r\n React.useEffect(() => {\r\n const [startDateStr, endDateStr] = getDateRangeStr(dateRange)\r\n\r\n if (chooseAccount && startDateStr && endDateStr) {\r\n onSearch(chooseAccount, startDateStr, endDateStr);\r\n }\r\n }, [onSearch, chooseAccount, dateRange]);\r\n\r\n const downloadLoanStatement = async () => {\r\n const [startDateStr, endDateStr] = getDateRangeStr(dateRange)\r\n if (chooseAccount && startDateStr && endDateStr) {\r\n LoadingAnimation.show();\r\n const res = await LoadPrintLoanMCAStatement({\r\n loanAccountId: chooseAccount,\r\n beginDate: startDateStr,\r\n endDate: endDateStr,\r\n });\r\n LoadingAnimation.hide();\r\n if (!hasError(res)) {\r\n GBFSPrint(res.result.printContents, \"Statement\", \"pdf\", true);\r\n }\r\n }\r\n };\r\n\r\n const onProductChange = (e: DropdownChangeParams) => {\r\n setChooseProduct(e.target.value);\r\n const newAccountOptions = accountOptions.filter(i => i.object.productEncodedKey === e.target.value);\r\n const defaultAccount = newAccountOptions?.[0];\r\n setChooseAccount(defaultAccount?.value);\r\n updateDefaultDateRange(defaultAccount)\r\n }\r\n\r\n const onAccountChange = (e: DropdownChangeParams) => {\r\n setChooseAccount(e.target.value);\r\n updateDefaultDateRange(accountOptions?.find(i => i.value === e.target.value))\r\n }\r\n\r\n const { minDate, maxDate } = React.useMemo(() => {\r\n if (chooseAccount) {\r\n const chooseAccountObj = accountOptions.find(i => i.value === chooseAccount);\r\n return {\r\n minDate: chooseAccountObj?.object?.activationDate ? new Date(chooseAccountObj?.object?.activationDate) : undefined,\r\n maxDate: chooseAccountObj?.object?.endDate ? new Date(chooseAccountObj?.object?.endDate) : lastFriday\r\n }\r\n }\r\n return {\r\n minDate: undefined,\r\n maxDate: undefined,\r\n }\r\n }, [chooseAccount, accountOptions])\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n Product:\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n Account:\r\n \r\n
\r\n i.object.productEncodedKey === chooseProduct)}\r\n placeholder='Select Account'\r\n value={chooseAccount}\r\n onChange={onAccountChange}\r\n />\r\n
\r\n
\r\n
\r\n \r\n Date Range:\r\n \r\n
\r\n setDateRange(newDateRange)}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n />\r\n
\r\n
\r\n\r\n\r\n
\r\n {chooseAccount && dateRange && dateRange?.length === 2 && (\r\n {\r\n downloadLoanStatement();\r\n }}\r\n label=\"Download\"\r\n icon=\"pi pi-download\"\r\n className=\"p-button-secondary p-mr-2 p-mb-2\"\r\n style={{\r\n alignSelf: \"flex-end\",\r\n justifySelf: \"flex-end\",\r\n }}\r\n />\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default SelectAccount;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport {\r\n getFilterMatchModel,\r\n renderMoneyWithCurrencyCode,\r\n toGBFSDateFormatStr,\r\n} from \"@/utils/common-helper\";\r\nimport DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\n\r\ninterface IInstalmentScheduleTableProps {\r\n tableData: Loan.InstalmentScheduleListItem[];\r\n}\r\n\r\nconst InstalmentScheduleTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n\r\n const [statusOptions, setStatusOptions] = React.useState<{ label: string; value: string }[]>();\r\n\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const [displayedData, setDisplayedData] = React.useState();\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n const getOptions = (tableData: Loan.InstalmentScheduleListItem[]) => {\r\n const compareFunction = (a: any, b: any) => {\r\n if (a === b) {\r\n return 0;\r\n }\r\n return a < b ? -1 : 1;\r\n };\r\n\r\n const result: any[] = [];\r\n\r\n const stateSet = new Set();\r\n tableData.forEach((i) => {\r\n if (!stateSet.has(i.stateDisplay)) {\r\n result.push({\r\n label: i.stateDisplay,\r\n value: i.stateDisplay,\r\n });\r\n }\r\n\r\n stateSet.add(i.stateDisplay);\r\n });\r\n\r\n result.sort(compareFunction);\r\n\r\n return result;\r\n };\r\n\r\n const clearBeforeFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n };\r\n\r\n if (tableData) {\r\n setStatusOptions(getOptions(tableData));\r\n } else {\r\n setStatusOptions([]);\r\n }\r\n\r\n clearBeforeFilters();\r\n setDisplayedData(tableData);\r\n }, [tableData]);\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const clearFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n setDisplayedData(tableData);\r\n };\r\n\r\n const footerColumnGroup = () => {\r\n const total = displayedData?.reduce(\r\n (preValue, currentItem) => {\r\n preValue.totalExpected += currentItem.totalExpected || 0;\r\n preValue.totalPaid += currentItem.totalPaid || 0;\r\n preValue.totalDue += currentItem.totalDue || 0;\r\n return preValue;\r\n },\r\n {\r\n totalExpected: 0,\r\n totalPaid: 0,\r\n totalDue: 0,\r\n }\r\n );\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n {\r\n setDisplayedData(value);\r\n }}\r\n >\r\n \r\n {\r\n return toGBFSDateFormatStr(rowData?.dueDate as any);\r\n }}\r\n filter\r\n filterElement={}\r\n style={{ width: 120 }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.totalExpected as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.totalPaid as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.totalDue as any, \"S$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n {\r\n return toGBFSDateFormatStr(rowData?.paidDate as any);\r\n }}\r\n filter\r\n filterElement={}\r\n style={{ width: 120 }}\r\n >\r\n {\r\n return rowData?.stateDisplay as any;\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 100 }}\r\n >\r\n \r\n }\r\n >\r\n {/* */}\r\n \r\n );\r\n};\r\n\r\nexport default InstalmentScheduleTable;\r\n","import * as React from \"react\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport { toDateTimesNumber } from \"@/utils/common-helper\";\r\nimport SelectAccount from \"./components/SelectAccount\";\r\nimport { GetInstalmentScheduleList } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport InstalmentScheduleTable from \"./components/InstalmentScheduleTable\";\r\n\r\nconst InstalmentSchedule: React.FunctionComponent = () => {\r\n const [tableData, setTableData] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const onSearch = React.useCallback(async (accountId?: string) => {\r\n if (!accountId) {\r\n setTableData(undefined);\r\n return;\r\n }\r\n LoadingAnimation.show();\r\n const res = await GetInstalmentScheduleList(accountId);\r\n LoadingAnimation.hide();\r\n\r\n if (!hasError(res)) {\r\n setTableData(\r\n res.result?.map((i) => {\r\n return {\r\n ...i,\r\n dueDate: toDateTimesNumber(i.dueDate as any) as any,\r\n paidDate: toDateTimesNumber(i.paidDate as any) as any,\r\n };\r\n })\r\n );\r\n }\r\n }, []);\r\n\r\n return (\r\n
\r\n
\r\n Instalment Schedule\r\n
\r\n
\r\n
\r\n \r\n {tableData && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default InstalmentSchedule;\r\n","import * as React from \"react\";\r\nimport { Calendar } from \"primereact/calendar\";\r\n\r\ninterface ICustomDateRangeSelectorProps {\r\n value?: Date[],\r\n onChange: (arg: Date[]) => void;\r\n id?: string,\r\n minDate?: Date,\r\n maxDate?: Date,\r\n}\r\n\r\nconst CustomDateRangeSelector: React.FunctionComponent = ({\r\n value,\r\n onChange,\r\n id,\r\n minDate,\r\n maxDate,\r\n}) => {\r\n const [viewDate, setViewDate] = React.useState();\r\n\r\n const onFromDateChange = (event: any) => {\r\n onChange([\r\n event.value,\r\n value?.[1],\r\n ])\r\n\r\n setViewDate(event.value);\r\n };\r\n const onToDateChange = (event: any) => {\r\n onChange([\r\n value?.[0],\r\n event.value\r\n ])\r\n };\r\n\r\n const [selectedFromDate, selectedToDate] = value || [];\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n to\r\n \r\n
\r\n setViewDate(e.value)}\r\n />\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default CustomDateRangeSelector;\r\n","import { useFormik } from \"formik\";\r\nimport { InputText } from \"primereact/inputtext\";\r\nimport * as React from \"react\";\r\nimport { RouteComponentProps } from \"react-router-dom\";\r\nimport { Password } from \"primereact/password\";\r\nimport { setCurrentUserRole, setToken, storeAuthUser } from \"@/services/CacheService\";\r\nimport { loginByPassword } from \"@/services/userService\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport config from \"@/utils/config\";\r\nimport { GetUserRoles } from \"@/services/IdentityApi\";\r\nimport decode from \"jwt-decode\";\r\nimport User from \"@/services/user\";\r\nimport qs from \"qs\";\r\n\r\ninterface ISignInFormProps extends RouteComponentProps {\r\n}\r\n\r\nenum grantType {\r\n authorizationCode = \"authorization_code\",\r\n implicit = \"implicit\",\r\n password = \"password\",\r\n}\r\n\r\nconst SignInForm: React.FunctionComponent = (props) => {\r\n const [loading, setLoading] = React.useState(false);\r\n const [hasError, setHasError] = React.useState(false);\r\n\r\n const onFinish = async (values: any) => {\r\n if (values.username && values.password) {\r\n setHasError(false);\r\n\r\n const data = {\r\n client_id: config.clientId,\r\n grant_type: grantType.password,\r\n username: values.username,\r\n password: values.password,\r\n scope: config.scope,\r\n client_secret: config.clientSecret,\r\n };\r\n setLoading(true);\r\n const res = await loginByPassword(qs.stringify(data));\r\n\r\n if (res.access_token) {\r\n setToken(res.access_token);\r\n await getUserRoles(res.access_token);\r\n setLoading(false);\r\n\r\n storeAuthUser({ name: \"test\", staff: true });\r\n User.resetUser();\r\n props.history.push(`/dashboard`);\r\n } else {\r\n setLoading(false);\r\n messageHelper.error(res.message);\r\n // setHasError(true);\r\n }\r\n } else {\r\n setHasError(true);\r\n }\r\n };\r\n\r\n const getUserRoles = async (token: string) => {\r\n const currentUser = decode(token);\r\n const { sub } = currentUser;\r\n\r\n if (sub) {\r\n const res = await GetUserRoles(sub);\r\n if (res.success) {\r\n setCurrentUserRole(res.roles);\r\n }\r\n }\r\n };\r\n\r\n const onForgotPassword = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n messageHelper.confirmDialog(Lang[\"forget.password.confirm.content\"], {\r\n header: Lang[\"forget.password.confirm.header\"],\r\n hideRejectButton: true,\r\n });\r\n };\r\n\r\n const formik = useFormik({\r\n initialValues: {\r\n username: \"\",\r\n password: \"\",\r\n },\r\n onSubmit: (data) => {\r\n if (!data.username || !data.password) {\r\n setHasError(true);\r\n return;\r\n }\r\n setHasError(false);\r\n\r\n onFinish(data);\r\n },\r\n });\r\n return (\r\n
\r\n
e-Client Login
\r\n\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n {hasError && (\r\n \r\n {Lang[\"invalid.username.or.password\"]}\r\n
\r\n )}\r\n
\r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n {\r\n onForgotPassword(e);\r\n }}\r\n href={`${config.identityServerURL}/Account/ForgotPassword`}\r\n >\r\n Forgot password?\r\n \r\n
\r\n\r\n \r\n\r\n \r\n );\r\n};\r\n\r\nexport default SignInForm;\r\n","import * as React from \"react\";\r\nimport { DataTable } from \"primereact/datatable\";\r\nimport { Column } from \"primereact/column\";\r\nimport {\r\n getFilterMatchModel,\r\n renderMoneyWithCurrencyCode,\r\n toGBFSDateFormatStr,\r\n} from \"@/utils/common-helper\";\r\nimport DateFilter from \"@/components/CustomTableFilter/DateFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport moment from \"moment\";\r\n\r\ninterface ITransactionReportTableProps {\r\n tableData: Loan.TransactionReportListItem[];\r\n}\r\n\r\nconst TransactionReportTable: React.FunctionComponent = (props) => {\r\n const { tableData } = props;\r\n\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n const clearBeforeFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n };\r\n\r\n clearBeforeFilters();\r\n }, [tableData]);\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const clearFilters = () => {\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n };\r\n\r\n return (\r\n \r\n {\r\n return toGBFSDateFormatStr(rowData?.valueDate as any);\r\n }}\r\n filter\r\n filterElement={}\r\n style={{ width: 120 }}\r\n >\r\n {\r\n return
\r\n
{rowData.transactionDescription || ''}
\r\n
\r\n {\r\n rowData.paidDetails?.map(i => {\r\n return
\r\n - Due \r\n {i?.dueDate ? moment(i?.dueDate).format(\"DD/MMM/YYYY\") : \"\"}{' '}\r\n {renderMoneyWithCurrencyCode(i.amount, '$')}\r\n
\r\n })\r\n }\r\n
\r\n
;\r\n }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.deposit as any, \"$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.withdrawal as any, \"$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 120, textAlign: \"right\" }}\r\n >\r\n\r\n {\r\n return renderMoneyWithCurrencyCode(rowData?.runningBalance as any, \"$\");\r\n }}\r\n filter\r\n filterElement={\r\n \r\n }\r\n style={{ width: 130, textAlign: \"right\" }}\r\n >\r\n \r\n }\r\n >\r\n\r\n
\r\n );\r\n};\r\n\r\nexport default TransactionReportTable;\r\n","import * as React from \"react\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport SelectAccount from \"./components/SelectAccount\";\r\nimport { GetInstalmentTransction } from \"@/services/factoring\";\r\nimport { LoadingAnimation } from \"@/utils/loading-animation\";\r\nimport TransactionReportTable from \"./components/TransactionReportTable\";\r\nimport { toDateTimesNumber } from \"@/utils/common-helper\";\r\n\r\nconst TransactionReport: React.FunctionComponent = () => {\r\n const [tableData, setTableData] = React.useState();\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n const hasError = (res: any) => {\r\n if (!mountedRef.current) {\r\n return true;\r\n }\r\n if (!res?.success) {\r\n if (res?.message) {\r\n messageHelper.warn(res.message);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const onSearch = React.useCallback(async (loanAccountId?: string, beginDate?: string, endDate?: string) => {\r\n if (!loanAccountId || !beginDate || !endDate) {\r\n setTableData(undefined);\r\n return;\r\n }\r\n LoadingAnimation.show();\r\n const res = await GetInstalmentTransction({\r\n loanAccountId,\r\n beginDate,\r\n endDate,\r\n });\r\n LoadingAnimation.hide();\r\n\r\n if (!hasError(res)) {\r\n setTableData(\r\n res.result?.transactions?.map((i: any) => {\r\n return {\r\n ...i,\r\n valueDate: toDateTimesNumber(i.valueDate as any) as any,\r\n };\r\n })\r\n );\r\n }\r\n }, []);\r\n\r\n return (\r\n
\r\n
\r\n Transaction Report\r\n
\r\n
\r\n
\r\n \r\n {tableData && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default TransactionReport;\r\n","import * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport { formatItemValueByFieldType, renderMoneyWithCurrencyCode } from \"@/utils/common-helper\";\r\nimport { GBFSDataType } from \"@/utils/enums\";\r\nimport { Button } from \"primereact/button\";\r\nimport clsx from \"clsx\";\r\nimport { gbfsContentWithNone } from \"@/utils/common-contents\";\r\nimport { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\n\r\nconst tableFields = {\r\n date: {\r\n label: \"Created Date\",\r\n field: \"createdDate\",\r\n },\r\n account: {\r\n label: \"Account\",\r\n field: \"account\",\r\n },\r\n customer: {\r\n label: \"Customer\",\r\n field: \"customer\",\r\n },\r\n customerLimit: {\r\n label: \"Customer Limit\",\r\n field: \"customerLimit\",\r\n },\r\n branch: {\r\n label: \"Branch\",\r\n field: \"branch\",\r\n },\r\n};\r\n\r\nconst getRowKey = (rowData: any) => {\r\n return `${rowData.clientEncodedKey}-${rowData.clientAccountId}-${rowData.customerEncodedKey}`;\r\n};\r\n\r\ninterface ICustomerStatementTableProps {\r\n data: any[];\r\n loading: boolean;\r\n}\r\n\r\nconst CustomerStatementTable: React.FunctionComponent = (props) => {\r\n const { data: initTableData, loading } = props;\r\n const [tableData, setTableData] = React.useState(initTableData);\r\n\r\n const [tableDataMapCache, setTableDataMapCache] = React.useState<{\r\n currentTableDataMap: Map;\r\n }>();\r\n\r\n const [showLastPayment, setShowLastPayment] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const handleTableData = () => {\r\n const currentTableDataMap = new Map();\r\n\r\n const accountData1Map = new Map();\r\n\r\n initTableData?.forEach((i) => {\r\n const key = getRowKey(i);\r\n\r\n if (accountData1Map.get(i.clientAccountId)) {\r\n accountData1Map.get(i.clientAccountId).push(i);\r\n } else {\r\n accountData1Map.set(i.clientAccountId, [i]);\r\n }\r\n\r\n if (currentTableDataMap.get(key)) {\r\n currentTableDataMap.get(key).push(i);\r\n } else {\r\n currentTableDataMap.set(key, [i]);\r\n }\r\n });\r\n\r\n const newTableData = initTableData?.map((rowData) => {\r\n const key = getRowKey(rowData);\r\n const currentRowIndex = currentTableDataMap.get(key)?.findIndex((i: any) => i === rowData);\r\n\r\n const showAccount =\r\n accountData1Map.get(rowData.clientAccountId)?.findIndex((i: any) => i === rowData) === 0;\r\n\r\n if (currentTableDataMap.get(key)?.length > 1) {\r\n if (currentRowIndex === 0) {\r\n return {\r\n ...rowData,\r\n account: showAccount ? rowData.account : \"\",\r\n showExpendBranchIcon: true,\r\n };\r\n }\r\n return {\r\n ...rowData,\r\n customer: \"\",\r\n account: \"\",\r\n customerLimit: null,\r\n showExpendBranchIcon: false,\r\n };\r\n }\r\n\r\n return {\r\n ...rowData,\r\n account: showAccount ? rowData.account : \"\",\r\n };\r\n });\r\n\r\n setTableData(newTableData);\r\n\r\n setTableDataMapCache({\r\n currentTableDataMap,\r\n });\r\n };\r\n\r\n handleTableData();\r\n }, [initTableData]);\r\n\r\n const totalBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.totalAmount, rowData?.currency?.fundingSymbol);\r\n };\r\n const notDueBodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.notDue, rowData?.currency?.fundingSymbol);\r\n };\r\n const dayRange1BodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.dayRange1Amount, rowData?.currency?.fundingSymbol);\r\n };\r\n const dayRange2BodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.dayRange2Amount, rowData?.currency?.fundingSymbol);\r\n };\r\n const dayRange3BodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.dayRange3Amount, rowData?.currency?.fundingSymbol);\r\n };\r\n const dayRange4BodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.dayRange4Amount, rowData?.currency?.fundingSymbol);\r\n };\r\n const dayRange5BodyTemplate = (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.dayRange5Amount, rowData?.currency?.fundingSymbol);\r\n };\r\n\r\n const columns: (CustomTableColumnProps & { hide?: boolean })[] = [\r\n {\r\n field: tableFields.account.field,\r\n header: tableFields.account.label,\r\n style: {\r\n width: 140,\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n },\r\n },\r\n {\r\n field: tableFields.customer.field,\r\n header: tableFields.customer.label,\r\n style: {\r\n width: 100,\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n },\r\n },\r\n\r\n {\r\n field: tableFields.customerLimit.field,\r\n header: tableFields.customerLimit.label,\r\n style: {\r\n width: 110,\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n textAlign: \"right\",\r\n },\r\n body: (rowData: any) => {\r\n if (rowData.customerLimit === null) {\r\n return \"\";\r\n }\r\n return renderMoneyWithCurrencyCode(rowData.customerLimit, rowData?.currency?.fundingSymbol);\r\n },\r\n },\r\n {\r\n field: \"expand\",\r\n header: \"\",\r\n body: (rowData: any) => {\r\n const breakdownClickHandler = () => {\r\n if (rowData?.branchExpand === true) {\r\n const getShinkTableData = (preTableData: any[], tableDataMap?: Map) => {\r\n if (!tableDataMap) {\r\n return [];\r\n }\r\n const rowKey = getRowKey(rowData);\r\n\r\n const rowIndex = preTableData.findIndex((i: any) => rowKey === getRowKey(i));\r\n\r\n const shrinkRows = tableDataMap.get(rowKey);\r\n\r\n const newCurrentTableData = [...preTableData];\r\n\r\n const shinkRowsTotal = (shrinkRows as any[]).reduce(\r\n (sum, current) => {\r\n return {\r\n totalAmount: sum.totalAmount + current.totalAmount,\r\n notDue: sum.notDue + current.notDue,\r\n dayRange1Amount: sum.dayRange1Amount + current.dayRange1Amount,\r\n dayRange2Amount: sum.dayRange2Amount + current.dayRange2Amount,\r\n dayRange3Amount: sum.dayRange3Amount + current.dayRange3Amount,\r\n dayRange4Amount: sum.dayRange4Amount + current.dayRange4Amount,\r\n dayRange5Amount: sum.dayRange5Amount + current.dayRange5Amount,\r\n };\r\n },\r\n {\r\n totalAmount: 0,\r\n notDue: 0,\r\n dayRange1Amount: 0,\r\n dayRange2Amount: 0,\r\n dayRange3Amount: 0,\r\n dayRange4Amount: 0,\r\n dayRange5Amount: 0,\r\n }\r\n );\r\n newCurrentTableData.splice(rowIndex, shrinkRows?.length || 0, {\r\n ...rowData,\r\n ...shinkRowsTotal,\r\n branch: \"...\",\r\n branchExpand: false,\r\n });\r\n\r\n return newCurrentTableData;\r\n };\r\n\r\n setTableData((pre) => {\r\n return getShinkTableData(pre, tableDataMapCache?.currentTableDataMap);\r\n });\r\n } else {\r\n const getExpandTableData = (preTableData: any[], tableDataMap?: Map) => {\r\n if (!tableDataMap) {\r\n return [];\r\n }\r\n const rowKey = getRowKey(rowData);\r\n\r\n const rowIndex = preTableData.findIndex((i: any) => rowKey === getRowKey(i));\r\n\r\n const expandRows = tableDataMap.get(rowKey)?.map((i: any, index: any) => {\r\n if (index === 0) {\r\n return {\r\n ...i,\r\n account: rowData.account,\r\n showExpendBranchIcon: true,\r\n };\r\n }\r\n return {\r\n ...i,\r\n customer: \"\",\r\n account: \"\",\r\n customerLimit: null,\r\n showExpendBranchIcon: false,\r\n };\r\n });\r\n\r\n const newData = [...preTableData];\r\n newData.splice(rowIndex, 1, ...expandRows);\r\n return newData;\r\n };\r\n\r\n setTableData((pre: any) => {\r\n return getExpandTableData(pre, tableDataMapCache?.currentTableDataMap);\r\n });\r\n }\r\n };\r\n return (\r\n
\r\n {rowData.showExpendBranchIcon && (\r\n
\r\n \r\n \r\n \r\n
\r\n )}\r\n
\r\n );\r\n },\r\n style: { width: 30 },\r\n },\r\n {\r\n field: tableFields.branch.field,\r\n header: tableFields.branch.label,\r\n body: (rowData: any) => {\r\n return (\r\n
\r\n {gbfsContentWithNone(rowData.branch)}{\" \"}\r\n
\r\n );\r\n },\r\n style: { width: 60 },\r\n },\r\n {\r\n field: \"Total Debts\",\r\n header: \"Total Debts\",\r\n body: totalBodyTemplate,\r\n style: { textAlign: \"right\", width: 90, borderLeft: \"solid 1px #ccc\" },\r\n },\r\n {\r\n field: \"Last Payment\",\r\n header: \"Last Payment\",\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData.lastPayment, rowData?.currency?.fundingSymbol);\r\n },\r\n style: { textAlign: \"right\", width: 90 },\r\n hide: !showLastPayment,\r\n },\r\n {\r\n field: \"Last Payment Date\",\r\n header: \"Last Payment Date\",\r\n body: (rowData: any) => {\r\n return formatItemValueByFieldType(rowData.lastPaymentDate, GBFSDataType.Date);\r\n },\r\n style: { width: 121 },\r\n hide: !showLastPayment,\r\n },\r\n {\r\n field: \"Current\",\r\n header: \"Current\",\r\n body: notDueBodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 36 : 0) },\r\n },\r\n {\r\n field: \"1 - 30 Days\",\r\n header: \"1 - 30 Days\",\r\n body: dayRange1BodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 35 : 0) },\r\n },\r\n {\r\n field: \"31 - 60 Days\",\r\n header: \"31 - 60 Days\",\r\n body: dayRange2BodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 35 : 0) },\r\n },\r\n {\r\n field: \"61 - 90 Days\",\r\n header: \"61 - 90 Days\",\r\n body: dayRange3BodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 35 : 0) },\r\n },\r\n {\r\n field: \"91 - 180 Days\",\r\n header: \"91 - 180 Days\",\r\n body: dayRange4BodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 35 : 0) },\r\n },\r\n {\r\n field: \"> 180 Days\",\r\n header: \"> 180 Days\",\r\n body: dayRange5BodyTemplate,\r\n style: { textAlign: \"right\", width: 90 + (!showLastPayment ? 35 : 0) },\r\n },\r\n ].filter((i) => !i.hide);\r\n\r\n const getTotal = (data: any[]) => {\r\n return data?.reduce(\r\n (result, currentItem) => {\r\n return {\r\n totalCustomerLimit: result.totalCustomerLimit + currentItem.customerLimit || 0,\r\n totalAmount: result.totalAmount + currentItem.totalAmount || 0,\r\n totalLastPayment: result.totalLastPayment + currentItem.lastPayment || 0,\r\n notDue: result.notDue + currentItem.notDue || 0,\r\n dayRange1Amount: result.dayRange1Amount + currentItem.dayRange1Amount || 0,\r\n dayRange2Amount: result.dayRange2Amount + currentItem.dayRange2Amount || 0,\r\n dayRange3Amount: result.dayRange3Amount + currentItem.dayRange3Amount || 0,\r\n dayRange4Amount: result.dayRange4Amount + currentItem.dayRange4Amount || 0,\r\n dayRange5Amount: result.dayRange5Amount + currentItem.dayRange5Amount || 0,\r\n };\r\n },\r\n {\r\n totalCustomerLimit: 0,\r\n totalAmount: 0,\r\n totalLastPayment: 0,\r\n notDue: 0,\r\n dayRange1Amount: 0,\r\n dayRange2Amount: 0,\r\n dayRange3Amount: 0,\r\n dayRange4Amount: 0,\r\n dayRange5Amount: 0,\r\n }\r\n );\r\n };\r\n\r\n const footerGroup = (tableData: any[]) => {\r\n const total = getTotal(tableData);\r\n\r\n const {\r\n totalAmount,\r\n notDue,\r\n totalLastPayment,\r\n dayRange1Amount,\r\n dayRange2Amount,\r\n dayRange3Amount,\r\n dayRange4Amount,\r\n dayRange5Amount,\r\n totalCustomerLimit,\r\n } = total;\r\n\r\n const totalArray = [\r\n totalAmount,\r\n\r\n notDue,\r\n dayRange1Amount,\r\n dayRange2Amount,\r\n dayRange3Amount,\r\n dayRange4Amount,\r\n dayRange5Amount,\r\n ];\r\n if (showLastPayment) {\r\n totalArray.splice(1, 0, totalLastPayment, null);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {totalArray.map((i, index) => {\r\n if (i === null) {\r\n return \"\";\r\n }\r\n return (\r\n \r\n );\r\n })}\r\n \r\n \r\n );\r\n };\r\n\r\n const headerGroup = () => {\r\n let header = \"Current\";\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Total Debts\r\n \r\n {\r\n setShowLastPayment(!showLastPayment);\r\n }}\r\n tooltip={showLastPayment ? \"Hide Last Payment\t\" : \"View Last Payment\t\"}\r\n tooltipOptions={{ position: \"top\", showDelay: 0 }}\r\n >\r\n \r\n \r\n \r\n \r\n }\r\n style={{ textAlign: \"right\", borderLeft: \"solid 1px #ccc\" }}\r\n />\r\n {showLastPayment && }\r\n {showLastPayment && }\r\n \r\n \r\n \r\n \r\n \r\n 180 Days\" style={{ textAlign: \"right\" }} />\r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default CustomerStatementTable;\r\n","import { Dropdown } from \"primereact/dropdown\";\r\nimport * as React from \"react\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport {\r\n GetViewDaysAgeingReportTaskStatus,\r\n RunViewDaysAgeingReportTask,\r\n} from \"@/services/factoring\";\r\nimport { convertMambuErrorMessage, toGBFSDateTimeFormatStr } from \"@/utils/common-helper\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport OverdueAnalysisTable from \"./OverdueAnalysisTable\";\r\n\r\nconst someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nlet retryAfter = 2000;\r\nconst OverdueAnalysis: React.FunctionComponent = () => {\r\n const [tableData, setTableData] = React.useState([]);\r\n\r\n const [lastUpdatedTime, setLastUpdatedTime] = React.useState();\r\n\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n const [choosenCurreny, setChoosenCurreny] = React.useState();\r\n const [currencyOptions, setCurrencyOptions] = React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >([]);\r\n\r\n const displayTableData = React.useMemo(() => {\r\n return (\r\n tableData?.filter((i) => {\r\n return i.currency.currencyCode === choosenCurreny;\r\n }) || []\r\n );\r\n }, [tableData, choosenCurreny]);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n const getAgeing = React.useCallback(async () => {\r\n const getViewDaysAgeingReportTaskStatus = async (taskId: string, maxRetryAfter: number) => {\r\n const taskRes = await GetViewDaysAgeingReportTaskStatus(taskId);\r\n if (someError(taskRes, mountedRef)) {\r\n return;\r\n }\r\n const result = taskRes.result;\r\n if (result.taskStatus === 3) {\r\n const sourceRes = result.data;\r\n if (sourceRes.success) {\r\n return taskRes;\r\n } else {\r\n return sourceRes;\r\n }\r\n } else if (result.taskStatus === 2) {\r\n // in process\r\n return await new Promise(async (resolve) => {\r\n setTimeout(\r\n async function () {\r\n retryAfter *= 2;\r\n resolve(await getViewDaysAgeingReportTaskStatus(taskId, maxRetryAfter));\r\n },\r\n retryAfter > maxRetryAfter ? maxRetryAfter : retryAfter\r\n );\r\n });\r\n }\r\n };\r\n\r\n const getReport = async () => {\r\n const getReportTaskId = async () => {\r\n const res = await RunViewDaysAgeingReportTask();\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n return res.result?.taskId;\r\n };\r\n\r\n const taskId = await getReportTaskId();\r\n\r\n if (!taskId) {\r\n return;\r\n }\r\n\r\n const res = await getViewDaysAgeingReportTaskStatus(taskId, 15000);\r\n if (someError(res, mountedRef)) {\r\n return;\r\n }\r\n return res.result?.data?.result;\r\n };\r\n\r\n const runGetReportWork = async () => {\r\n const report = await getReport();\r\n\r\n if (report) {\r\n setTableData(\r\n report?.data?.currentResult?.map((i: any) => {\r\n return {\r\n ...i,\r\n branchExpand: true,\r\n clientExpand: true,\r\n showExpendBranchIcon:\r\n report?.data?.currentResult?.filter(\r\n (f: any) =>\r\n f.clientEncodedKey === i.clientEncodedKey &&\r\n f.clientAccountId === i.clientAccountId &&\r\n f.customerEncodedKey === i.customerEncodedKey\r\n ) > 1 && i.defaultBranch,\r\n };\r\n })\r\n );\r\n\r\n setLastUpdatedTime(report.createdDate);\r\n\r\n const currencySet = new Set();\r\n (report?.data?.currentResult as any[]).forEach((i) => {\r\n currencySet.add(i.currency.fundingCurrencyCode);\r\n });\r\n setCurrencyOptions(\r\n Array.from(currencySet).map((i) => {\r\n return {\r\n label: i,\r\n value: i,\r\n };\r\n })\r\n );\r\n\r\n setChoosenCurreny(Array.from(currencySet)?.[0]);\r\n }\r\n };\r\n\r\n await runGetReportWork();\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n const init = async () => {\r\n setLoading(true);\r\n await getAgeing();\r\n setLoading(false);\r\n };\r\n\r\n init();\r\n }, [getAgeing]);\r\n\r\n return (\r\n
\r\n

Ageing

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n setChoosenCurreny(e.value)}\r\n placeholder=\"Funding Currency\"\r\n style={{ minWidth: \"140px\" }}\r\n className=\"p-mr-4\"\r\n />\r\n {lastUpdatedTime && (\r\n \r\n {`Last updated at ${toGBFSDateTimeFormatStr(\r\n lastUpdatedTime\r\n )}`}\r\n \r\n )}\r\n
\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default OverdueAnalysis;\r\n","import { Column } from \"primereact/column\";\r\nimport { ColumnGroup } from \"primereact/columngroup\";\r\nimport { Row } from \"primereact/row\";\r\nimport * as React from \"react\";\r\nimport CustomTable, { CustomTableColumnProps } from \"@/components/CustomTable\";\r\nimport {\r\n convertMambuErrorMessage,\r\n getFilterMatchModel,\r\n renderMoneyWithCurrencyCode,\r\n} from \"@/utils/common-helper\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Dropdown } from \"primereact/dropdown\";\r\nimport { Card } from \"primereact/card\";\r\nimport MultiSelectFilter from \"@/components/CustomTableFilter/MultiSelectFilter\";\r\nimport NumberFilter from \"@/components/CustomTableFilter/NumberFilter\";\r\nimport { getFundingCurrencyOptions } from \"../utils\";\r\nimport { Lang } from \"@/locales/en-US\";\r\nimport { messageHelper } from \"@/utils/message-helper\";\r\nimport {\r\n GetBorrowerInvestmentSummaryTaskStatus,\r\n RunBorrowerInvestmentSummaryTask,\r\n} from \"@/services/factoring\";\r\n\r\ninterface Options {\r\n accountNo: any[];\r\n product: any[];\r\n accountReference: any[];\r\n}\r\n\r\nconst getOptions = (tableData: any[]) => {\r\n const compareFunction = (a: any, b: any) => {\r\n if (a === b) {\r\n return 0;\r\n }\r\n return a < b ? -1 : 1;\r\n };\r\n\r\n const result: Options = {\r\n accountNo: [],\r\n product: [],\r\n accountReference: [],\r\n };\r\n\r\n const accountNoSet = new Set();\r\n const productSet = new Set();\r\n const accountReferenceSet = new Set();\r\n\r\n tableData.forEach((i) => {\r\n if (!productSet.has(i.product)) {\r\n result.product.push({\r\n label: i.product,\r\n value: i.product,\r\n });\r\n }\r\n if (!accountNoSet.has(i.accountNo)) {\r\n result.accountNo.push({\r\n label: i.accountNo,\r\n value: i.accountNo,\r\n });\r\n }\r\n\r\n if (!accountReferenceSet.has(i.accountReference)) {\r\n result.accountReference.push({\r\n label: i.accountReference,\r\n value: i.accountReference,\r\n });\r\n }\r\n\r\n accountNoSet.add(i.accountNo);\r\n productSet.add(i.product);\r\n accountReferenceSet.add(i.accountReference);\r\n });\r\n\r\n result.accountNo.sort(compareFunction);\r\n result.product.sort(compareFunction);\r\n\r\n return result;\r\n};\r\n\r\nlet retryAfter = 2000;\r\nconst FundingAvailablity: React.FunctionComponent = (props) => {\r\n const [borrowerInvestmentSummary, setBorrowerInvestmentSummary] = React.useState([]);\r\n\r\n const [displayTableData, setDisplayTableData] = React.useState();\r\n const [filteredTableData, setFilteredTableData] = React.useState();\r\n\r\n const [choosenCurreny, setChoosenCurreny] = React.useState();\r\n const [currencyOptions, setCurrencyOptions] = React.useState<\r\n {\r\n label: string;\r\n value: string;\r\n }[]\r\n >();\r\n const [options, setOptions] = React.useState();\r\n const [clearFilter, setClearFilter] = React.useState(0);\r\n\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n const tableRef = React.useRef(null);\r\n\r\n const mountedRef = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n mountedRef.current = true;\r\n\r\n return () => {\r\n mountedRef.current = false;\r\n };\r\n });\r\n\r\n const someError = (res: any, ref: any) => {\r\n if (!ref.current) {\r\n return true;\r\n }\r\n if (!res.success) {\r\n messageHelper.warn(convertMambuErrorMessage(res.error?.message));\r\n return true;\r\n }\r\n if (!res.result) {\r\n messageHelper.warn(Lang[\"result.empty\"]);\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n React.useEffect(() => {\r\n const getBorrowerInvestmentSummaryTaskStatus = async (\r\n taskId: string,\r\n maxRetryAfter: number\r\n ) => {\r\n const taskRes = await GetBorrowerInvestmentSummaryTaskStatus(taskId);\r\n const result = taskRes.result;\r\n if (result.taskStatus === 3) {\r\n const sourceRes = result.data;\r\n if (sourceRes.success) {\r\n setBorrowerInvestmentSummary(sourceRes.result?.filter((i: any) => i.isFactoringLine));\r\n } else {\r\n messageHelper.warn(convertMambuErrorMessage(sourceRes.error?.message));\r\n }\r\n } else if (result.taskStatus === 2) {\r\n // in process\r\n await new Promise((resolve) => {\r\n setTimeout(\r\n async () => {\r\n retryAfter *= 2;\r\n\r\n await getBorrowerInvestmentSummaryTaskStatus(taskId, maxRetryAfter);\r\n resolve(0);\r\n },\r\n retryAfter > maxRetryAfter ? maxRetryAfter : retryAfter\r\n );\r\n });\r\n }\r\n };\r\n\r\n const getBorrowerInvestmentSummaryData = async (endDate?: any) => {\r\n const res = await RunBorrowerInvestmentSummaryTask();\r\n if (!someError(res, mountedRef)) {\r\n if (res?.result?.taskStatus === 1) {\r\n await getBorrowerInvestmentSummaryTaskStatus(res.result?.taskId, res.result?.retryAfter);\r\n }\r\n }\r\n };\r\n\r\n const loadData = async () => {\r\n setLoading(true);\r\n await getBorrowerInvestmentSummaryData();\r\n setLoading(false);\r\n };\r\n\r\n loadData();\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n const newCurrencyOptions = getFundingCurrencyOptions(borrowerInvestmentSummary);\r\n setChoosenCurreny(newCurrencyOptions[0]?.value);\r\n setCurrencyOptions(newCurrencyOptions);\r\n }, [borrowerInvestmentSummary]);\r\n\r\n React.useEffect(() => {\r\n const newDisplayTableData =\r\n borrowerInvestmentSummary?.filter((i) => i.currency.fundingCurrencyCode === choosenCurreny) ||\r\n [];\r\n setDisplayTableData(newDisplayTableData);\r\n setFilteredTableData(newDisplayTableData);\r\n\r\n setOptions(getOptions(newDisplayTableData));\r\n }, [choosenCurreny, borrowerInvestmentSummary]);\r\n\r\n const doFilterNumber = (condition: string, filterNumber: number | undefined, field: string) => {\r\n if (field !== \"\") {\r\n if (condition !== \"\" && filterNumber) {\r\n const fm = getFilterMatchModel(condition);\r\n tableRef.current?.filter(filterNumber, field, fm);\r\n } else {\r\n tableRef.current?.filter(null, field, \"equals\");\r\n }\r\n }\r\n };\r\n\r\n const columns: CustomTableColumnProps[] = [\r\n {\r\n field: \"accountNo\",\r\n header: \"Account no\",\r\n sortable: true,\r\n style: { width: 100 },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"accountReference\",\r\n header: \"Account Reference\",\r\n style: { width: 120 },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"product\",\r\n header: \"Product\",\r\n sortable: true,\r\n style: { width: 160 },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"currentAvailability\",\r\n header: \"Current Availability\",\r\n sortable: true,\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.currentAvailability,\r\n rowData.currency.fundingSymbol\r\n );\r\n },\r\n style: { width: 140, textAlign: \"right\" },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"salesLedgerBalance\",\r\n header: \"Outstanding Debts\",\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.salesLedgerBalance,\r\n rowData.currency.fundingSymbol\r\n );\r\n },\r\n sortable: true,\r\n style: { width: 140, textAlign: \"right\" },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"totalEligible\",\r\n header: \"Total Eligible\",\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.totalEligible, rowData.currency.fundingSymbol);\r\n },\r\n sortable: true,\r\n style: { width: 120, textAlign: \"right\" },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"fundsInUse\",\r\n header: \"Funds in Use / Balance\",\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(rowData?.fundsInUse, rowData.currency.fundingSymbol);\r\n },\r\n sortable: true,\r\n style: { width: 160, textAlign: \"right\" },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n field: \"clientAccountLimit\",\r\n header: \"Client Account Limit\",\r\n body: (rowData: any) => {\r\n return renderMoneyWithCurrencyCode(\r\n rowData?.clientAccountLimit,\r\n rowData.currency.fundingSymbol\r\n );\r\n },\r\n sortable: true,\r\n style: { width: 160, textAlign: \"right\" },\r\n filter: true,\r\n filterElement: () => {\r\n return (\r\n \r\n );\r\n },\r\n },\r\n {\r\n header: \"Action\",\r\n field: \"\" as any,\r\n\r\n style: { width: 80, textAlign: \"center\" },\r\n filter: true,\r\n filterElement: () => {\r\n const clearFilters = () => {\r\n /**\r\n * clear all filter\r\n */\r\n setClearFilter((i) => i + 1);\r\n tableRef.current?.reset();\r\n const newDisplayTableData =\r\n borrowerInvestmentSummary?.filter(\r\n (i) => i.currency.fundingCurrencyCode === choosenCurreny\r\n ) || [];\r\n setDisplayTableData(newDisplayTableData);\r\n setFilteredTableData(newDisplayTableData);\r\n };\r\n\r\n return (\r\n \r\n );\r\n },\r\n },\r\n ];\r\n\r\n const footerGroup = () => {\r\n const total = filteredTableData?.reduce(\r\n (sum, i) => {\r\n return {\r\n currentAvailability: sum.currentAvailability + (i.currentAvailability || 0),\r\n salesLedgerBalance: sum.salesLedgerBalance + (i.salesLedgerBalance || 0),\r\n totalEligible: sum.totalEligible + i.totalEligible || 0,\r\n fundsInUse: sum.fundsInUse + i.fundsInUse || 0,\r\n clientAccountLimit: sum.clientAccountLimit + i.clientAccountLimit || 0,\r\n };\r\n },\r\n {\r\n currentAvailability: 0,\r\n salesLedgerBalance: 0,\r\n totalEligible: 0,\r\n fundsInUse: 0,\r\n clientAccountLimit: 0,\r\n }\r\n );\r\n\r\n const totalArray = [\r\n total?.currentAvailability,\r\n total?.salesLedgerBalance,\r\n total?.totalEligible,\r\n total?.fundsInUse,\r\n total?.clientAccountLimit,\r\n ];\r\n\r\n const currencyFundingSymbol = filteredTableData?.[0]?.currency?.fundingSymbol;\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n {totalArray.map((i) => {\r\n return (\r\n \r\n );\r\n })}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n \r\n {\r\n setFilteredTableData(value);\r\n }}\r\n scrollable={false}\r\n columns={columns}\r\n sortField=\"product\"\r\n sortOrder={1}\r\n footerColumnGroup={footerGroup()}\r\n header={\r\n setChoosenCurreny(e.value)}\r\n placeholder=\"Currency\"\r\n style={{ display: \"inline-flex\" }}\r\n />\r\n }\r\n loading={loading}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default FundingAvailablity;\r\n","import { RouteProps, Redirect } from \"react-router\";\r\nimport ChangePassword from \"./page/ChangePassword\";\r\nimport Dashboard from \"./page/Dashboard\";\r\nimport Logout from \"./page/Logout\";\r\nimport ClientStatement from \"./page/Factoring/ClientStatement\";\r\nimport CustomerPayment from \"./page/Factoring/CustomerPayment\";\r\nimport CustomerStatement from \"./page/Factoring/CustomerStatement\";\r\nimport UserProfile from \"./page/UserProfile\";\r\nimport UserManagement from \"./page/UserManagement\";\r\nimport ScheduleOfInvoices from \"./page/Factoring/ScheduleOfInvoices\";\r\nimport LoanStatement from \"./page/Loan/LoanStatement/index\";\r\nimport InstalmentSchedule from \"./page/Loan/InstalmentSchedule\";\r\nimport TransactionReport from \"./page/Loan/TransactionReport\";\r\nimport OverdueAnalysis from \"./page/Factoring/OverdueAnalysis\";\r\nimport FundingAvailablity from \"./page/Factoring/FundingAvailablity\";\r\n\r\nexport const protectedRoutes: RouteProps[] = [\r\n {\r\n path: \"/logout\",\r\n component: Logout,\r\n },\r\n {\r\n path: \"/dashboard\",\r\n component: Dashboard,\r\n },\r\n {\r\n path: \"/userProfile\",\r\n component: UserProfile,\r\n },\r\n // {\r\n // path: \"/user\",\r\n // component: UserList,\r\n // },\r\n // {\r\n // path: \"/user/addUser\",\r\n // component: AddUser,\r\n // },\r\n // {\r\n // path: \"/help\",\r\n // component: Help,\r\n // },\r\n // {\r\n // path: \"/invoice\",\r\n // component: Invoice,\r\n // },\r\n {\r\n path: \"/changePassword\",\r\n component: ChangePassword,\r\n },\r\n // {\r\n // path: \"/loans/detail\",\r\n // component: LoanDetail,\r\n // },\r\n // {\r\n // path: \"/loans/consolidatedLoans\",\r\n // component: ConsolidatedLoans,\r\n // },\r\n {\r\n path: \"/loans/instalmentSchedule\",\r\n component: InstalmentSchedule,\r\n },\r\n // {\r\n // path: \"/loans/amountDue\",\r\n // component: AmountDue,\r\n // },\r\n // {\r\n // path: \"/loans/debitAdvice\",\r\n // component: DebitAdvice,\r\n // },\r\n // {\r\n // path: \"/loans/debitAdvice/loan/:loanReferenceId\",\r\n // component: DebitAdviceDetail,\r\n // },\r\n // {\r\n // path: \"/loans/debitAdvice/advice/:adviceReferenceId\",\r\n // component: DebitAdviceDetail,\r\n // },\r\n {\r\n path: \"/loans/loansStatement\",\r\n component: LoanStatement,\r\n },\r\n {\r\n path: \"/loans/transactionReport\",\r\n component: TransactionReport,\r\n },\r\n // {\r\n // path: \"/factoring/overview\",\r\n // component: FactoringOverview,\r\n // },\r\n {\r\n path: \"/factoring/fundingAvailablity\",\r\n component: FundingAvailablity,\r\n },\r\n {\r\n path: \"/factoring/customerStatement\",\r\n component: CustomerStatement,\r\n },\r\n {\r\n path: \"/factoring/customerPayment\",\r\n component: CustomerPayment,\r\n },\r\n {\r\n path: \"/factoring/scheduleOfInvoices\",\r\n component: ScheduleOfInvoices,\r\n },\r\n {\r\n path: \"/factoring/clientStatement\",\r\n component: ClientStatement,\r\n },\r\n {\r\n path: \"/factoring/overdueAnalysis\",\r\n component: OverdueAnalysis,\r\n },\r\n\r\n // {\r\n // path: \"/factoring/creditCustomerLimit\",\r\n // component: CreditCustomerLimit,\r\n // },\r\n\r\n {\r\n path: \"/userManagement\",\r\n component: UserManagement,\r\n },\r\n {\r\n path: \"/*\",\r\n component: () => ,\r\n },\r\n];\r\n","import * as React from \"react\";\r\nimport { Suspense } from \"react\";\r\nimport { Switch, useHistory } from \"react-router-dom\";\r\nimport { GuardProvider, GuardedRoute } from \"react-router-guards\";\r\nimport { GuardToRoute } from \"react-router-guards/dist/types\";\r\nimport { Sidebar } from \"primereact/sidebar\";\r\nimport { PanelMenu } from \"primereact/panelmenu\";\r\nimport { protectedRoutes } from \"../Routes\";\r\nimport { authUser, getCurrentUser } from \"../services/CacheService\";\r\n\r\nimport clsx from \"clsx\";\r\nimport styles from \"./index.module.scss\";\r\nimport { Skeleton } from \"primereact/skeleton\";\r\nimport { MenuItem } from \"primereact/components/menuitem/MenuItem\";\r\nimport User from \"@/services/user\";\r\n\r\nconst adminRoute = [\"/userManagement\", \"/invoice\"];\r\n\r\nconst requireLogin = (to: GuardToRoute, _from: any, next: any) => {\r\n const getIsLoggedIn = () => {\r\n const user = authUser();\r\n if (user) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n if (adminRoute.includes(to.location.pathname)) {\r\n if (User.isAdmin || User.isGBFSAdmin) {\r\n next();\r\n } else {\r\n next.redirect(`/dashboard`);\r\n }\r\n return;\r\n }\r\n\r\n if (getIsLoggedIn()) {\r\n next();\r\n } else {\r\n next.redirect(`/signIn`);\r\n }\r\n};\r\n\r\n// let timer: NodeJS.Timeout;\r\nconst BaseLayout: React.FC = (props: any) => {\r\n const [mobileOpen, setMobileOpen] = React.useState(false);\r\n const history = useHistory();\r\n\r\n const companyName = React.useMemo(() => {\r\n return getCurrentUser()?.company || \"\";\r\n }, []);\r\n\r\n /**\r\n * Logout if 5 minutes no operation\r\n */\r\n // React.useEffect(() => {\r\n // if (process.env.NODE_ENV === \"development\") {\r\n // return;\r\n // }\r\n\r\n // const setTimer = () => {\r\n // if (timer) {\r\n // clearTimeout(timer);\r\n // }\r\n // timer = setTimeout(() => {\r\n // window.location.pathname = \"logout\";\r\n // }, 1000 * 60 * 5);\r\n // };\r\n\r\n // const debounceSetTimerFun = debounce(setTimer, 300);\r\n\r\n // if (window.location.pathname !== \"/signIn\" && window.location.pathname !== \"/logout\") {\r\n // window.addEventListener(\"mousemove\", debounceSetTimerFun);\r\n // window.addEventListener(\"touchend\", debounceSetTimerFun);\r\n // debounceSetTimerFun();\r\n // }\r\n\r\n // return () => {\r\n // if (process.env.NODE_ENV === \"development\") {\r\n // return;\r\n // }\r\n\r\n // if (window.location.pathname !== \"/signIn\" && window.location.pathname !== \"/logout\") {\r\n // window.removeEventListener(\"mousemove\", debounceSetTimerFun);\r\n // window.removeEventListener(\"touchend\", debounceSetTimerFun);\r\n // clearTimeout(timer);\r\n // }\r\n // };\r\n // }, []);\r\n\r\n const topItems: MenuItem[] = React.useMemo(() => {\r\n return [\r\n {\r\n label: \"Dashboard\",\r\n icon: \"pi pi-fw pi-home\",\r\n command: () => {\r\n history.push(\"/dashboard\");\r\n },\r\n className: styles.itemIsNull,\r\n },\r\n {\r\n label: \"Loans\",\r\n icon: \"pi pi-fw pi-file\",\r\n items: [\r\n {\r\n label: \"Instalment Schedule\",\r\n command: () => {\r\n history.push(\"/loans/instalmentSchedule\");\r\n },\r\n },\r\n {\r\n label: \"Loans Statement\",\r\n command: () => {\r\n history.push(\"/loans/loansStatement\");\r\n },\r\n },\r\n {\r\n label: \"Transaction Report\",\r\n command: () => {\r\n history.push(\"/loans/transactionReport\");\r\n },\r\n },\r\n ],\r\n },\r\n {\r\n label: \"Factoring\",\r\n icon: \"pi pi-fw pi-list\",\r\n items: [\r\n {\r\n label: \"Funding Availability\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/fundingAvailablity\");\r\n },\r\n },\r\n {\r\n label: \"Client Statement\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/clientStatement\");\r\n },\r\n },\r\n {\r\n label: \"Customer Statement\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/customerStatement\");\r\n },\r\n },\r\n {\r\n label: \"Customer Payment\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/customerPayment\");\r\n },\r\n },\r\n {\r\n label: \"Schedule of Invoices\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/scheduleOfInvoices\");\r\n },\r\n },\r\n {\r\n label: \"Ageing\",\r\n icon: \"pi pi-fw pi-file\",\r\n command: () => {\r\n history.push(\"/factoring/overdueAnalysis\");\r\n },\r\n },\r\n ],\r\n },\r\n ];\r\n }, [history]);\r\n\r\n const bottomItems: MenuItem[] = React.useMemo(() => {\r\n const baseItems = [\r\n {\r\n label: \"User Profile\",\r\n icon: \"pi pi-fw pi-user\",\r\n command: () => {\r\n history.push(\"/userProfile\");\r\n },\r\n className: styles.itemIsNull,\r\n },\r\n {\r\n label: \"Change Password\",\r\n icon: \"pi pi-fw pi-undo\",\r\n command: () => {\r\n history.push(\"/changePassword\");\r\n },\r\n className: styles.itemIsNull,\r\n },\r\n {\r\n label: \"Logout\",\r\n icon: \"pi pi-fw pi-sign-out\",\r\n command: () => {\r\n history.push(\"/logout\");\r\n },\r\n className: styles.itemIsNull,\r\n },\r\n ];\r\n\r\n const adminOnlyItems: any[] = [\r\n {\r\n label: \"User Management\",\r\n icon: \"pi pi-fw pi-user-plus\",\r\n command: () => {\r\n history.push(\"/userManagement\");\r\n },\r\n className: styles.itemIsNull,\r\n },\r\n ];\r\n\r\n if (User.isAdmin || User.isGBFSAdmin) {\r\n return [...adminOnlyItems, ...baseItems];\r\n }\r\n\r\n return baseItems;\r\n }, [history]);\r\n\r\n const drawer = (\r\n \r\n
\r\n \"\"\r\n \r\n {companyName}\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n );\r\n\r\n return (\r\n
\r\n
\r\n {\r\n setMobileOpen(true);\r\n }}\r\n >\r\n \r\n \r\n
\r\n\r\n {\r\n setMobileOpen(false);\r\n }}\r\n className={styles.mobileCustomSider}\r\n >\r\n {drawer}\r\n \r\n\r\n {}} className={styles.customSider}>\r\n {drawer}\r\n \r\n\r\n
\r\n \r\n }>\r\n \r\n {protectedRoutes.map((route, i) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default BaseLayout;\r\n","import * as React from 'react';\r\n\r\ninterface IRowGapProps {\r\n baseHeight: string\r\n}\r\n\r\nconst RowGap: React.FunctionComponent = ({ baseHeight = 10 }) => {\r\n return
;\r\n};\r\n\r\nexport default RowGap;\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from \"react-router-dom\";\r\nimport styles from './index.module.scss';\r\nimport SignInForm from './SignInForm';\r\nimport RowGap from './RowGap';\r\n\r\ninterface ISignInV2Props extends RouteComponentProps {\r\n}\r\n\r\nconst SignInV2: React.FunctionComponent = (props) => {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n © 2023 GB Helios Pte Ltd. All rights reserved. {' '}\r\n \r\n Privacy Policy\r\n \r\n |\r\n \r\n Disclaimer/Terms & Conditions\r\n \r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SignInV2;\r\n","import React from \"react\";\r\nimport { Router, Switch, Route } from \"react-router-dom\";\r\nimport { createBrowserHistory } from \"history\";\r\nimport \"font-awesome/css/font-awesome.min.css\";\r\nimport \"primereact/resources/themes/saga-green/theme.css\";\r\nimport \"primereact/resources/primereact.min.css\";\r\nimport \"primeicons/primeicons.css\";\r\nimport \"primeflex/primeflex.css\";\r\nimport { Toast } from \"primereact/toast\";\r\n\r\nimport \"./App.css\";\r\n\r\nimport BaseLayout from \"./layout/BaseLayout\";\r\nimport SignInV2 from \"./page/SignInV2\";\r\nimport { messageRef } from \"./utils/message-helper\";\r\n\r\nconst history = createBrowserHistory();\r\n\r\nconst App: React.FC = () => {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default App;\r\n","const reportWebVitals = onPerfEntry => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport \"./index.scss\";\r\nimport App from './App';\r\nimport reportWebVitals from './reportWebVitals';\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"menuStatement\":\"factoring_menuStatement__N4BjY\",\"a-r-title\":\"factoring_a-r-title__2txXo\",\"no-data\":\"factoring_no-data__2rdew\",\"g-wrapper-mb-50\":\"factoring_g-wrapper-mb-50__3pEpU\",\"fs\":\"factoring_fs__3O0zG\",\"f-top\":\"factoring_f-top__2dwzE\",\"l-lab\":\"factoring_l-lab__3JS2q\",\"g-wrapper\":\"factoring_g-wrapper__187kg\",\"l-value\":\"factoring_l-value__pN5B0\",\"edit-link-list\":\"factoring_edit-link-list__2cv8W\",\"edit-s-link-cu-wrapper-detail\":\"factoring_edit-s-link-cu-wrapper-detail__XYydv\",\"edit-s-link-cu-wrapper-detail-tran-show\":\"factoring_edit-s-link-cu-wrapper-detail-tran-show__1qgCW\",\"edit-s-link-cu-wrapper-detail-tran-hide\":\"factoring_edit-s-link-cu-wrapper-detail-tran-hide__3JVOf\",\"edit-img\":\"factoring_edit-img__MyWkz\",\"f-prev-edit-input\":\"factoring_f-prev-edit-input__1bhH2\",\"prev-show-edit-btn\":\"factoring_prev-show-edit-btn__1bdZ2\",\"input\":\"factoring_input__1tfXi\",\"l-text-area\":\"factoring_l-text-area__KE2x2\",\"op-wrapper-minFc-details-tran-show\":\"factoring_op-wrapper-minFc-details-tran-show__3LW5s\",\"op-wrapper-minFc-details-tran-hide\":\"factoring_op-wrapper-minFc-details-tran-hide__31iH2\",\"funding-wrapper\":\"factoring_funding-wrapper__BgW8p\",\"g-title\":\"factoring_g-title__397k2\",\"l-place-holder\":\"factoring_l-place-holder__3K5DL\",\"ec\":\"factoring_ec__3KQdX\",\"l-lab-prev\":\"factoring_l-lab-prev__2AjxW\",\"l-value-percent\":\"factoring_l-value-percent__19-W6\",\"req-input\":\"factoring_req-input__Tjgck\",\"p-item\":\"factoring_p-item__2UjPR\",\"total-row\":\"factoring_total-row__1_rvg\",\"op-wrapper-detail\":\"factoring_op-wrapper-detail__25o8a\",\"op-wrapper-ineligible-breakdown-tran-show\":\"factoring_op-wrapper-ineligible-breakdown-tran-show__35ZFx\",\"op-wrapper-ineligible-breakdown-tran-hide\":\"factoring_op-wrapper-ineligible-breakdown-tran-hide__3fHrj\",\"op-wrapper-ineligible-detail-tran-show\":\"factoring_op-wrapper-ineligible-detail-tran-show__9_9sO\",\"op-wrapper-ineligible-detail-tran-hide\":\"factoring_op-wrapper-ineligible-detail-tran-hide__2oEal\",\"op-wrapper-ineligible-detail-sub-tran-show\":\"factoring_op-wrapper-ineligible-detail-sub-tran-show__2dvsc\",\"op-wrapper-ineligible-detail-sub-tran-hide\":\"factoring_op-wrapper-ineligible-detail-sub-tran-hide__1CiVM\",\"op-wrapper-calculator-tran-show\":\"factoring_op-wrapper-calculator-tran-show__1BRQO\",\"op-wrapper-calculator-tran-hide\":\"factoring_op-wrapper-calculator-tran-hide__3N-_k\",\"l-lab-ava\":\"factoring_l-lab-ava__ns2Pu\",\"cu-wrapper\":\"factoring_cu-wrapper__3olBa\",\"fver\":\"factoring_fver__3t8PV\",\"o-tag\":\"factoring_o-tag__2fc3C\",\"facs\":\"factoring_facs__1C0QC\",\"facsbr\":\"factoring_facsbr__1f0gN\",\"f-receipt\":\"factoring_f-receipt__UpAvO\",\"c-item\":\"factoring_c-item__3rSPi\",\"l-col\":\"factoring_l-col__1XkAS\",\"r-col\":\"factoring_r-col__13GUH\",\"f-conact\":\"factoring_f-conact__1ckrl\",\"add-btn-bar-wrapper\":\"factoring_add-btn-bar-wrapper__l84Jf\",\"command-tool-tip\":\"factoring_command-tool-tip__3hDGH\",\"text-area-tran-show\":\"factoring_text-area-tran-show__1niCs\",\"text-area-tran-hide\":\"factoring_text-area-tran-hide__2_X1Z\",\"grid-text-area-tran-show\":\"factoring_grid-text-area-tran-show__r94XX\",\"grid-text-area-tran-hide\":\"factoring_grid-text-area-tran-hide__hWJLx\",\"text-area-arrow\":\"factoring_text-area-arrow__3AXOd\",\"top-info\":\"factoring_top-info__2QZdD\",\"row\":\"factoring_row__3lGO5\",\"first-col\":\"factoring_first-col__1s5y5\",\"last-col\":\"factoring_last-col__zerT9\",\"last-col-end\":\"factoring_last-col-end__dCF2y\",\"upload-wrapper\":\"factoring_upload-wrapper__3zvCS\",\"notes\":\"factoring_notes__2YiYf\",\"page-sub-title\":\"factoring_page-sub-title__3UPza\",\"notes-container\":\"factoring_notes-container__ykm78\",\"f-b-b\":\"factoring_f-b-b__ZuTk_\",\"add-client\":\"factoring_add-client__2ojzc\",\"add-client-more-show\":\"factoring_add-client-more-show__20YWE\",\"add-client-more-hide\":\"factoring_add-client-more-hide__3F6_p\",\"add-account-more-show\":\"factoring_add-account-more-show__vneWz\",\"add-account-more-hide\":\"factoring_add-account-more-hide__PnB1-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"topbar\":\"layout_topbar__3wERK\",\"mobileCustomSider\":\"layout_mobileCustomSider__geKse\",\"customSider\":\"layout_customSider__125uC\",\"placeholder\":\"layout_placeholder__38xZS\",\"itemIsNull\":\"layout_itemIsNull__1RW28\",\"menuWrap\":\"layout_menuWrap__2E4_h\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"SignInV2_wrap__2ITl7\",\"left\":\"SignInV2_left__2kvCv\",\"logo\":\"SignInV2_logo__3ijL5\",\"bottom\":\"SignInV2_bottom__24QKz\",\"partnerLogos\":\"SignInV2_partnerLogos__6oOnV\",\"footer\":\"SignInV2_footer__33JkM\",\"right\":\"SignInV2_right__3U7tF\",\"hideOnMobile\":\"SignInV2_hideOnMobile__2IqiJ\",\"hideOnPC\":\"SignInV2_hideOnPC__3Ngt3\",\"man\":\"SignInV2_man__2WgSx\",\"man_mobile\":\"SignInV2_man_mobile__2S9KX\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"SignInForm_wrap__2rtrS\",\"title\":\"SignInForm_title__2bqoL\",\"fieldContainer\":\"SignInForm_fieldContainer__1w__z\",\"fieldContainerHasError\":\"SignInForm_fieldContainerHasError__1R8sf\",\"loginWrap\":\"SignInForm_loginWrap__IyaxT\",\"forgotPassword\":\"SignInForm_forgotPassword__pE6Wn\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"CustomerPayment_wrap__9C4KR\",\"buttonContainer\":\"CustomerPayment_buttonContainer__2CKGu\",\"factoringLinesContainer\":\"CustomerPayment_factoringLinesContainer__3opw6\",\"customerButton\":\"CustomerPayment_customerButton__3j7kO\",\"active\":\"CustomerPayment_active__2jMM7\",\"actionButton\":\"CustomerPayment_actionButton__svhdI\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"CustomerStatement_wrap__aF6kb\",\"buttonContainer\":\"CustomerStatement_buttonContainer__1uNad\",\"factoringLinesContainer\":\"CustomerStatement_factoringLinesContainer__2s5iO\",\"customerButton\":\"CustomerStatement_customerButton__2PYMb\",\"active\":\"CustomerStatement_active__3xWEY\",\"actionButton\":\"CustomerStatement_actionButton__3loc_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"fromContainer\":\"UserDetailModal_fromContainer__-c5hN\",\"errorMessage\":\"UserDetailModal_errorMessage__358SB\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"pageWrap\":\"CustomForm_pageWrap__2uGV7\",\"fromWrap\":\"CustomForm_fromWrap__2ziV1\",\"fromContainer\":\"CustomForm_fromContainer__OvzaL\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"NumberFilter_wrap__2WzrU\",\"conditionDropdown\":\"NumberFilter_conditionDropdown__bFP9L\",\"valueInput\":\"NumberFilter_valueInput__1OUk4\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"buttonContainer\":\"ClientTransactionsTable_buttonContainer__1s7Je\",\"factoringLinesContainer\":\"ClientTransactionsTable_factoringLinesContainer__1FJbU\",\"customerButton\":\"ClientTransactionsTable_customerButton__3EY36\",\"active\":\"ClientTransactionsTable_active__3tbz5\",\"actionButton\":\"ClientTransactionsTable_actionButton__2srgv\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"root\":\"UserProfile_root__2GaXm\",\"pos\":\"UserProfile_pos__3w4Fs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"ScheduleOfInvoices_wrap__49VMQ\",\"buttonContainer\":\"ScheduleOfInvoices_buttonContainer__3nKAb\",\"factoringLinesContainer\":\"ScheduleOfInvoices_factoringLinesContainer__3-m5C\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrap\":\"OverdueAnalysis_wrap__VS0Ez\",\"buttonContainer\":\"OverdueAnalysis_buttonContainer__2mJz5\",\"factoringLinesContainer\":\"OverdueAnalysis_factoringLinesContainer__3jEJA\"};"],"sourceRoot":""}