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ACF7Y,EAAAA,gBAAgBC,YAAY3B,EAASuB,QAAOjE,GAAWA,EAAQiV,cAC/D7Q,EAAAA,gBAAgBC,YAAY3B,EAASuB,QAAOjE,GAAWA,EAAQ8B,eAC5DoN,EAAUwF,IAAeI,EAAAA,EAAAA,WAAkB,GAElD,OACIzT,IAAAA,cAACoL,EAAAA,OAAM,cACSuQ,EAAMja,UAAUsN,2BAC5B3K,QAASkP,EAAeoI,EAAOtI,GAC/BxF,UAAW+N,GAAe/N,GAAY8N,EAAM9N,SAC5CjO,UAAW+b,EAAM1c,GACjByU,SAAUiI,EAAMpM,kBAEfoM,EAAMja,UAAUqN,sEC5EtB,MAAMnE,EAqBTnG,YAAmB9F,GACfsG,KAAKhG,GAAKN,EAAQkd,IAAM,GACxB5W,KAAKkV,YAAcxb,EAAQmd,YAAc,IAAIC,KAAKpd,EAAQmd,kBAAepb,EACzEuE,KAAKiV,sBAAwBvb,EAAQqd,sBACrC/W,KAAK4U,aAAelb,EAAQsd,aAC5BhX,KAAKmS,OAASzY,EAAQud,YACtBjX,KAAK6U,QAAUnb,EAAQwd,eAAiB,IAAIJ,KAAKpd,EAAQwd,qBAAkBzb,EAC3EuE,KAAKoV,UAAY1b,EAAQyd,cACzBnX,KAAKmP,OAASzV,EAAQ0d,uBACtBpX,KAAK4C,aAAelJ,EAAQ2d,aAE5BrX,KAAKxE,YAAa,EAGtB,gBACI,OAAOwE,KAAKmP,SAAWxH,EAAAA,kBAAkBE,8DCpC1C,MAAMgF,EAA6DhR,IAKrE,IALsE,UACvElB,EAAS,UACTqS,EAAS,0BACTD,EAAyB,eACzBD,GACHjR,EACG,OACId,EAAAA,cAACoL,EAAAA,OAAM,CAACxL,UAAW,GAAGA,0BAAmCyE,QAAS4N,EAAWyB,SAAU3B,GAClFC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/request-invoice-modal.tsx?f9b5","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/invoices-list.tsx?2d55","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/invoices-list.view.tsx?8b51","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/invoice-error-component.tsx?2ff9","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/pay-invoice-component.tsx?6f61","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/helpers/pay-invoices.ts?30c0","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/invoices-filter-component.tsx?5fd4","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/invoices-table/components/invoices-table-header-component.tsx?f5e1","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/invoices-table/components/invoices-table-row-component.tsx?48db","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/helpers/invoice-status.ts?5841","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/invoices-table/invoices-table-component.tsx?9790","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/make-payment-component.tsx?1427","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/helpers/invoice-data.ts?00b1","webpack://Msdyn365.Commerce.Online/./src/modules/invoices-list/components/request-invoice-button.tsx?9eb0"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\n\n/* ---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { InvoiceModel } from '../helpers/invoice-data';\nimport { IInvoicesListResources } from '../invoices-list.props.autogenerated';\n\ninterface IRequestInvoiceModalProps {\n className: string;\n email: string;\n isModalOpen: boolean;\n submitRequestLabel: string;\n modalHeaderLabel: string;\n sendToEmailLabel: string;\n cancelLabel: string;\n searchPlaceholderLabel: string;\n invoices: InvoiceModel[];\n invoicesFoundString: string;\n singleInvoiceFoundString: string;\n searchButtonAltText: string;\n resources: IInvoicesListResources;\n toggle(): void;\n onSubmitRequest(invoiceId: string): void;\n}\n\n/**\n * On submit request click function.\n * @param selectedInvoiceIndex -Check is busy.\n * @param onClosing -On closing function.\n * @param filteredInvoices -Invoice modal.\n * @param onSubmitRequest -On submit request function.\n * @returns Call on submit request.\n */\nconst onSubmitRequestClick = (\n onClosing: () => void,\n filteredInvoices: InvoiceModel[],\n onSubmitRequest: (invoiceId: string) => void,\n checkboxRef: React.MutableRefObject\n) => () => {\n const defaultIndex = 0;\n let closingFlag: number = 0;\n\n filteredInvoices.map((invoice, index) => {\n const inputInvoice = checkboxRef.current[Number(index)] as React.RefObject;\n if (inputInvoice.current?.checked === true && index >= defaultIndex) {\n onSubmitRequest(invoice.id);\n closingFlag = closingFlag + 1;\n }\n });\n if (closingFlag <= filteredInvoices.length) {\n onClosing();\n }\n};\n\n/**\n * On search input change function.\n * @param setSearchInput -Set search input.\n * @returns Set search input function.\n */\nconst searchInputChangedHandler = (setSearchInput: React.Dispatch>) => (\n event: React.ChangeEvent\n) => {\n setSearchInput(event.target.value);\n};\n\n/**\n * Search entered handler.\n * @param invoices -InvoiceModel.\n * @param searchInput -String.\n * @param setFilteredInvoices -InvoiceModel action.\n * @param filteredInvoices -Filtered Invoices.\n * @param setSelectedInvoiceIndex -Selected Invoice Index.\n * @param setShouldShowSearchResults -Show search result action.\n * @param setInvoiceOptions -Invoice options action.\n * @param selectedInvoiceIndex -Selected invoice index.\n * @param className -String.\n * @returns Set invoice options.\n */\nconst searchEnteredHandler = (\n invoices: InvoiceModel[],\n searchInput: string,\n setFilteredInvoices: React.Dispatch>,\n filteredInvoices: InvoiceModel[],\n setSelectedInvoiceIndex: React.Dispatch>,\n setShouldShowSearchResults: React.Dispatch>,\n setInvoiceOptions: React.Dispatch>,\n selectedInvoiceIndex: number,\n className: string,\n checkboxRef: React.MutableRefObject\n) => () => {\n let updatedInvoices = filteredInvoices;\n if (!StringExtensions.isNullOrEmpty(searchInput)) {\n updatedInvoices = invoices.filter(invoice => invoice.id.toLocaleUpperCase().includes(searchInput.toLocaleUpperCase()));\n } else {\n updatedInvoices = invoices;\n }\n\n if (ArrayExtensions.hasElements(updatedInvoices)) {\n setFilteredInvoices(updatedInvoices);\n setSelectedInvoiceIndex(0);\n } else {\n setFilteredInvoices(updatedInvoices);\n setSelectedInvoiceIndex(-1);\n }\n setShouldShowSearchResults(true);\n\n setInvoiceOptions(\n renderInvoiceOptions(\n StringExtensions.isNullOrEmpty(searchInput) ? invoices : updatedInvoices,\n setSelectedInvoiceIndex,\n className,\n checkboxRef\n )\n );\n};\n\n/**\n * On cancel function.\n * @param onClosing -Closing function.\n * @param toggle -Toggle Function.\n * @returns Toggle function.\n */\nconst onCancelHandler = (onClosing: () => void, toggle: () => void) => () => {\n onClosing();\n toggle();\n};\n\n/**\n * On invoice select.\n * @param setSelectedInvoiceIndex -Set Selected Invoice Index.\n * @param index -Number.\n * @returns Set Selected Invoice Index.\n */\nconst onInvoiceSelectHandler = (setSelectedInvoiceIndex: (newIndex: number) => void, index: number) => () => {\n setSelectedInvoiceIndex(index);\n};\n\nconst renderInvoiceOptions = (\n filteredInvoices: InvoiceModel[],\n setSelectedInvoiceIndex: (newIndex: number) => void,\n className: string,\n checkboxRef: React.MutableRefObject\n) => {\n checkboxRef.current = filteredInvoices.map((_invoice, i) => checkboxRef.current[Number(i)] ?? React.createRef());\n return (\n
\n {filteredInvoices.map((invoice, index) => {\n const onInvoiceSelect = onInvoiceSelectHandler(setSelectedInvoiceIndex, index);\n\n const checkboxId = `invoice__${invoice.id}`;\n const checkboxName = `invoiceSelect__${invoice.id}`;\n\n return (\n
\n \n \n
\n );\n })}\n
\n );\n};\n\nexport const RequestInvoiceModal: React.FC = ({\n className,\n email,\n isModalOpen,\n toggle,\n modalHeaderLabel,\n sendToEmailLabel,\n submitRequestLabel,\n cancelLabel,\n onSubmitRequest,\n invoices,\n searchPlaceholderLabel,\n invoicesFoundString,\n singleInvoiceFoundString,\n searchButtonAltText,\n resources\n}) => {\n const [selectedInvoiceIndex, setSelectedInvoiceIndex] = React.useState(-1);\n const [filteredInvoices, setFilteredInvoices] = React.useState(invoices);\n const [searchInput, setSearchInput] = React.useState('');\n const [shouldShowSearchResults, setShouldShowSearchResults] = React.useState(false);\n const focusDelay = 110;\n const checkboxRef = React.useRef([]);\n const invoiceOptionsData = renderInvoiceOptions(filteredInvoices, setSelectedInvoiceIndex, className, checkboxRef);\n const [invoiceOptions, setInvoiceOptions] = React.useState(invoiceOptionsData);\n const focusElement = React.useRef(null);\n React.useEffect(() => {\n if (isModalOpen && focusElement.current) {\n setTimeout(() => {\n focusElement.current?.focus();\n }, focusDelay);\n }\n }, [isModalOpen]);\n\n /**\n * Sets the filtered invoices to the ones that were selected on the main screen.\n */\n const setFilteredInvoicesToSelectedInvoices = () => {\n setSelectedInvoiceIndex(-1);\n const selectedInvoices = invoices.filter(invoice => invoice.isSelected);\n if (ArrayExtensions.hasElements(selectedInvoices)) {\n setFilteredInvoices(selectedInvoices);\n\n // If only one invoice selected, auto select it\n if (selectedInvoices.length === 1) {\n setSelectedInvoiceIndex(0);\n }\n\n setInvoiceOptions(renderInvoiceOptions(selectedInvoices, setSelectedInvoiceIndex, className, checkboxRef));\n } else {\n setFilteredInvoices(invoices);\n setInvoiceOptions(renderInvoiceOptions(invoices, setSelectedInvoiceIndex, className, checkboxRef));\n }\n };\n\n const searchEntered = searchEnteredHandler(\n invoices,\n searchInput,\n setFilteredInvoices,\n filteredInvoices,\n setSelectedInvoiceIndex,\n setShouldShowSearchResults,\n setInvoiceOptions,\n selectedInvoiceIndex,\n className,\n checkboxRef\n );\n\n const onClosing = () => {\n setSelectedInvoiceIndex(-1);\n setFilteredInvoices(invoices);\n setSearchInput('');\n setShouldShowSearchResults(false);\n };\n\n /**\n * Sets the invoices that are possible to select when the dialog is opened.\n */\n const onOpened = () => {\n setSearchInput('');\n setFilteredInvoicesToSelectedInvoices();\n };\n\n const searchResultString = filteredInvoices.length === 1 ? singleInvoiceFoundString : invoicesFoundString;\n const invoicesFoundReplaceIndex = searchResultString.indexOf('{0}');\n\n return (\n \n \n {modalHeaderLabel}\n \n \n
\n \n
\n {email}\n
\n
\n {shouldShowSearchResults && (\n
\n {searchResultString.substring(0, invoicesFoundReplaceIndex)}\n {filteredInvoices.length}\n {searchResultString.substring(invoicesFoundReplaceIndex + 3)}\n
\n )}\n
\n \n \n
\n {invoiceOptions}\n
\n
\n
\n \n \n {submitRequestLabel}\n \n \n \n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, isOboRequest } from '@msdyn365-commerce/core';\nimport {\n BusinessPartnerOperationDeliveryType,\n BusinessPartnerUsersDataActions,\n InvoicePaidStatus,\n InvoiceSearchCriteria,\n IQueryResultSettings,\n OrderInvoice\n} from '@msdyn365-commerce/retail-proxy';\nimport { getCurrentAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\nimport {\n ArrayExtensions,\n getCustomer,\n GetCustomerInput,\n getInvoices,\n GetInvoicesInput,\n IQueryResultSettingsModuleConfig,\n QueryResultSettingsProxy,\n StringExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\n\nimport { InvoiceErrorComponent } from './components/invoice-error-component';\nimport { InvoicesFilterComponent, InvoicesFilterState } from './components/invoices-filter-component';\nimport { InvoicesTableComponent } from './components/invoices-table/invoices-table-component';\nimport { IMakePaymentResources, MakePaymentComponent } from './components/make-payment-component';\nimport { RequestInvoiceButton } from './components/request-invoice-button';\nimport { RequestInvoiceModal } from './components/request-invoice-modal';\nimport { InvoiceModel } from './helpers/invoice-data';\nimport { IAddInvoicesToCartFailureResult } from './helpers/pay-invoices';\nimport { IInvoicesListData } from './invoices-list.data';\nimport { IInvoicesListProps } from './invoices-list.props.autogenerated';\n\nexport type InvoicesListStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\nexport type InvoiceErrorHost = 'ADDINVOICETOCART';\n\nexport interface IInvoicesListViewProps extends IInvoicesListProps {\n moduleProps: IModuleProps;\n\n header: JSX.Element;\n filter: JSX.Element;\n content?: JSX.Element;\n invoiceRequestModal?: JSX.Element;\n pagination?: JSX.Element;\n}\n\nexport interface IInvoiceErrorState {\n errorHost?: InvoiceErrorHost;\n errorReason?: IAddInvoicesToCartFailureResult;\n errorMessage: string;\n otherError?: string;\n errorCode?: string;\n}\n\nexport interface IInvoicesListState {\n invoices: InvoiceModel[];\n invoicesFilterState: InvoicesFilterState;\n errorState: IInvoiceErrorState;\n isInvoiceRequestModalOpen: boolean;\n isLoading: boolean;\n isOpen: boolean;\n isPageLoaded: boolean;\n payInvoiceErrorModalOpen: boolean;\n selectedButtonElement?: HTMLButtonElement | null;\n}\n\n/**\n * InvoicesList component.\n * @extends {React.Component, IInvoicesListState>}\n */\n@observer\nclass InvoicesList extends React.Component, IInvoicesListState> {\n private readonly _className: string = 'msc-invoices-list';\n\n private readonly payInvoiceRequestReference: React.RefObject;\n\n private readonly makePaymentReference: React.RefObject;\n\n private buttonChildReference: React.RefObject[] = [];\n\n private buttonChildPayButtonReference: React.RefObject[] = [];\n\n private readonly _queryResultSettings: IQueryResultSettings;\n\n private invoiceIds: string[] = [];\n\n constructor(props: IInvoicesListProps) {\n super(props);\n\n this._queryResultSettings = QueryResultSettingsProxy.fromModuleData(\n this.props.context.request,\n this.props.config as IQueryResultSettingsModuleConfig\n ).QueryResultSettings;\n this.payInvoiceRequestReference = React.createRef();\n this.makePaymentReference = React.createRef();\n this._updateInvoicesState = this._updateInvoicesState.bind(this);\n this._onAddToCartFailed = this._onAddToCartFailed.bind(this);\n this._onToggleInvoiceRequestModal = this._onToggleInvoiceRequestModal.bind(this);\n this._handleFilterStateChange = this._handleFilterStateChange.bind(this);\n this._loadMoreInvoices = this._loadMoreInvoices.bind(this);\n this._requestInvoice = this._requestInvoice.bind(this);\n this._requestSpecificInvoice = this._requestSpecificInvoice.bind(this);\n this._setPayInvoiceErrorModalClose = this._setPayInvoiceErrorModalClose.bind(this);\n this.state = {\n invoices: [],\n invoicesFilterState: InvoicesFilterState.ShowAll,\n isLoading: true,\n isOpen: true,\n isPageLoaded: false,\n errorState: { errorMessage: '' },\n isInvoiceRequestModalOpen: false,\n payInvoiceErrorModalOpen: false,\n selectedButtonElement: null\n };\n }\n\n public shouldComponentUpdate(nextProps: IInvoicesListProps, nextState: IInvoicesListState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className = '', heading },\n context: {\n request: { channel },\n cultureFormatter: {\n formatCurrency,\n\n // @ts-expect-error\n currencyCode\n }\n },\n data: { customerBalance },\n resources: { invoicesListTitle, invoicesListDescTitle, invoicesListDescCount }\n } = this.props;\n\n const totalAmount = customerBalance.result?.OpenInvoiceBalance || 0;\n const amountText = `${formatCurrency(totalAmount.toFixed(2), currencyCode)} ${channel?.Currency || 'USD'}`;\n\n const totalCount = customerBalance.result?.OpenInvoiceCount || 0;\n const countText = invoicesListDescCount.replace('{0}', totalCount.toString());\n const invoicesListTitleHeading = heading?.text ?? invoicesListTitle;\n\n const headerClassName = `${this._className}__header`;\n\n const header = (\n
\n \n
\n
{invoicesListDescTitle}
\n
{amountText}
\n
{countText}
\n
\n
\n );\n\n const viewProps: IInvoicesListViewProps = {\n ...(this.props as IInvoicesListProps),\n moduleProps: {\n moduleProps: this.props,\n className: classnames(this._className, className)\n },\n header,\n invoiceRequestModal: this._renderInvoiceRequestModal(),\n filter: this._renderInvoicesFilter(this._className),\n pagination: this._renderPagination()\n };\n\n if (!this.state.isPageLoaded) {\n return this.props.renderView(viewProps);\n }\n\n if (ArrayExtensions.hasElements(this.state.invoices)) {\n viewProps.content = this._renderListContainer();\n } else {\n viewProps.content = this._renderEmptyInvoiceLinesPageContent();\n }\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public async componentDidMount(): Promise {\n await this.props.data.customer;\n const invoicesData = await this.props.data.invoices;\n this._initializeWithInvoices(invoicesData);\n\n reaction(\n () => this.state.isInvoiceRequestModalOpen,\n async () => {\n if (this.invoiceIds && !this.state.isInvoiceRequestModalOpen) {\n const context = { callerContext: this.props.context.actionContext };\n const b2bUserId: string = this.props.data.b2bUserInformation?.result?.B2BUserId || '';\n for (const invoiceId of this.invoiceIds) {\n await BusinessPartnerUsersDataActions.requestInvoiceCopyAsync(\n context,\n b2bUserId,\n invoiceId,\n BusinessPartnerOperationDeliveryType.Email\n );\n }\n this.invoiceIds = [];\n }\n }\n );\n }\n\n private _initializeWithInvoices(invoicesData: OrderInvoice[]): void {\n const invoices = invoicesData.map((invoice, index) => {\n this.buttonChildReference[Number(index)] = React.createRef();\n this.buttonChildPayButtonReference[Number(index)] = React.createRef();\n return new InvoiceModel(invoice);\n });\n this.setState({\n invoices,\n isLoading: false,\n isPageLoaded: true\n });\n }\n\n private _addInvoices(invoicesData: OrderInvoice[]): void {\n const newInvoices = invoicesData.map(invoice => new InvoiceModel(invoice));\n const invoices = this.state.invoices.concat(newInvoices);\n this.setState({\n invoices,\n isLoading: false\n });\n }\n\n private _renderEmptyInvoiceLinesPageContent(): JSX.Element {\n const containerClass = `${this._className}__empty-lines__container`;\n const actionsContainerClass = `${containerClass}__actions`;\n return (\n
\n
{this.props.resources.invoiceEmptyInvoiceLinesTitle}
\n
{this.props.resources.invoiceEmptyInvoiceLinesDescription}
\n
\n \n {this.props.resources.invoiceEmptyInvoiceLinesContinueShoppingButtonText}\n \n
\n
\n );\n }\n\n private _renderListContainer(): JSX.Element {\n const containerClass = `${this._className}__container`;\n const containerHeaderClass = `${containerClass}__header`;\n const containerContentClass = `${containerClass}__content`;\n const isOnBehalfOfRequest = isOboRequest(this.props.context.request);\n\n return (\n
\n
\n {this._renderMakePayment(containerHeaderClass, isOnBehalfOfRequest)}\n {this._renderInvoiceRequestButton()}\n
\n
{this._renderInvoiceErrors()}
\n
{this._renderInvoicesList(containerContentClass)}
\n
\n );\n }\n\n private _updateInvoicesState(): void {\n this.setState({\n invoices: this.state.invoices\n });\n }\n\n private async _getInvoicesSearchCriteria(state: InvoicesFilterState): Promise {\n const searchCriteria: InvoiceSearchCriteria = {};\n\n const context = this.props.context.actionContext;\n\n const businessPartner = await getCurrentAsync({ callerContext: context });\n searchCriteria.BusinessPartnerId = businessPartner?.BusinessPartnerId;\n\n const customer = await getCustomer(new GetCustomerInput(context.requestContext.apiSettings), context);\n searchCriteria.CustomerId = customer?.AccountNumber;\n\n switch (state) {\n case InvoicesFilterState.ShowAll:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.None];\n break;\n case InvoicesFilterState.Paid:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.Paid];\n break;\n case InvoicesFilterState.PartiallyPaid:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.PartiallyPaid];\n break;\n case InvoicesFilterState.Unpaid:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.Unpaid];\n break;\n default:\n throw new Error('Failed to process unknown invoices filter state.');\n }\n\n return searchCriteria;\n }\n\n private async _handleFilterStateChange(state: InvoicesFilterState): Promise {\n this.setState({\n invoicesFilterState: state,\n isLoading: true\n });\n\n const searchCriteria = await this._getInvoicesSearchCriteria(state);\n\n if (this._queryResultSettings.Paging) {\n this._queryResultSettings.Paging.Skip = 0;\n }\n\n const invoices = await getInvoices(\n new GetInvoicesInput(searchCriteria, this._queryResultSettings),\n this.props.context.actionContext\n );\n this._initializeWithInvoices(invoices);\n }\n\n private _renderInvoicesFilter(className: string): JSX.Element {\n const containerClass = `${this._className}__container`;\n const containerContentClass = `${containerClass}__content`;\n const filterClassName = `${className}__filter`;\n return (\n
\n
{this._renderInvoiceInCartPaymentMessage()}
\n \n
\n );\n }\n\n private _renderInvoicesList(className: string): JSX.Element {\n const tableClassName = `${className}__table`;\n return (\n \n );\n }\n\n private _onAddToCartFailed(newErrorState: IInvoiceErrorState, reference?: React.RefObject): void {\n const errorState = { ...newErrorState };\n errorState.errorHost = 'ADDINVOICETOCART';\n errorState.errorMessage =\n newErrorState.errorReason?.failureReason === 'EMPTYINPUT'\n ? this.props.resources.invoiceErrorInvoiceIdNotExist\n : this.props.resources.invoiceErrorFailedAddInvoiceToCart;\n\n const shouldShowAdditionalInfoInPopup =\n errorState.errorCode === 'Microsoft_Dynamics_Commerce_Runtime_InvoiceLineNotAllowedWithItemLines';\n this.setState({ errorState, payInvoiceErrorModalOpen: shouldShowAdditionalInfoInPopup, selectedButtonElement: reference?.current });\n }\n\n private _renderMakePayment(className: string, disabled: boolean): JSX.Element {\n const id = `${className}__make-payment`;\n const makePaymentResources: IMakePaymentResources = {\n makePaymentButtonText: this.props.resources.makePaymentButtonText,\n makePaymentButtonAriaLabel: this.props.resources.makePaymentButtonAriaLabel\n };\n\n const selectedInvoices = this._getSelectedInvoices();\n\n return (\n \n );\n }\n\n private _setPayInvoiceErrorModalClose(): void {\n this.setState({\n payInvoiceErrorModalOpen: false\n });\n this.state.selectedButtonElement?.focus();\n }\n\n private _renderInvoiceErrors(): JSX.Element {\n const {\n resources: {\n payInvoiceErrorDialogHeader,\n payInvoiceErrorDialogBodyErrorTitle,\n payInvoiceErrorDialogBodyErrorDescription,\n payInvoiceErrorDialogFooterGoToCartButtonText,\n payInvoiceErrorDialogFooterCancelButtonText\n }\n } = this.props;\n\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n\n const errorClassName = `${this._className}__errors`;\n\n return (\n \n );\n }\n\n private _renderInvoiceInCartPaymentMessage(): JSX.Element {\n const cart = this.props.data.cart?.result;\n\n if (!cart?.hasInvoiceLine) {\n return <>;\n }\n\n return (\n \n \n \n );\n }\n\n // Dismiss alert.\n private readonly _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n };\n\n private _renderPagination(): JSX.Element | undefined {\n const { data, resources } = this.props;\n const invoices = data?.invoices?.result;\n if (!invoices || invoices.length < this._queryResultSettings.Paging!.Top!) {\n return undefined;\n }\n\n return (\n \n {resources.invoicesLoadMore}\n \n );\n }\n\n private async _loadMoreInvoices(): Promise {\n this.setState({ isLoading: true });\n const searchCriteria = await this._getInvoicesSearchCriteria(this.state.invoicesFilterState);\n if (this._queryResultSettings.Paging) {\n this._queryResultSettings.Paging.Skip! += this._queryResultSettings.Paging.Top!;\n }\n const newInvoices = await getInvoices(\n new GetInvoicesInput(searchCriteria, this._queryResultSettings),\n this.props.context.actionContext\n );\n this._addInvoices(newInvoices);\n }\n\n private _renderInvoiceRequestModal(): JSX.Element {\n const customer = this.props.data.customer.result;\n const {\n invoiceRequestModalCancelLabel,\n invoiceRequestModalSubmitLabel,\n invoiceRequestModalHeaderLabel,\n invoiceRequestModalSendToEmailLabel,\n invoiceRequestModalSearch,\n invoiceRequestModalInvoiceSearchDisplay,\n invoiceRequestModalSingleInvoiceSearchDisplay,\n invoiceRequestModalSearchButton\n } = this.props.resources;\n\n return (\n \n );\n }\n\n private _onToggleInvoiceRequestModal(): void {\n this.setState({\n isInvoiceRequestModalOpen: !this.state.isInvoiceRequestModalOpen\n });\n if (this.state.isInvoiceRequestModalOpen) {\n this.state.selectedButtonElement?.focus();\n }\n }\n\n /**\n * Request specific invoice function.\n */\n private readonly _onToggleInvoiceRequestParentModal = () => {\n this.setState(\n {\n selectedButtonElement: this.payInvoiceRequestReference.current\n },\n () => {\n this._onToggleInvoiceRequestModal();\n }\n );\n };\n\n private _renderInvoiceRequestButton(): JSX.Element | null {\n const { invoiceRequestButtonLabel } = this.props.resources;\n const customer = this.props.data.customer.result;\n\n if (StringExtensions.isNullOrWhitespace(customer?.Email)) {\n return null;\n }\n\n return (\n \n );\n }\n\n private _requestInvoice(invoiceId: string): void {\n this.invoiceIds.push(invoiceId);\n this._onToggleInvoiceRequestModal();\n }\n\n private _getSelectedInvoices(): InvoiceModel[] {\n let selectedInvoices = this.state.invoices.filter(invoice => invoice.isSelected);\n if (!ArrayExtensions.hasElements(selectedInvoices)) {\n selectedInvoices = this.state.invoices;\n }\n\n return selectedInvoices;\n }\n\n private _requestSpecificInvoice(\n specificInvoice: InvoiceModel,\n requestInvoiceButtonReference: React.RefObject\n ): void {\n this.state.invoices.forEach((invoice: InvoiceModel) => {\n if (invoice === specificInvoice) {\n invoice.isSelected = true;\n } else {\n invoice.isSelected = false;\n }\n });\n this.setState({\n selectedButtonElement: requestInvoiceButtonReference.current\n });\n this._onToggleInvoiceRequestModal();\n }\n}\n\nexport default InvoicesList;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IInvoicesListViewProps } from './invoices-list';\n\nexport const InvoiceListView: React.FC = props => {\n const { header, filter, content, invoiceRequestModal, pagination } = props;\n\n return (\n \n {header}\n {invoiceRequestModal}\n {filter}\n {content}\n {pagination}\n \n );\n};\n\nexport default InvoiceListView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Alert, Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface IInvoiceErrorProps extends IComponentProps {\n messageHeader?: string;\n errorMessage?: string;\n otherError?: string;\n showError: boolean;\n payInvoiceErrorModalOpen: boolean;\n\n errorDialogHeader: string;\n errorDialogBodyErrorTitle: string;\n errorDialogBodyErrorDescription: string;\n errorDialogFooterGoToCartButtonText: string;\n errorDialogFooterCancelButtonText: string;\n cartUrl: string;\n\n setPayInvoiceErrorModalClose(): void;\n}\n\nexport interface IInvoiceErrorComponent extends IComponent {}\n\nexport const InvoiceError: React.FC = ({\n messageHeader,\n errorMessage,\n otherError,\n showError,\n payInvoiceErrorModalOpen,\n errorDialogHeader,\n errorDialogBodyErrorTitle,\n errorDialogBodyErrorDescription,\n errorDialogFooterGoToCartButtonText,\n errorDialogFooterCancelButtonText,\n cartUrl,\n setPayInvoiceErrorModalClose\n}) => {\n const errorMessages: (string | undefined)[] = [];\n\n if (otherError) {\n errorMessages.push(otherError);\n } else {\n errorMessages.push(errorMessage);\n }\n\n const className = 'msc-pay-invoice-error-dialog';\n\n return (\n <>\n 0} color='danger' assertive aria-label={messageHeader}>\n \n {errorMessages.map((message, index) => {\n return (\n
\n {message}\n
\n );\n })}\n
\n \n \n {errorDialogHeader}\n \n \n
\n
{errorDialogBodyErrorTitle}
\n
{errorDialogBodyErrorDescription}
\n
\n
\n \n \n {errorDialogFooterGoToCartButtonText}\n \n \n {errorDialogFooterCancelButtonText}\n \n \n
\n \n );\n};\n\n// @ts-expect-error\nexport const InvoiceErrorComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoiceError',\n { component: InvoiceError }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { IPayableInvoice } from '../helpers/invoice-data';\nimport { payInvoices } from '../helpers/pay-invoices';\nimport { IInvoiceErrorState } from '../invoices-list';\n\nexport interface IPayInvoiceData {\n invoice: IPayableInvoice;\n}\n\nexport interface IPayInvoiceResources {\n payInvoiceButtonText: string;\n payInvoiceButtonAriaLabel: string;\n}\n\nexport interface IPayInvoiceProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n reference?: React.RefObject;\n resources: IPayInvoiceResources;\n disabled?: boolean;\n\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\n}\n\ninterface IPayInvoiceComponent extends IComponent {}\n\nconst onClick = async (\n _event: React.MouseEvent,\n props: IPayInvoiceProps,\n setDisabled: (disabled: boolean) => void\n): Promise => {\n setDisabled(true);\n\n const propagateError = (errorState: IInvoiceErrorState): void => {\n if (props.onError) {\n props.onError(errorState, props.reference);\n }\n setDisabled(false);\n };\n\n await payInvoices([props.data.invoice], props.context.actionContext, propagateError);\n};\n\nconst PayInvoiceComponentActions = {\n onClick\n};\n\n/**\n * On click handler function.\n * @param props -Invoice props.\n * @param setDisabled -Set disabled.\n * @returns Pay invoice component action.\n */\nconst onClickHandler = (props: IPayInvoiceProps, setDisabled: React.Dispatch>) => async (\n event: React.MouseEvent\n) => {\n await PayInvoiceComponentActions.onClick(event, props, setDisabled);\n};\n\nconst PayInvoice: React.FC = (props: IPayInvoiceProps): JSX.Element => {\n const [disabled, setDisabled] = useState(false);\n\n return (\n \n {props.resources.payInvoiceButtonText}\n \n );\n};\n\n// @ts-expect-error\nexport const PayInvoiceComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'PayInvoiceComponent',\n { component: PayInvoice, ...PayInvoiceComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState } from '@msdyn365-commerce/global-state';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IInvoiceErrorState } from '../invoices-list';\nimport { IPayableInvoice } from './invoice-data';\n\nexport type ICartActionFailureReason = 'EMPTYINPUT' | 'CARTACTIONFAILED';\nexport interface IAddInvoicesToCartFailureResult {\n failureReason: ICartActionFailureReason;\n}\n\nexport const payInvoices = async (\n invoices: IPayableInvoice[],\n actionContext: IActionContext,\n onError: (errorState: IInvoiceErrorState) => void\n) => {\n const invoicesToAdd: string[] = invoices.filter(invoice => invoice.canBePaid).map(invoice => invoice.id);\n\n if (!ArrayExtensions.hasElements(invoicesToAdd)) {\n onError({ errorMessage: '', errorReason: { failureReason: 'EMPTYINPUT' } });\n return;\n }\n\n const cartState = await getCartState(actionContext);\n const result = await cartState.addInvoicesToCart({ invoiceIds: invoicesToAdd });\n\n if (result.status !== 'SUCCESS') {\n onError({\n errorMessage: '',\n errorReason: { failureReason: 'CARTACTIONFAILED' },\n otherError: result.errorDetails?.LocalizedMessage,\n errorCode: result.errorDetails?.ErrorResourceId\n });\n return;\n }\n\n const cartUrl = getUrlSync('cart', actionContext);\n if (cartUrl) {\n window?.location.assign(cartUrl);\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { EnumExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Popover } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { IInvoiceStatusResources } from '../helpers/invoice-status';\n\nexport interface IInvoicesFilterResources extends IInvoiceStatusResources {\n invoicesFilterShowAll: string;\n}\n\nexport interface IInvoicesFilterProps extends IComponentProps {\n className: string;\n disabled: boolean;\n\n resources: IInvoicesFilterResources;\n\n currentState: InvoicesFilterState;\n onFilterStateChanged(state: InvoicesFilterState): void;\n}\n\nexport enum InvoicesFilterState {\n ShowAll,\n Paid,\n PartiallyPaid,\n Unpaid\n}\n\nconst getInvoicesFilterStateResources = (filterState: InvoicesFilterState, resources: IInvoicesFilterResources): string => {\n switch (filterState) {\n case InvoicesFilterState.ShowAll:\n return resources.invoicesFilterShowAll;\n case InvoicesFilterState.Paid:\n return resources.invoiceStatusPaid;\n case InvoicesFilterState.PartiallyPaid:\n return resources.invoiceStatusPartiallyPaid;\n case InvoicesFilterState.Unpaid:\n return resources.invoiceStatusUnpaid;\n default:\n throw new Error('Failed to retrieve resource description for unknown invoices filter state.');\n }\n};\n\n/**\n * On Click function.\n * @param onStateClick -Invoice filter state function.\n * @param filterState -Invoice filter state.\n * @returns Set Invoice filter state.\n */\nconst onClickHandler = (onStateClick: (filterState: InvoicesFilterState) => void, filterState: InvoicesFilterState) => () => {\n onStateClick(filterState);\n};\n\nconst renderFilterStateItem = (\n filterState: InvoicesFilterState,\n resources: IInvoicesFilterResources,\n className: string,\n onStateClick: (filterState: InvoicesFilterState) => void\n): React.ReactNode => {\n const stateStringRepresentation = InvoicesFilterState[filterState];\n\n return (\n \n );\n};\n\nconst InvoicesFilter: React.FC = (props: IInvoicesFilterProps) => {\n const popoverRef = React.createRef();\n const [popoverState, setPopoverState] = React.useState(false);\n const togglePopover = React.useCallback(() => {\n setPopoverState(!popoverState);\n }, [popoverState]);\n\n const [filterState, setFilterState] = React.useState(props.currentState);\n\n const onFilterStateClick = (clickedState: InvoicesFilterState) => {\n setFilterState(clickedState);\n setPopoverState(false);\n props.onFilterStateChanged(clickedState);\n };\n\n return (\n
\n \n {getInvoicesFilterStateResources(filterState, props.resources)}\n \n \n {EnumExtensions.getEnumValues(InvoicesFilterState).map(state => {\n return renderFilterStateItem(state, props.resources, props.className, onFilterStateClick);\n })}\n \n
\n );\n};\n\nexport const InvoicesFilterComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IInvoicesFilterProps\n>('InvoicesFilterComponent', { component: InvoicesFilter });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport React from 'react';\n\nexport interface IInvoicesTableHeaderResources {\n invoicesText: string;\n invoiceNumberText: string;\n invoiceDateMobileText: string;\n invoiceDateText: string;\n invoiceUsersText: string;\n invoiceAmountText: string;\n invoiceDueDateText: string;\n invoiceAmountDueText: string;\n invoiceStatusText: string;\n invoiceActionsText: string;\n invoiceListSelectAllRadioAriaLabelText: string;\n}\n\nexport interface IInvoicesTableHeaderProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n isSelectedAll: boolean;\n isMobile: boolean;\n isAdmin: boolean;\n\n resources: IInvoicesTableHeaderResources;\n\n onSelectAll(isSelected: boolean): void;\n}\n\nexport interface IInvoicesTableHeaderComponent extends IComponent {}\n\nconst getDesktopHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\n const { resources } = props;\n return (\n <>\n \n \n \n {resources.invoiceNumberText}\n {resources.invoiceDateText}\n {resources.invoiceUsersText}\n {resources.invoiceAmountText}\n {resources.invoiceDueDateText}\n {resources.invoiceAmountDueText}\n {resources.invoiceStatusText}\n {resources.invoiceActionsText}\n \n );\n};\n\nconst getMobileHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\n const { resources } = props;\n return (\n <>\n \n \n \n {resources.invoicesText}\n {resources.invoiceDateMobileText}\n \n {` `}\n {/* Actions */}\n \n );\n};\n\nconst InvoicesTableHeader: React.FC = (props: IInvoicesTableHeaderProps): JSX.Element => {\n const rowClassName = `${props.className}__row`;\n\n const switchCheckedState = () => {\n props.onSelectAll(!props.isSelectedAll);\n };\n\n let headerCells: JSX.Element;\n if (props.isMobile) {\n headerCells = getMobileHeaderCells(props, rowClassName, switchCheckedState);\n } else {\n headerCells = getDesktopHeaderCells(props, rowClassName, switchCheckedState);\n }\n\n return (\n \n {headerCells}\n \n );\n};\n\nexport const InvoicesTableHeaderComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IInvoicesTableHeaderComponent\n>('InvoicesTableHeaderComponent', { component: InvoicesTableHeader });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, {\n IComponent,\n IComponentProps,\n ICoreContext,\n IDateFormatOptions,\n isOboRequest,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { getInvoiceDetailsPageUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, format } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\nimport { InvoiceModel } from '../../../helpers/invoice-data';\nimport { getInvoiceStatusText, IInvoiceStatusResources } from '../../../helpers/invoice-status';\nimport { IInvoiceErrorState } from '../../../invoices-list';\nimport { IPayInvoiceResources, PayInvoiceComponent } from '../../pay-invoice-component';\nimport { RequestInvoiceButton } from '../../request-invoice-button';\n\ninterface IInvoicesTableRowData {\n invoice: InvoiceModel;\n index: number;\n customer: Customer;\n}\n\nexport interface IInvoicesTableRowResources extends IInvoiceStatusResources, IPayInvoiceResources {\n invoiceCurrentUser: string;\n invoiceViewDetailsButtonText: string;\n invoiceViewDetailsButtonAriaLabel: string;\n invoiceActionsButtonTextAriaLabel?: string;\n invoiceActionsButtonIsOnBehalfOfTextAriaLabel?: string;\n invoiceRequestButtonLabel: string;\n invoiceListSelectRadioAriaLabelText: string;\n}\n\nexport interface IInvoicesTableRowProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n isMobile: boolean;\n invoiceReferences?: React.RefObject;\n payInvoiceReferences?: React.RefObject;\n resources: IInvoicesTableRowResources;\n\n onChange(): void;\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\n onRequestInvoice?(invoice: InvoiceModel, requestInvoiceButtonReference: React.RefObject): void;\n}\n\nexport interface IInvoicesTableRowComponent extends IComponent {}\n\nconst formatAmount = (context: ICoreContext, amount: number | undefined, currencyCode: string | undefined) => {\n if (amount === undefined) {\n return '';\n }\n return context.cultureFormatter.formatCurrency(amount, currencyCode);\n};\n\nconst formatDate = (context: ICoreContext, date: Date | undefined) => {\n if (date === undefined) {\n return '';\n }\n\n const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };\n return context.cultureFormatter.formatDate(date, dateOptions);\n};\n\n/**\n * Request specific invoice function.\n * @param props -Invoice table row props.\n * @param requestInvoiceButtonReference -Reference button.\n * @returns Call Request Invoice.\n */\nconst onRequestSpecificInvoice = (\n props: IInvoicesTableRowProps,\n requestInvoiceButtonReference: React.RefObject,\n setShowActions: React.Dispatch>\n) => () => {\n setShowActions(false);\n props.onRequestInvoice!(props.data.invoice, requestInvoiceButtonReference);\n};\n\nconst getDesktopRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\n const {\n data: { invoice, customer }\n } = props;\n\n const isCurrentUser =\n !StringExtensions.isNullOrWhitespace(customer.AccountNumber) && customer.AccountNumber === invoice.customerAccountNumber;\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n const invoiceRowArialabel = format(props.resources.invoiceListSelectRadioAriaLabelText, invoice.id);\n return (\n <>\n \n \n \n \n \n {invoice.id}\n \n \n \n {formatDate(props.context, invoice.invoiceDate)}\n \n \n {invoice.customerName}\n {isCurrentUser ? {props.resources.invoiceCurrentUser} : null}\n \n {formatAmount(props.context, invoice.amount, invoice.currencyCode)}\n \n {formatDate(props.context, invoice.dueDate)}\n \n {formatAmount(props.context, invoice.amountDue, invoice.currencyCode)}\n \n {getInvoiceStatusText(props.resources, invoice.status)}\n \n {extraActionsPopup(props)}\n \n );\n};\n\nlet setShowPreviousActions: React.Dispatch> | undefined;\n\n/**\n * On Click view details function.\n * @param linkToInvoiceDetails -Link to invoice details.\n * @returns Go to invoice details.\n */\nconst onClickViewDetails = (linkToInvoiceDetails: string) => () => {\n if (MsDyn365.isBrowser) {\n window.location.href = linkToInvoiceDetails;\n }\n return;\n};\n\n/**\n * Toggle function.\n * @param isShowActions -Link to invoice details.\n * @param setShowActions -Link to invoice details.\n * @returns Go to invoice details.\n */\nconst toggle = (isShowActions: boolean, setShowActions: React.Dispatch>) => () => {\n const shouldShowActions = !isShowActions;\n if (shouldShowActions) {\n if (setShowPreviousActions) {\n setShowPreviousActions(false);\n }\n setShowActions(shouldShowActions);\n setShowPreviousActions = setShowActions;\n } else {\n setShowPreviousActions = undefined;\n setShowActions(shouldShowActions);\n }\n};\n\nfunction useOutsideClick(refinerRefernce: React.RefObject, toggle: (event: Event | MouseEvent) => void) {\n function handleClickOutside(event: Event | MouseEvent) {\n if (refinerRefernce.current && !refinerRefernce.current.contains(event.target as Node)) {\n toggle(event);\n }\n }\n\n React.useEffect(() => {\n if (MsDyn365.isBrowser) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n return () => {\n if (MsDyn365.isBrowser) {\n document.removeEventListener('mousedown', handleClickOutside);\n }\n };\n }, [refinerRefernce, toggle]);\n}\n\nconst extraActionsPopup = (props: IInvoicesTableRowProps): JSX.Element | null => {\n const {\n resources: {\n invoiceViewDetailsButtonAriaLabel,\n invoiceViewDetailsButtonText,\n invoiceActionsButtonTextAriaLabel,\n invoiceActionsButtonIsOnBehalfOfTextAriaLabel\n },\n data: { index }\n } = props;\n\n const [showActions, setShowActions] = useState(false);\n const isOnBehalfOfRequest = isOboRequest(props.context.request);\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n\n const className = `${props.className}__extra-actions-cell`;\n const actionsContainerClassName = `${className}__actions-container`;\n const payInvoiceClassName = `${actionsContainerClassName}__pay-invoice`;\n const wrapperRefiner = React.useRef(null);\n useOutsideClick(wrapperRefiner, toggle(showActions && !isOnBehalfOfRequest, setShowActions));\n return (\n
\n \n {showActions && !isOnBehalfOfRequest && (\n
\n \n {invoiceViewDetailsButtonText}\n \n \n \n
\n )}\n
\n );\n};\n\nconst getMobileRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\n const {\n data: { invoice }\n } = props;\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n const invoiceRowArialabel = format(props.resources.invoiceListSelectRadioAriaLabelText, invoice.id);\n\n return (\n <>\n \n \n \n \n \n {invoice.id}\n \n
\n {invoice.customerName}\n \n \n {formatDate(props.context, invoice.dueDate)}\n
\n {getInvoiceStatusText(props.resources, invoice.status)}\n \n {extraActionsPopup(props)}\n \n );\n};\n\nconst InvoicesTableRow: React.FC = (props: IInvoicesTableRowProps): JSX.Element => {\n const {\n data: { invoice }\n } = props;\n\n const onSelectLine = () => {\n invoice.isSelected = !invoice.isSelected;\n props.onChange();\n };\n\n let rowCells: JSX.Element;\n if (props.isMobile) {\n rowCells = getMobileRowCells(props, onSelectLine);\n } else {\n rowCells = getDesktopRowCells(props, onSelectLine);\n }\n\n return {rowCells};\n};\n\nexport const InvoicesTableRowComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IInvoicesTableRowComponent\n>('InvoicesTableRowComponent', { component: InvoicesTableRow });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { InvoicePaidStatus } from '@msdyn365-commerce/retail-proxy';\n\nexport interface IInvoiceStatusResources {\n invoiceStatusNone: string;\n invoiceStatusUnpaid: string;\n invoiceStatusPartiallyPaid: string;\n invoiceStatusPaid: string;\n}\n\nexport const getInvoiceStatusText = (resources: IInvoiceStatusResources, invoiceStatus: InvoicePaidStatus | undefined) => {\n switch (invoiceStatus) {\n case InvoicePaidStatus.None:\n return resources.invoiceStatusNone;\n\n case InvoicePaidStatus.Unpaid:\n return resources.invoiceStatusUnpaid;\n\n case InvoicePaidStatus.PartiallyPaid:\n return resources.invoiceStatusPartiallyPaid;\n\n case InvoicePaidStatus.Paid:\n return resources.invoiceStatusPaid;\n default:\n return '';\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React, { useState } from 'react';\n\nimport { InvoiceModel } from '../../helpers/invoice-data';\nimport { IInvoiceErrorState } from '../../invoices-list';\nimport { IInvoicesTableHeaderResources, InvoicesTableHeaderComponent } from './components/invoices-table-header-component';\nimport { IInvoicesTableRowResources, InvoicesTableRowComponent } from './components/invoices-table-row-component';\n\ninterface IInvoicesTableData {\n invoices: InvoiceModel[];\n customer: Customer;\n}\n\nexport interface IInvoicesTableResources extends IInvoicesTableHeaderResources, IInvoicesTableRowResources {}\n\nexport interface IInvoicesTableProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n invoiceButtonReferences?: React.RefObject[];\n payInvoiceButtonReferences?: React.RefObject[];\n resources: IInvoicesTableResources;\n\n onChange(): void;\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\n onRequestInvoice(invoice: InvoiceModel, requestInvoiceButtonReference: React.RefObject): void;\n}\n\nexport interface IInvoicesTableComponent extends IComponent {}\n\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nconst getViewport = (context: ICoreContext): GridSize => {\n // Always render in mobile viewport on a mobile device\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\n return 'xs';\n }\n\n if (window?.innerWidth) {\n const gridSettings = context.request.gridSettings;\n if (gridSettings) {\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\n return 'xs';\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\n return 'sm';\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\n return 'md';\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\n return 'lg';\n }\n return 'xl';\n }\n }\n\n return 'xs';\n};\n\nconst isMobileView = (context: ICoreContext) => {\n const viewport = getViewport(context);\n return viewport === 'xs' || viewport === 'sm';\n};\n\n/**\n * On select all function.\n * @param props -Invoice table props.\n * @returns On change.\n */\nconst onSelectAllHandler = (props: IInvoicesTableProps) => (isSelected: boolean) => {\n props.data.invoices.forEach(invoice => {\n invoice.isSelected = isSelected;\n });\n props.onChange();\n};\n\nconst InvoicesTable: React.FC = (props: IInvoicesTableProps): JSX.Element => {\n const [isMobile, setIsMobile] = useState(isMobileView(props.context));\n\n const updateViewport = () => {\n setIsMobile(isMobileView(props.context));\n };\n\n if (typeof window !== undefined && window.addEventListener) {\n window.addEventListener('resize', updateViewport);\n }\n const rowClassName = `${props.className}__row`;\n const headerClassName = `${props.className}__header`;\n\n return (\n \n invoice.isSelected)}\n isMobile={isMobile}\n isAdmin={props.data.customer.IsB2bAdmin || false}\n onSelectAll={onSelectAllHandler(props)}\n resources={props.resources}\n data={{}}\n />\n {props.data.invoices.map((invoice, index: number) => {\n return (\n \n );\n })}\n
\n );\n};\n\nexport const InvoicesTableComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IInvoicesTableComponent\n>('InvoicesTableComponent', { component: InvoicesTable });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, ICoreContext, ITelemetry, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { InvoiceModel } from '../helpers/invoice-data';\nimport { payInvoices } from '../helpers/pay-invoices';\nimport { IInvoiceErrorState } from '../invoices-list';\n\ninterface IMakePaymentData {\n invoices: InvoiceModel[];\n}\n\nexport interface IMakePaymentResources {\n makePaymentButtonText: string;\n makePaymentButtonAriaLabel: string;\n}\n\nexport interface IMakePaymentProps extends IComponentProps {\n context: ICoreContext;\n itemKey?: string;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n telemetryContent?: ITelemetryContent;\n navigationUrl?: string;\n buttonReferences?: React.RefObject;\n resources: IMakePaymentResources;\n disabled?: boolean;\n\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\n}\n\nexport interface IMakePaymentComponent extends IComponent {}\n\nconst onClick = async (\n _event: React.MouseEvent,\n props: IMakePaymentProps,\n setDisabled: (disabled: boolean) => void\n): Promise => {\n setDisabled(true);\n\n const propagateError = (errorState: IInvoiceErrorState): void => {\n if (props.onError) {\n props.onError(errorState, props.buttonReferences);\n }\n setDisabled(false);\n };\n\n await payInvoices(props.data.invoices, props.context.actionContext, propagateError);\n};\n\nconst MakePaymentComponentActions = {\n onClick\n};\n\n/**\n * On Click function.\n * @param input -Make payment props.\n * @param setDisabled -Set Disabled.\n * @returns Make payment component on click.\n */\nconst onClickHandler = (input: IMakePaymentProps, setDisabled: React.Dispatch>) => async (\n event: React.MouseEvent\n) => {\n await MakePaymentComponentActions.onClick(event, input, setDisabled);\n};\n\nconst MakePayment: React.FC = (input: IMakePaymentProps): JSX.Element => {\n const {\n data: { invoices }\n } = input;\n // Added condition to enable MakePayment button only if can be paid invoice is selected\n const hasInvoices =\n ArrayExtensions.hasElements(invoices.filter(invoice => invoice.canBePaid)) &&\n ArrayExtensions.hasElements(invoices.filter(invoice => invoice.isSelected));\n const [disabled, setDisabled] = useState(false);\n\n return (\n \n {input.resources.makePaymentButtonText}\n \n );\n};\n\n// @ts-expect-error\nexport const MakePaymentComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'MakePayment',\n { component: MakePayment }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { InvoicePaidStatus, OrderInvoice } from '@msdyn365-commerce/retail-proxy';\n\nexport interface IPayableInvoice {\n readonly id: string;\n readonly canBePaid: boolean;\n}\n\n/**\n * Represents invoice data model.\n */\nexport class InvoiceModel implements IPayableInvoice {\n public id: string;\n\n public invoiceDate?: Date;\n\n public customerAccountNumber?: string;\n\n public customerName?: string;\n\n public amount?: number;\n\n public dueDate?: Date;\n\n public amountDue?: number;\n\n public status?: InvoicePaidStatus;\n\n public currencyCode?: string;\n\n public isSelected: boolean;\n\n public constructor(invoice: OrderInvoice) {\n this.id = invoice.Id || '';\n this.invoiceDate = invoice.InvoiceDate ? new Date(invoice.InvoiceDate) : undefined;\n this.customerAccountNumber = invoice.CustomerAccountNumber;\n this.customerName = invoice.CustomerName;\n this.amount = invoice.TotalAmount;\n this.dueDate = invoice.InvoiceDueDate ? new Date(invoice.InvoiceDueDate) : undefined;\n this.amountDue = invoice.AmountBalance;\n this.status = invoice.InvoicePaidStatusValue;\n this.currencyCode = invoice.CurrencyCode;\n\n this.isSelected = false;\n }\n\n public get canBePaid(): boolean {\n return this.status !== InvoicePaidStatus.Paid;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\ninterface IRequestInvoiceButtonProps {\n innerReference?: React.RefObject;\n className: string;\n requestInvoiceButtonLabel: string;\n onClicked(): void;\n}\n\nexport const RequestInvoiceButton: React.FC = ({\n className,\n onClicked,\n requestInvoiceButtonLabel,\n innerReference\n}) => {\n return (\n \n );\n};\n"],"names":["onSubmitRequestClick","onClosing","filteredInvoices","onSubmitRequest","checkboxRef","closingFlag","map","invoice","index","_inputInvoice$current","current","Number","checked","id","length","searchInputChangedHandler","setSearchInput","event","target","value","onCancelHandler","toggle","renderInvoiceOptions","setSelectedInvoiceIndex","className","_invoice","i","_checkboxRef$current$","React","onInvoiceSelect","onInvoiceSelectHandler","checkboxId","checkboxName","key","type","name","ref","isSelected","undefined","onChange","htmlFor","RequestInvoiceModal","_ref","email","isModalOpen","modalHeaderLabel","sendToEmailLabel","submitRequestLabel","cancelLabel","invoices","searchPlaceholderLabel","invoicesFoundString","singleInvoiceFoundString","searchButtonAltText","resources","selectedInvoiceIndex","setFilteredInvoices","searchInput","shouldShowSearchResults","setShouldShowSearchResults","invoiceOptionsData","invoiceOptions","setInvoiceOptions","focusElement","setTimeout","_focusElement$current","focus","searchEntered","searchEnteredHandler","updatedInvoices","StringExtensions","isNullOrEmpty","filter","toLocaleUpperCase","includes","ArrayExtensions","hasElements","searchResultString","invoicesFoundReplaceIndex","indexOf","Modal","classnames","isOpen","horizontalPosition","verticalPosition","autoFocus","fade","onOpened","setFilteredInvoicesToSelectedInvoices","selectedInvoices","requestInvoiceDialogAriaLabel","ModalHeader","tag","ModalBody","role","substring","placeholder","onClick","title","ModalFooter","InvoicesList","constructor","props","super","_className","buttonChildReference","buttonChildPayButtonReference","invoiceIds","_onDismiss","this","setState","_onToggleInvoiceRequestParentModal","selectedButtonElement","payInvoiceRequestReference","_onToggleInvoiceRequestModal","_queryResultSettings","QueryResultSettingsProxy","fromModuleData","context","request","config","QueryResultSettings","makePaymentReference","_updateInvoicesState","bind","_onAddToCartFailed","_handleFilterStateChange","_loadMoreInvoices","_requestInvoice","_requestSpecificInvoice","_setPayInvoiceErrorModalClose","state","invoicesFilterState","InvoicesFilterState","ShowAll","isLoading","isPageLoaded","errorState","errorMessage","isInvoiceRequestModalOpen","payInvoiceErrorModalOpen","shouldComponentUpdate","nextProps","nextState","data","render","_customerBalance$resu","_customerBalance$resu2","_heading$text","heading","channel","cultureFormatter","formatCurrency","currencyCode","customerBalance","invoicesListTitle","invoicesListDescTitle","invoicesListDescCount","amountText","result","OpenInvoiceBalance","toFixed","Currency","totalCount","OpenInvoiceCount","countText","replace","toString","invoicesListTitleHeading","text","headerClassName","header","Heading","viewProps","_objectSpread","moduleProps","invoiceRequestModal","_renderInvoiceRequestModal","_renderInvoicesFilter","pagination","_renderPagination","content","_renderListContainer","_renderEmptyInvoiceLinesPageContent","renderView","customer","invoicesData","_initializeWithInvoices","reaction","async","_this$props$data$b2bU","callerContext","actionContext","b2bUserId","b2bUserInformation","B2BUserId","invoiceId","BusinessPartnerUsersDataActions","BusinessPartnerOperationDeliveryType","Email","InvoiceModel","_addInvoices","newInvoices","concat","containerClass","actionsContainerClass","invoiceEmptyInvoiceLinesTitle","invoiceEmptyInvoiceLinesDescription","Button","invoiceEmptyInvoiceLinesContinueShoppingButtonAriaLabel","href","getUrlSync","invoiceEmptyInvoiceLinesContinueShoppingButtonText","containerHeaderClass","containerContentClass","isOnBehalfOfRequest","isOboRequest","_renderMakePayment","_renderInvoiceRequestButton","_renderInvoiceErrors","_renderInvoicesList","searchCriteria","businessPartner","getCurrentAsync","BusinessPartnerId","getCustomer","GetCustomerInput","requestContext","apiSettings","CustomerId","AccountNumber","InvoicePaidStatusValues","InvoicePaidStatus","None","Paid","PartiallyPaid","Unpaid","Error","_getInvoicesSearchCriteria","Paging","Skip","getInvoices","GetInvoicesInput","filterClassName","_renderInvoiceInCartPaymentMessage","InvoicesFilterComponent","typeName","currentState","onFilterStateChanged","disabled","tableClassName","InvoicesTableComponent","invoiceButtonReferences","payInvoiceButtonReferences","onError","onRequestInvoice","newErrorState","reference","_newErrorState$errorR","errorHost","errorReason","failureReason","invoiceErrorInvoiceIdNotExist","invoiceErrorFailedAddInvoiceToCart","shouldShowAdditionalInfoInPopup","errorCode","makePaymentResources","makePaymentButtonText","makePaymentButtonAriaLabel","_getSelectedInvoices","MakePaymentComponent","telemetry","moduleId","moduleTypeName","navigationUrl","buttonReferences","_this$state$selectedB","payInvoiceErrorDialogHeader","payInvoiceErrorDialogBodyErrorTitle","payInvoiceErrorDialogBodyErrorDescription","payInvoiceErrorDialogFooterGoToCartButtonText","payInvoiceErrorDialogFooterCancelButtonText","cartUrl","errorClassName","InvoiceErrorComponent","messageHeader","invoiceErrorMessageHeader","otherError","showError","errorDialogHeader","errorDialogBodyErrorTitle","errorDialogBodyErrorDescription","errorDialogFooterGoToCartButtonText","errorDialogFooterCancelButtonText","setPayInvoiceErrorModalClose","_this$props$data$cart","cart","hasInvoiceLine","Alert","invoiceInCartPaymentMessage","_data$invoices","Top","invoicesLoadMore","invoiceRequestModalCancelLabel","invoiceRequestModalSubmitLabel","invoiceRequestModalHeaderLabel","invoiceRequestModalSendToEmailLabel","invoiceRequestModalSearch","invoiceRequestModalInvoiceSearchDisplay","invoiceRequestModalSingleInvoiceSearchDisplay","invoiceRequestModalSearchButton","_this$state$selectedB2","invoiceRequestButtonLabel","isNullOrWhitespace","RequestInvoiceButton","innerReference","requestInvoiceButtonLabel","onClicked","push","specificInvoice","requestInvoiceButtonReference","forEach","__decorate","observer","InvoiceListView","Module","Object","assign","msdyn365Commerce","createComponent","component","errorMessages","color","assertive","message","PayInvoiceComponentActions","_event","setDisabled","payInvoices","onClickHandler","PayInvoiceComponent","useState","innerRef","payInvoiceButtonAriaLabel","canBePaid","payInvoiceButtonText","invoicesToAdd","cartState","getCartState","addInvoicesToCart","_result$errorDetails","_result$errorDetails2","status","errorDetails","LocalizedMessage","ErrorResourceId","_window","window","location","getInvoicesFilterStateResources","filterState","invoicesFilterShowAll","invoiceStatusPaid","invoiceStatusPartiallyPaid","invoiceStatusUnpaid","onStateClick","popoverRef","popoverState","setPopoverState","togglePopover","setFilterState","onFilterStateClick","clickedState","Popover","placement","EnumExtensions","getEnumValues","renderFilterStateItem","stateStringRepresentation","InvoicesTableHeaderComponent","rowClassName","switchCheckedState","onSelectAll","isSelectedAll","headerCells","isMobile","getMobileHeaderCells","invoiceListSelectAllRadioAriaLabelText","invoicesText","invoiceDateMobileText","getDesktopHeaderCells","invoiceNumberText","invoiceDateText","invoiceUsersText","invoiceAmountText","invoiceDueDateText","invoiceAmountDueText","invoiceStatusText","invoiceActionsText","formatAmount","amount","formatDate","date","year","month","day","onRequestSpecificInvoice","setShowActions","setShowPreviousActions","onClickViewDetails","linkToInvoiceDetails","MsDyn365","isBrowser","isShowActions","shouldShowActions","extraActionsPopup","invoiceViewDetailsButtonAriaLabel","invoiceViewDetailsButtonText","invoiceActionsButtonTextAriaLabel","invoiceActionsButtonIsOnBehalfOfTextAriaLabel","showActions","getInvoiceDetailsPageUrlSync","actionsContainerClassName","payInvoiceClassName","wrapperRefiner","refinerRefernce","handleClickOutside","contains","document","addEventListener","removeEventListener","useOutsideClick","payInvoiceReferences","invoiceReferences","InvoicesTableRowComponent","onSelectLine","rowCells","getMobileRowCells","invoiceRowArialabel","format","invoiceListSelectRadioAriaLabelText","customerName","dueDate","getInvoiceStatusText","getDesktopRowCells","isCurrentUser","customerAccountNumber","invoiceDate","invoiceCurrentUser","amountDue","invoiceStatus","invoiceStatusNone","isMobileView","viewport","device","Type","innerWidth","gridSettings","xs","w","sm","md","lg","getViewport","onSelectAllHandler","setIsMobile","updateViewport","all","isAdmin","IsB2bAdmin","MakePaymentComponentActions","input","hasInvoices","Id","InvoiceDate","Date","CustomerAccountNumber","CustomerName","TotalAmount","InvoiceDueDate","AmountBalance","InvoicePaidStatusValue","CurrencyCode"],"sourceRoot":""}