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K,EAAO,oBAAEL,EAAmB,WAAEG,GAAe5T,EAErE,OACIpC,EAAAA,cAACgc,EAAAA,OAAMC,OAAAtP,OAAA,GAAKvK,EAAMwT,aACbJ,EACAK,EACAnK,EACAwK,EACAF,EACI,EAIjB","sources":["webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/invoice-error-component.tsx?6134","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/invoices-filter-component.tsx?9f2d","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/invoices-table/components/invoices-table-header-component.tsx?0449","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/helpers/invoice-status.ts?1374","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/request-invoice-button.tsx?73c5","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/invoices-table/components/invoices-table-row-component.tsx?6c27","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/invoices-table/invoices-table-component.tsx?a00f","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/helpers/pay-invoices.ts?337a","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/make-payment-component.tsx?8159","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/components/request-invoice-modal.tsx?7415","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/helpers/invoice-data.ts?ee70","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/b2b-citta-invoices-list.tsx?0d2f","webpack://Citta2.0/./src/modules/b2b-citta-invoices-list/b2b-citta-invoices-list.view.tsx?6f62"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { Alert, Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface IInvoiceErrorProps extends IComponentProps {\r\n messageHeader?: string;\r\n errorMessage?: string;\r\n otherError?: string;\r\n showError: boolean;\r\n payInvoiceErrorModalOpen: boolean;\r\n\r\n errorDialogHeader: string;\r\n errorDialogBodyErrorTitle: string;\r\n errorDialogBodyErrorDescription: string;\r\n errorDialogFooterGoToCartButtonText: string;\r\n errorDialogFooterCancelButtonText: string;\r\n cartUrl: string;\r\n\r\n setPayInvoiceErrorModalClose(): void;\r\n}\r\n\r\nexport interface IInvoiceErrorComponent extends IComponent {}\r\n\r\nexport const InvoiceError: React.FC = ({\r\n messageHeader,\r\n errorMessage,\r\n otherError,\r\n showError,\r\n payInvoiceErrorModalOpen,\r\n errorDialogHeader,\r\n errorDialogBodyErrorTitle,\r\n errorDialogBodyErrorDescription,\r\n errorDialogFooterGoToCartButtonText,\r\n errorDialogFooterCancelButtonText,\r\n cartUrl,\r\n setPayInvoiceErrorModalClose\r\n}) => {\r\n const errorMessages: (string | undefined)[] = [];\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n } else {\r\n errorMessages.push(errorMessage);\r\n }\r\n\r\n const className = 'msc-pay-invoice-error-dialog';\r\n\r\n return (\r\n <>\r\n 0} color='danger' assertive aria-label={messageHeader}>\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
\r\n {message}\r\n
\r\n );\r\n })}\r\n
\r\n \r\n \r\n {errorDialogHeader}\r\n \r\n \r\n
\r\n
{errorDialogBodyErrorTitle}
\r\n
{errorDialogBodyErrorDescription}
\r\n
\r\n
\r\n \r\n \r\n {errorDialogFooterGoToCartButtonText}\r\n \r\n \r\n {errorDialogFooterCancelButtonText}\r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const InvoiceErrorComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'InvoiceError',\r\n { component: InvoiceError }\r\n);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { EnumExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, Popover } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { IInvoiceStatusResources } from '../helpers/invoice-status';\r\n\r\nexport interface IInvoicesFilterResources extends IInvoiceStatusResources {\r\n invoicesFilterShowAll: string;\r\n}\r\n\r\nexport interface IInvoicesFilterProps extends IComponentProps {\r\n className: string;\r\n disabled: boolean;\r\n\r\n resources: IInvoicesFilterResources;\r\n\r\n currentState: InvoicesFilterState;\r\n onFilterStateChanged(state: InvoicesFilterState): void;\r\n}\r\n\r\nexport enum InvoicesFilterState {\r\n ShowAll,\r\n Paid,\r\n PartiallyPaid,\r\n Unpaid\r\n}\r\n\r\nconst getInvoicesFilterStateResources = (filterState: InvoicesFilterState, resources: IInvoicesFilterResources): string => {\r\n switch (filterState) {\r\n case InvoicesFilterState.ShowAll:\r\n return resources.invoicesFilterShowAll;\r\n case InvoicesFilterState.Paid:\r\n return resources.invoiceStatusPaid;\r\n case InvoicesFilterState.PartiallyPaid:\r\n return resources.invoiceStatusPartiallyPaid;\r\n case InvoicesFilterState.Unpaid:\r\n return resources.invoiceStatusUnpaid;\r\n default:\r\n throw new Error('Failed to retrieve resource description for unknown invoices filter state.');\r\n }\r\n};\r\n\r\n/**\r\n * On Click function.\r\n * @param onStateClick -Invoice filter state function.\r\n * @param filterState -Invoice filter state.\r\n * @returns Set Invoice filter state.\r\n */\r\nconst onClickHandler = (onStateClick: (filterState: InvoicesFilterState) => void, filterState: InvoicesFilterState) => () => {\r\n onStateClick(filterState);\r\n};\r\n\r\nconst renderFilterStateItem = (\r\n filterState: InvoicesFilterState,\r\n resources: IInvoicesFilterResources,\r\n className: string,\r\n onStateClick: (filterState: InvoicesFilterState) => void\r\n): React.ReactNode => {\r\n const stateStringRepresentation = InvoicesFilterState[filterState];\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst InvoicesFilter: React.FC = (props: IInvoicesFilterProps) => {\r\n const popoverRef = React.createRef();\r\n const [popoverState, setPopoverState] = React.useState(false);\r\n const togglePopover = React.useCallback(() => {\r\n setPopoverState(!popoverState);\r\n }, [popoverState]);\r\n\r\n const [filterState, setFilterState] = React.useState(props.currentState);\r\n\r\n const onFilterStateClick = (clickedState: InvoicesFilterState) => {\r\n setFilterState(clickedState);\r\n setPopoverState(false);\r\n props.onFilterStateChanged(clickedState);\r\n };\r\n\r\n return (\r\n
\r\n \r\n {getInvoicesFilterStateResources(filterState, props.resources)}\r\n \r\n \r\n {EnumExtensions.getEnumValues(InvoicesFilterState).map(state => {\r\n return renderFilterStateItem(state, props.resources, props.className, onFilterStateClick);\r\n })}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport const InvoicesFilterComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IInvoicesFilterProps\r\n>('InvoicesFilterComponent', { component: InvoicesFilter });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\n\r\nexport interface IInvoicesTableHeaderResources {\r\n invoicesText: string;\r\n invoiceNumberText: string;\r\n invoiceDateMobileText: string;\r\n invoiceDateText: string;\r\n invoiceUsersText: string;\r\n invoiceAmountText: string;\r\n invoiceDueDateText: string;\r\n invoiceAmountDueText: string;\r\n invoiceStatusText: string;\r\n invoiceActionsText: string;\r\n invoiceListSelectAllRadioAriaLabelText: string;\r\n}\r\n\r\nexport interface IInvoicesTableHeaderProps extends IComponentProps {\r\n context: ICoreContext;\r\n className: string;\r\n\r\n isSelectedAll: boolean;\r\n isMobile: boolean;\r\n isAdmin: boolean;\r\n\r\n resources: IInvoicesTableHeaderResources;\r\n\r\n onSelectAll(isSelected: boolean): void;\r\n}\r\n\r\nexport interface IInvoicesTableHeaderComponent extends IComponent {}\r\n\r\nconst getDesktopHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\r\n const { resources } = props;\r\n return (\r\n <>\r\n \r\n \r\n \r\n {resources.invoiceNumberText}\r\n {resources.invoiceDateText}\r\n {props.isAdmin ? {resources.invoiceUsersText} : null}\r\n {resources.invoiceAmountText}\r\n {resources.invoiceDueDateText}\r\n {resources.invoiceAmountDueText}\r\n {resources.invoiceStatusText}\r\n {resources.invoiceActionsText}\r\n \r\n );\r\n};\r\n\r\nconst getMobileHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\r\n const { resources } = props;\r\n return (\r\n <>\r\n \r\n \r\n \r\n {resources.invoicesText}\r\n {resources.invoiceDateMobileText}\r\n \r\n {` `}\r\n {/* Actions */}\r\n \r\n );\r\n};\r\n\r\nconst InvoicesTableHeader: React.FC = (props: IInvoicesTableHeaderProps): JSX.Element => {\r\n const rowClassName = `${props.className}__row`;\r\n\r\n const switchCheckedState = () => {\r\n props.onSelectAll(!props.isSelectedAll);\r\n };\r\n\r\n let headerCells: JSX.Element;\r\n if (props.isMobile) {\r\n headerCells = getMobileHeaderCells(props, rowClassName, switchCheckedState);\r\n } else {\r\n headerCells = getDesktopHeaderCells(props, rowClassName, switchCheckedState);\r\n }\r\n\r\n return (\r\n \r\n {headerCells}\r\n \r\n );\r\n};\r\n\r\nexport const InvoicesTableHeaderComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IInvoicesTableHeaderComponent\r\n>('InvoicesTableHeaderComponent', { component: InvoicesTableHeader });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { InvoicePaidStatus } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IInvoiceStatusResources {\r\n invoiceStatusNone: string;\r\n invoiceStatusUnpaid: string;\r\n invoiceStatusPartiallyPaid: string;\r\n invoiceStatusPaid: string;\r\n}\r\n\r\nexport const getInvoiceStatusText = (resources: IInvoiceStatusResources, invoiceStatus: InvoicePaidStatus | undefined) => {\r\n switch (invoiceStatus) {\r\n case InvoicePaidStatus.None:\r\n return resources.invoiceStatusNone;\r\n\r\n case InvoicePaidStatus.Unpaid:\r\n return resources.invoiceStatusUnpaid;\r\n\r\n case InvoicePaidStatus.PartiallyPaid:\r\n return resources.invoiceStatusPartiallyPaid;\r\n\r\n case InvoicePaidStatus.Paid:\r\n return resources.invoiceStatusPaid;\r\n default:\r\n return '';\r\n }\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\ninterface IRequestInvoiceButtonProps {\r\n innerReference?: React.RefObject;\r\n className: string;\r\n requestInvoiceButtonLabel: string;\r\n onClicked(): void;\r\n}\r\n\r\nexport const RequestInvoiceButton: React.FC = ({\r\n className,\r\n onClicked,\r\n requestInvoiceButtonLabel,\r\n innerReference\r\n}) => {\r\n return (\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport MsDyn365, { IComponent, IComponentProps, ICoreContext, IDateFormatOptions, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { getInvoiceDetailsPageUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, format } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport { InvoiceModel } from '../../../helpers/invoice-data';\r\nimport { getInvoiceStatusText, IInvoiceStatusResources } from '../../../helpers/invoice-status';\r\nimport { IInvoiceErrorState } from '../../../b2b-citta-invoices-list';\r\n// import { IPayInvoiceResources, PayInvoiceComponent } from '../../pay-invoice-component';\r\nimport { IPayInvoiceResources } from '../../pay-invoice-component';\r\nimport { RequestInvoiceButton } from '../../request-invoice-button';\r\n\r\ninterface IInvoicesTableRowData {\r\n invoice: InvoiceModel;\r\n index: number;\r\n customer: Customer;\r\n}\r\n\r\nexport interface IInvoicesTableRowResources extends IInvoiceStatusResources, IPayInvoiceResources {\r\n invoiceCurrentUser: string;\r\n invoiceViewDetailsButtonText: string;\r\n invoiceViewDetailsButtonAriaLabel: string;\r\n invoiceActionsButtonTextAriaLabel?: string;\r\n invoiceRequestButtonLabel: string;\r\n invoiceListSelectRadioAriaLabelText: string;\r\n}\r\n\r\nexport interface IInvoicesTableRowProps extends IComponentProps {\r\n context: ICoreContext;\r\n className: string;\r\n isMobile: boolean;\r\n invoiceReferences?: React.RefObject;\r\n payInvoiceReferences?: React.RefObject;\r\n resources: IInvoicesTableRowResources;\r\n\r\n onChange(): void;\r\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\r\n onRequestInvoice?(invoice: InvoiceModel, requestInvoiceButtonReference: React.RefObject): void;\r\n}\r\n\r\nexport interface IInvoicesTableRowComponent extends IComponent {}\r\n\r\nconst formatAmount = (context: ICoreContext, amount: number | undefined, currencyCode: string | undefined) => {\r\n if (amount === undefined) {\r\n return '';\r\n }\r\n return context.cultureFormatter.formatCurrency(amount, currencyCode);\r\n};\r\n\r\nconst formatDate = (context: ICoreContext, date: Date | undefined) => {\r\n if (date === undefined) {\r\n return '';\r\n }\r\n\r\n const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };\r\n return context.cultureFormatter.formatDate(date, dateOptions);\r\n};\r\n\r\n/**\r\n * Request specific invoice function.\r\n * @param props -Invoice table row props.\r\n * @param requestInvoiceButtonReference -Reference button.\r\n * @returns Call Request Invoice.\r\n */\r\nconst onRequestSpecificInvoice = (\r\n props: IInvoicesTableRowProps,\r\n requestInvoiceButtonReference: React.RefObject\r\n) => () => {\r\n props.onRequestInvoice!(props.data.invoice, requestInvoiceButtonReference);\r\n};\r\n\r\nconst getDesktopRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\r\n const {\r\n // data: { invoice, index, customer }\r\n data: { invoice, customer }\r\n } = props;\r\n\r\n const isCurrentUser =\r\n !StringExtensions.isNullOrWhitespace(customer.AccountNumber) && customer.AccountNumber === invoice.customerAccountNumber;\r\n // const payInvoiceClassName = `${props.className}__pay-invoice`;\r\n\r\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\r\n const invoiceRowArialabel = format(props.resources.invoiceListSelectRadioAriaLabelText, invoice.id);\r\n const requestInvoiceButtonReference: React.RefObject = React.createRef();\r\n // const payInvoiceButtonReference: React.RefObject = React.createRef();\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n {invoice.id}\r\n \r\n \r\n \r\n {formatDate(props.context, invoice.invoiceDate)}\r\n \r\n {customer.IsB2bAdmin ? (\r\n \r\n {invoice.customerName}\r\n {isCurrentUser ? {props.resources.invoiceCurrentUser} : null}\r\n \r\n ) : null}\r\n {formatAmount(props.context, invoice.amount, invoice.currencyCode)}\r\n \r\n {formatDate(props.context, invoice.dueDate)}\r\n \r\n {formatAmount(props.context, invoice.amountDue, invoice.currencyCode)}\r\n \r\n {getInvoiceStatusText(props.resources, invoice.status)}\r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nlet setShowPreviousActions: React.Dispatch> | undefined;\r\n\r\n/**\r\n * On Click view details function.\r\n * @param linkToInvoiceDetails -Link to invoice details.\r\n * @returns Go to invoice details.\r\n */\r\nconst onClickViewDetails = (linkToInvoiceDetails: string) => () => {\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = linkToInvoiceDetails;\r\n }\r\n return;\r\n};\r\n\r\n/**\r\n * Toggle function.\r\n * @param isShowActions -Link to invoice details.\r\n * @param setShowActions -Link to invoice details.\r\n * @returns Go to invoice details.\r\n */\r\nconst toggle = (isShowActions: boolean, setShowActions: React.Dispatch>) => () => {\r\n const shouldShowActions = !isShowActions;\r\n if (shouldShowActions) {\r\n if (setShowPreviousActions) {\r\n setShowPreviousActions(false);\r\n }\r\n setShowActions(shouldShowActions);\r\n setShowPreviousActions = setShowActions;\r\n } else {\r\n setShowPreviousActions = undefined;\r\n setShowActions(shouldShowActions);\r\n }\r\n};\r\n\r\nconst extraActionsPopup = (props: IInvoicesTableRowProps): JSX.Element | null => {\r\n const {\r\n resources: { invoiceViewDetailsButtonAriaLabel, invoiceViewDetailsButtonText, invoiceActionsButtonTextAriaLabel },\r\n // data: { index }\r\n } = props;\r\n\r\n const [showActions, setShowActions] = useState(false);\r\n\r\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\r\n\r\n const className = `${props.className}__extra-actions-cell`;\r\n const actionsContainerClassName = `${className}__actions-container`;\r\n // const payInvoiceClassName = `${actionsContainerClassName}__pay-invoice`;\r\n return (\r\n
\r\n \r\n {showActions && (\r\n
\r\n \r\n {invoiceViewDetailsButtonText}\r\n \r\n {/* */}\r\n \r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nconst getMobileRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\r\n const {\r\n data: { invoice }\r\n } = props;\r\n\r\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\r\n const invoiceRowArialabel = format(props.resources.invoiceListSelectRadioAriaLabelText, invoice.id);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n {invoice.id}\r\n \r\n
\r\n {/* {invoice.customerName} */}\r\n \r\n \r\n {/* {formatDate(props.context, invoice.dueDate)} */}\r\n {formatDate(props.context, invoice.invoiceDate)}\r\n
\r\n {getInvoiceStatusText(props.resources, invoice.status)}\r\n \r\n {extraActionsPopup(props)}\r\n \r\n );\r\n};\r\n\r\nconst InvoicesTableRow: React.FC = (props: IInvoicesTableRowProps): JSX.Element => {\r\n const {\r\n data: { invoice }\r\n } = props;\r\n\r\n const onSelectLine = () => {\r\n invoice.isSelected = !invoice.isSelected;\r\n props.onChange();\r\n };\r\n\r\n let rowCells: JSX.Element;\r\n if (props.isMobile) {\r\n rowCells = getMobileRowCells(props, onSelectLine);\r\n } else {\r\n rowCells = getDesktopRowCells(props, onSelectLine);\r\n }\r\n\r\n return {rowCells};\r\n};\r\n\r\nexport const InvoicesTableRowComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IInvoicesTableRowComponent\r\n>('InvoicesTableRowComponent', { component: InvoicesTableRow });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport React, { useState } from 'react';\r\n\r\nimport { InvoiceModel } from '../../helpers/invoice-data';\r\nimport { IInvoiceErrorState } from '../../b2b-citta-invoices-list';\r\nimport { IInvoicesTableHeaderResources, InvoicesTableHeaderComponent } from './components/invoices-table-header-component';\r\nimport { IInvoicesTableRowResources, InvoicesTableRowComponent } from './components/invoices-table-row-component';\r\n\r\ninterface IInvoicesTableData {\r\n invoices: InvoiceModel[];\r\n customer: Customer;\r\n}\r\n\r\nexport interface IInvoicesTableResources extends IInvoicesTableHeaderResources, IInvoicesTableRowResources {}\r\n\r\nexport interface IInvoicesTableProps extends IComponentProps {\r\n context: ICoreContext;\r\n className: string;\r\n invoiceButtonReferences?: React.RefObject[];\r\n payInvoiceButtonReferences?: React.RefObject[];\r\n resources: IInvoicesTableResources;\r\n\r\n onChange(): void;\r\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\r\n onRequestInvoice(invoice: InvoiceModel, requestInvoiceButtonReference: React.RefObject): void;\r\n}\r\n\r\nexport interface IInvoicesTableComponent extends IComponent {}\r\n\r\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst getViewport = (context: ICoreContext): GridSize => {\r\n // Always render in mobile viewport on a mobile device\r\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\r\n return 'xs';\r\n }\r\n\r\n if (window?.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n }\r\n return 'xl';\r\n }\r\n }\r\n\r\n return 'xs';\r\n};\r\n\r\nconst isMobileView = (context: ICoreContext) => {\r\n const viewport = getViewport(context);\r\n return viewport === 'xs' || viewport === 'sm';\r\n};\r\n\r\n/**\r\n * On select all function.\r\n * @param props -Invoice table props.\r\n * @returns On change.\r\n */\r\nconst onSelectAllHandler = (props: IInvoicesTableProps) => (isSelected: boolean) => {\r\n props.data.invoices.forEach(invoice => {\r\n invoice.isSelected = isSelected;\r\n });\r\n props.onChange();\r\n};\r\n\r\nconst InvoicesTable: React.FC = (props: IInvoicesTableProps): JSX.Element => {\r\n const [isMobile, setIsMobile] = useState(isMobileView(props.context));\r\n\r\n const updateViewport = () => {\r\n setIsMobile(isMobileView(props.context));\r\n };\r\n\r\n if (typeof window !== undefined && window.addEventListener) {\r\n window.addEventListener('resize', updateViewport);\r\n }\r\n const rowClassName = `${props.className}__row`;\r\n const headerClassName = `${props.className}__header`;\r\n\r\n return (\r\n \r\n invoice.isSelected)}\r\n isMobile={isMobile}\r\n isAdmin={props.data.customer.IsB2bAdmin || false}\r\n onSelectAll={onSelectAllHandler(props)}\r\n resources={props.resources}\r\n data={{}}\r\n />\r\n {props.data.invoices.map((invoice, index: number) => {\r\n return (\r\n \r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\nexport const InvoicesTableComponent: React.FunctionComponent = msdyn365Commerce.createComponent<\r\n // @ts-expect-error\r\n IInvoicesTableComponent\r\n>('InvoicesTableComponent', { component: InvoicesTable });\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { IInvoiceErrorState } from '../b2b-citta-invoices-list';\r\nimport { IPayableInvoice } from './invoice-data';\r\n\r\nexport type ICartActionFailureReason = 'EMPTYINPUT' | 'CARTACTIONFAILED';\r\nexport interface IAddInvoicesToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n}\r\n\r\nexport const payInvoices = async (\r\n invoices: IPayableInvoice[],\r\n actionContext: IActionContext,\r\n onError: (errorState: IInvoiceErrorState) => void\r\n) => {\r\n const invoicesToAdd: string[] = invoices.filter(invoice => invoice.canBePaid).map(invoice => invoice.id);\r\n\r\n if (!ArrayExtensions.hasElements(invoicesToAdd)) {\r\n onError({ errorMessage: '', errorReason: { failureReason: 'EMPTYINPUT' } });\r\n return;\r\n }\r\n\r\n const cartState = await getCartState(actionContext);\r\n const result = await cartState.addInvoicesToCart({ invoiceIds: invoicesToAdd });\r\n\r\n if (result.status !== 'SUCCESS') {\r\n onError({\r\n errorMessage: '',\r\n errorReason: { failureReason: 'CARTACTIONFAILED' },\r\n otherError: result.errorDetails?.LocalizedMessage,\r\n errorCode: result.errorDetails?.ErrorResourceId\r\n });\r\n return;\r\n }\r\n\r\n const cartUrl = getUrlSync('cart', actionContext);\r\n if (cartUrl) {\r\n window?.location.assign(cartUrl);\r\n }\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IComponent, IComponentProps, ICoreContext, ITelemetry, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { InvoiceModel } from '../helpers/invoice-data';\r\nimport { payInvoices } from '../helpers/pay-invoices';\r\nimport { IInvoiceErrorState } from '../b2b-citta-invoices-list';\r\n\r\ninterface IMakePaymentData {\r\n invoices: InvoiceModel[];\r\n}\r\n\r\nexport interface IMakePaymentResources {\r\n makePaymentButtonText: string;\r\n makePaymentButtonAriaLabel: string;\r\n}\r\n\r\nexport interface IMakePaymentProps extends IComponentProps {\r\n context: ICoreContext;\r\n itemKey?: string;\r\n telemetry: ITelemetry;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n telemetryContent?: ITelemetryContent;\r\n navigationUrl?: string;\r\n buttonReferences?: React.RefObject;\r\n resources: IMakePaymentResources;\r\n\r\n onError?(errorState: IInvoiceErrorState, reference?: React.RefObject): void;\r\n}\r\n\r\nexport interface IMakePaymentComponent extends IComponent {}\r\n\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IMakePaymentProps,\r\n setDisabled: (disabled: boolean) => void\r\n): Promise => {\r\n setDisabled(true);\r\n\r\n const propagateError = (errorState: IInvoiceErrorState): void => {\r\n if (props.onError) {\r\n props.onError(errorState, props.buttonReferences);\r\n }\r\n setDisabled(false);\r\n };\r\n\r\n await payInvoices(props.data.invoices, props.context.actionContext, propagateError);\r\n};\r\n\r\nconst MakePaymentComponentActions = {\r\n onClick\r\n};\r\n\r\n/**\r\n * On Click function.\r\n * @param input -Make payment props.\r\n * @param setDisabled -Set Disabled.\r\n * @returns Make payment component on click.\r\n */\r\nconst onClickHandler = (input: IMakePaymentProps, setDisabled: React.Dispatch>) => async (\r\n event: React.MouseEvent\r\n) => {\r\n await MakePaymentComponentActions.onClick(event, input, setDisabled);\r\n};\r\n\r\nconst MakePayment: React.FC = (input: IMakePaymentProps): JSX.Element => {\r\n const {\r\n data: { invoices }\r\n } = input;\r\n const hasInvoices = ArrayExtensions.hasElements(invoices.filter(invoice => invoice.canBePaid));\r\n const [disabled, setDisabled] = useState(false);\r\n\r\n return (\r\n \r\n {input.resources.makePaymentButtonText}\r\n \r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const MakePaymentComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'MakePayment',\r\n { component: MakePayment }\r\n);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\n/* ---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { InvoiceModel } from '../helpers/invoice-data';\r\nimport { IB2bCittaInvoicesListResources } from '../b2b-citta-invoices-list.props.autogenerated';\r\n\r\ninterface IRequestInvoiceModalProps {\r\n className: string;\r\n email: string;\r\n isModalOpen: boolean;\r\n submitRequestLabel: string;\r\n modalHeaderLabel: string;\r\n sendToEmailLabel: string;\r\n cancelLabel: string;\r\n searchPlaceholderLabel: string;\r\n invoices: InvoiceModel[];\r\n invoicesFoundString: string;\r\n singleInvoiceFoundString: string;\r\n searchButtonAltText: string;\r\n resources: IB2bCittaInvoicesListResources;\r\n toggle(): void;\r\n onSubmitRequest(invoiceId: string): void;\r\n extraMessage?: JSX.Element;\r\n}\r\n\r\n/**\r\n * On submit request click function.\r\n * @param selectedInvoiceIndex -Check is busy.\r\n * @param onClosing -On closing function.\r\n * @param filteredInvoices -Invoice modal.\r\n * @param onSubmitRequest -On submit request function.\r\n * @returns Call on submit request.\r\n */\r\nconst onSubmitRequestClick = (\r\n onClosing: () => void,\r\n filteredInvoices: InvoiceModel[],\r\n onSubmitRequest: (invoiceId: string) => void,\r\n checkboxRef: React.MutableRefObject\r\n) => () => {\r\n const defaultIndex = 0;\r\n let closingFlag: number = 0;\r\n\r\n filteredInvoices.map((invoice, index) => {\r\n const inputInvoice = checkboxRef.current[Number(index)] as React.RefObject;\r\n if (inputInvoice.current?.checked === true && index >= defaultIndex) {\r\n onSubmitRequest(invoice.id);\r\n closingFlag = closingFlag + 1;\r\n }\r\n });\r\n if (closingFlag <= filteredInvoices.length) {\r\n onClosing();\r\n }\r\n};\r\n\r\n/**\r\n * On search input change function.\r\n * @param setSearchInput -Set search input.\r\n * @returns Set search input function.\r\n */\r\nconst searchInputChangedHandler = (setSearchInput: React.Dispatch>) => (\r\n event: React.ChangeEvent\r\n) => {\r\n setSearchInput(event.target.value);\r\n};\r\n\r\n/**\r\n * Search entered handler.\r\n * @param invoices -InvoiceModel.\r\n * @param searchInput -String.\r\n * @param setFilteredInvoices -InvoiceModel action.\r\n * @param filteredInvoices -Filtered Invoices.\r\n * @param setSelectedInvoiceIndex -Selected Invoice Index.\r\n * @param setShouldShowSearchResults -Show search result action.\r\n * @param setInvoiceOptions -Invoice options action.\r\n * @param selectedInvoiceIndex -Selected invoice index.\r\n * @param className -String.\r\n * @returns Set invoice options.\r\n */\r\nconst searchEnteredHandler = (\r\n invoices: InvoiceModel[],\r\n searchInput: string,\r\n setFilteredInvoices: React.Dispatch>,\r\n filteredInvoices: InvoiceModel[],\r\n setSelectedInvoiceIndex: React.Dispatch>,\r\n setShouldShowSearchResults: React.Dispatch>,\r\n setInvoiceOptions: React.Dispatch>,\r\n selectedInvoiceIndex: number,\r\n className: string,\r\n checkboxRef: React.MutableRefObject\r\n) => () => {\r\n let updatedInvoices = filteredInvoices;\r\n if (!StringExtensions.isNullOrEmpty(searchInput)) {\r\n updatedInvoices = invoices.filter(invoice => invoice.id.toLocaleUpperCase().includes(searchInput.toLocaleUpperCase()));\r\n }\r\n\r\n if (ArrayExtensions.hasElements(updatedInvoices)) {\r\n setFilteredInvoices(updatedInvoices);\r\n setSelectedInvoiceIndex(0);\r\n } else {\r\n setSelectedInvoiceIndex(-1);\r\n }\r\n setShouldShowSearchResults(true);\r\n\r\n setInvoiceOptions(renderInvoiceOptions(updatedInvoices, setSelectedInvoiceIndex, className, checkboxRef));\r\n};\r\n\r\n/**\r\n * On cancel function.\r\n * @param onClosing -Closing function.\r\n * @param toggle -Toggle Function.\r\n * @returns Toggle function.\r\n */\r\nconst onCancelHandler = (onClosing: () => void, toggle: () => void) => () => {\r\n onClosing();\r\n toggle();\r\n};\r\n\r\n/**\r\n * On invoice select.\r\n * @param setSelectedInvoiceIndex -Set Selected Invoice Index.\r\n * @param index -Number.\r\n * @returns Set Selected Invoice Index.\r\n */\r\nconst onInvoiceSelectHandler = (setSelectedInvoiceIndex: (newIndex: number) => void, index: number) => () => {\r\n setSelectedInvoiceIndex(index);\r\n};\r\n\r\nconst renderInvoiceOptions = (\r\n filteredInvoices: InvoiceModel[],\r\n setSelectedInvoiceIndex: (newIndex: number) => void,\r\n className: string,\r\n checkboxRef: React.MutableRefObject\r\n) => {\r\n checkboxRef.current = filteredInvoices.map((_invoice, i) => checkboxRef.current[Number(i)] ?? React.createRef());\r\n return (\r\n
\r\n {filteredInvoices.map((invoice, index) => {\r\n const onInvoiceSelect = onInvoiceSelectHandler(setSelectedInvoiceIndex, index);\r\n\r\n const checkboxId = `invoice__${invoice.id}`;\r\n const checkboxName = `invoiceSelect__${invoice.id}`;\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\nexport const RequestInvoiceModal: React.FC = ({\r\n className,\r\n email,\r\n isModalOpen,\r\n toggle,\r\n modalHeaderLabel,\r\n sendToEmailLabel,\r\n submitRequestLabel,\r\n cancelLabel,\r\n onSubmitRequest,\r\n invoices,\r\n searchPlaceholderLabel,\r\n invoicesFoundString,\r\n singleInvoiceFoundString,\r\n searchButtonAltText,\r\n resources,\r\n extraMessage\r\n}) => {\r\n const [selectedInvoiceIndex, setSelectedInvoiceIndex] = React.useState(-1);\r\n const [filteredInvoices, setFilteredInvoices] = React.useState(invoices);\r\n const [searchInput, setSearchInput] = React.useState('');\r\n const [shouldShowSearchResults, setShouldShowSearchResults] = React.useState(false);\r\n const focusDelay = 110;\r\n const checkboxRef = React.useRef([]);\r\n const invoiceOptionsData = renderInvoiceOptions(filteredInvoices, setSelectedInvoiceIndex, className, checkboxRef);\r\n const [invoiceOptions, setInvoiceOptions] = React.useState(invoiceOptionsData);\r\n const focusElement = React.useRef(null);\r\n React.useEffect(() => {\r\n if (isModalOpen && focusElement.current) {\r\n setTimeout(() => {\r\n focusElement.current?.focus();\r\n }, focusDelay);\r\n }\r\n }, [isModalOpen]);\r\n\r\n /**\r\n * Sets the filtered invoices to the ones that were selected on the main screen.\r\n */\r\n const setFilteredInvoicesToSelectedInvoices = () => {\r\n setSelectedInvoiceIndex(-1);\r\n const selectedInvoices = invoices.filter(invoice => invoice.isSelected);\r\n if (ArrayExtensions.hasElements(selectedInvoices)) {\r\n setFilteredInvoices(selectedInvoices);\r\n\r\n // If only one invoice selected, auto select it\r\n if (selectedInvoices.length === 1) {\r\n setSelectedInvoiceIndex(0);\r\n }\r\n\r\n setInvoiceOptions(renderInvoiceOptions(selectedInvoices, setSelectedInvoiceIndex, className, checkboxRef));\r\n } else {\r\n setFilteredInvoices(invoices);\r\n setInvoiceOptions(renderInvoiceOptions(invoices, setSelectedInvoiceIndex, className, checkboxRef));\r\n }\r\n };\r\n\r\n const searchEntered = searchEnteredHandler(\r\n invoices,\r\n searchInput,\r\n setFilteredInvoices,\r\n filteredInvoices,\r\n setSelectedInvoiceIndex,\r\n setShouldShowSearchResults,\r\n setInvoiceOptions,\r\n selectedInvoiceIndex,\r\n className,\r\n checkboxRef\r\n );\r\n\r\n const onClosing = () => {\r\n setSelectedInvoiceIndex(-1);\r\n setFilteredInvoices(invoices);\r\n setSearchInput('');\r\n setShouldShowSearchResults(false);\r\n };\r\n\r\n /**\r\n * Sets the invoices that are possible to select when the dialog is opened.\r\n */\r\n const onOpened = () => {\r\n setSearchInput('');\r\n setFilteredInvoicesToSelectedInvoices();\r\n };\r\n\r\n const searchResultString = filteredInvoices.length === 1 ? singleInvoiceFoundString : invoicesFoundString;\r\n const invoicesFoundReplaceIndex = searchResultString.indexOf('{0}');\r\n\r\n return (\r\n \r\n \r\n {modalHeaderLabel}\r\n \r\n \r\n
\r\n \r\n
\r\n {email}\r\n
\r\n
\r\n {shouldShowSearchResults && (\r\n
\r\n {searchResultString.substring(0, invoicesFoundReplaceIndex)}\r\n {filteredInvoices.length}\r\n {searchResultString.substring(invoicesFoundReplaceIndex + 3)}\r\n
\r\n )}\r\n
\r\n \r\n \r\n
\r\n {invoiceOptions}\r\n
\r\n
\r\n
\r\n \r\n \r\n {submitRequestLabel}\r\n \r\n \r\n \r\n {extraMessage ?\r\n
\r\n {extraMessage}\r\n
\r\n : null}\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { InvoicePaidStatus, OrderInvoice } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPayableInvoice {\r\n readonly id: string;\r\n readonly canBePaid: boolean;\r\n}\r\n\r\n/**\r\n * Represents invoice data model.\r\n */\r\nexport class InvoiceModel implements IPayableInvoice {\r\n public id: string;\r\n\r\n public invoiceDate?: Date;\r\n\r\n public customerAccountNumber?: string;\r\n\r\n public customerName?: string;\r\n\r\n public amount?: number;\r\n\r\n public dueDate?: Date;\r\n\r\n public amountDue?: number;\r\n\r\n public status?: InvoicePaidStatus;\r\n\r\n public currencyCode?: string;\r\n\r\n public isSelected: boolean;\r\n\r\n public constructor(invoice: OrderInvoice) {\r\n this.id = invoice.Id || '';\r\n this.invoiceDate = invoice.InvoiceDate ? new Date(invoice.InvoiceDate) : undefined;\r\n this.customerAccountNumber = invoice.CustomerAccountNumber;\r\n this.customerName = invoice.CustomerName;\r\n this.amount = invoice.TotalAmount;\r\n this.dueDate = invoice.InvoiceDueDate ? new Date(invoice.InvoiceDueDate) : undefined;\r\n this.amountDue = invoice.AmountBalance;\r\n this.status = invoice.InvoicePaidStatusValue;\r\n this.currencyCode = invoice.CurrencyCode;\r\n\r\n this.isSelected = false;\r\n }\r\n\r\n public get canBePaid(): boolean {\r\n return this.status !== InvoicePaidStatus.Paid;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getUrlSync, getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport {\r\n BusinessPartnerOperationDeliveryType,\r\n BusinessPartnerUsersDataActions,\r\n InvoicePaidStatus,\r\n InvoiceSearchCriteria,\r\n IQueryResultSettings,\r\n OrderInvoice\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { getCurrentAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\r\nimport {\r\n ArrayExtensions,\r\n getCustomer,\r\n GetCustomerInput,\r\n getInvoices,\r\n GetInvoicesInput,\r\n IQueryResultSettingsModuleConfig,\r\n QueryResultSettingsProxy,\r\n StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { InvoiceErrorComponent } from './components/invoice-error-component';\r\nimport { InvoicesFilterComponent, InvoicesFilterState } from './components/invoices-filter-component';\r\nimport { InvoicesTableComponent } from './components/invoices-table/invoices-table-component';\r\nimport { IMakePaymentResources, MakePaymentComponent } from './components/make-payment-component';\r\nimport { RequestInvoiceButton } from './components/request-invoice-button';\r\nimport { RequestInvoiceModal } from './components/request-invoice-modal';\r\nimport { InvoiceModel } from './helpers/invoice-data';\r\nimport { IAddInvoicesToCartFailureResult } from './helpers/pay-invoices';\r\nimport { IB2bCittaInvoicesListData } from './b2b-citta-invoices-list.data';\r\nimport { IB2bCittaInvoicesListProps } from './b2b-citta-invoices-list.props.autogenerated';\r\n\r\nexport type InvoicesListStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\r\nexport type InvoiceErrorHost = 'ADDINVOICETOCART';\r\n\r\nexport interface IInvoicesListViewProps extends IB2bCittaInvoicesListProps {\r\n moduleProps: IModuleProps;\r\n\r\n header: JSX.Element;\r\n filter: JSX.Element;\r\n content?: JSX.Element;\r\n invoiceRequestModal?: JSX.Element;\r\n pagination?: JSX.Element;\r\n}\r\n\r\nexport interface IInvoiceErrorState {\r\n errorHost?: InvoiceErrorHost;\r\n errorReason?: IAddInvoicesToCartFailureResult;\r\n errorMessage: string;\r\n otherError?: string;\r\n errorCode?: string;\r\n}\r\n\r\nexport interface IInvoicesListState {\r\n invoices: InvoiceModel[];\r\n invoicesFilterState: InvoicesFilterState;\r\n errorState: IInvoiceErrorState;\r\n isInvoiceRequestModalOpen: boolean;\r\n isLoading: boolean;\r\n isPageLoaded: boolean;\r\n payInvoiceErrorModalOpen: boolean;\r\n selectedButtonElement?: HTMLButtonElement | null;\r\n}\r\n\r\n/**\r\n * InvoicesList component.\r\n * @extends {React.Component, IInvoicesListState>}\r\n */\r\nclass InvoicesList extends React.Component, IInvoicesListState> {\r\n private readonly _className: string = 'msc-invoices-list';\r\n\r\n private readonly payInvoiceRequestReference: React.RefObject;\r\n\r\n private readonly makePaymentReference: React.RefObject;\r\n\r\n private buttonChildReference: React.RefObject[] = [];\r\n\r\n private buttonChildPayButtonReference: React.RefObject[] = [];\r\n\r\n private readonly _queryResultSettings: IQueryResultSettings;\r\n\r\n constructor(props: IB2bCittaInvoicesListProps) {\r\n super(props);\r\n\r\n this._queryResultSettings = QueryResultSettingsProxy.fromModuleData(\r\n this.props.context.request,\r\n this.props.config as IQueryResultSettingsModuleConfig\r\n ).QueryResultSettings;\r\n this.payInvoiceRequestReference = React.createRef();\r\n this.makePaymentReference = React.createRef();\r\n this._updateInvoicesState = this._updateInvoicesState.bind(this);\r\n this._onAddToCartFailed = this._onAddToCartFailed.bind(this);\r\n this._onToggleInvoiceRequestModal = this._onToggleInvoiceRequestModal.bind(this);\r\n this._handleFilterStateChange = this._handleFilterStateChange.bind(this);\r\n this._loadMoreInvoices = this._loadMoreInvoices.bind(this);\r\n this._requestInvoice = this._requestInvoice.bind(this);\r\n this._requestSpecificInvoice = this._requestSpecificInvoice.bind(this);\r\n this._setPayInvoiceErrorModalClose = this._setPayInvoiceErrorModalClose.bind(this);\r\n this.state = {\r\n invoices: [],\r\n invoicesFilterState: InvoicesFilterState.ShowAll,\r\n isLoading: true,\r\n isPageLoaded: false,\r\n errorState: { errorMessage: '' },\r\n isInvoiceRequestModalOpen: false,\r\n payInvoiceErrorModalOpen: false,\r\n selectedButtonElement: null\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IB2bCittaInvoicesListProps, nextState: IInvoicesListState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n config: { className = '', heading },\r\n context: {\r\n // request: { channel },\r\n cultureFormatter: {\r\n formatCurrency,\r\n\r\n // @ts-expect-error\r\n currencyCode\r\n }\r\n },\r\n data: { customerBalance },\r\n resources: { invoicesListTitle, invoicesListDescTitle, invoicesListDescCount }\r\n } = this.props;\r\n\r\n const totalAmount = customerBalance.result?.OpenInvoiceBalance || 0;\r\n // const amountText = `${formatCurrency(totalAmount.toFixed(2), currencyCode)} ${channel?.Currency || 'USD'}`;\r\n const amountText = `${formatCurrency(totalAmount.toFixed(2), currencyCode)}`;\r\n\r\n\r\n const totalCount = customerBalance.result?.OpenInvoiceCount || 0;\r\n const countText = invoicesListDescCount.replace('{0}', totalCount.toString());\r\n const invoicesListTitleHeading = heading?.text ?? invoicesListTitle;\r\n\r\n const headerClassName = `${this._className}__header`;\r\n\r\n const header = (\r\n
\r\n \r\n
\r\n
{invoicesListDescTitle}
\r\n
{amountText}
\r\n
{countText}
\r\n
\r\n
\r\n );\r\n\r\n const viewProps: IInvoicesListViewProps = {\r\n ...(this.props as IB2bCittaInvoicesListProps),\r\n moduleProps: {\r\n moduleProps: this.props,\r\n className: classnames(this._className, className)\r\n },\r\n header,\r\n invoiceRequestModal: this._renderInvoiceRequestModal(),\r\n filter: this._renderInvoicesFilter(this._className),\r\n pagination: this._renderPagination()\r\n };\r\n\r\n if (!this.state.isPageLoaded) {\r\n return this.props.renderView(viewProps);\r\n }\r\n\r\n if (ArrayExtensions.hasElements(this.state.invoices)) {\r\n viewProps.content = this._renderListContainer();\r\n } else {\r\n viewProps.content = this._renderEmptyInvoiceLinesPageContent();\r\n }\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n await this.props.data.customer;\r\n const invoicesData = (await this.props.data.invoices);\r\n this._initializeWithInvoices(invoicesData);\r\n }\r\n\r\n private getTime(date?: Date) {\r\n return date != null ? date.getTime() : 0;\r\n }\r\n public sortByinvoiceDate(myArray:any): void {\r\n myArray.sort((a:any, b:any):any => {\r\n return this.getTime(b.invoiceDate) - this.getTime(a.invoiceDate);\r\n });\r\n }\r\n private _initializeWithInvoices(invoicesData: OrderInvoice[]): void {\r\n const invoices = invoicesData.map((invoice, index) => {\r\n this.buttonChildReference[Number(index)] = React.createRef();\r\n this.buttonChildPayButtonReference[Number(index)] = React.createRef();\r\n return new InvoiceModel(invoice);\r\n });\r\n this.sortByinvoiceDate(invoices);\r\n this.setState({\r\n invoices,\r\n isLoading: false,\r\n isPageLoaded: true\r\n });\r\n }\r\n\r\n private _addInvoices(invoicesData: OrderInvoice[]): void {\r\n const newInvoices = invoicesData.map(invoice => new InvoiceModel(invoice));\r\n const invoices = this.state.invoices.concat(newInvoices);\r\n this.setState({\r\n invoices,\r\n isLoading: false\r\n });\r\n }\r\n\r\n private _renderEmptyInvoiceLinesPageContent(): JSX.Element {\r\n const containerClass = `${this._className}__empty-lines__container`;\r\n const actionsContainerClass = `${containerClass}__actions`;\r\n return (\r\n
\r\n
{this.props.resources.invoiceEmptyInvoiceLinesTitle}
\r\n
{this.props.resources.invoiceEmptyInvoiceLinesDescription}
\r\n
\r\n \r\n {this.props.resources.invoiceEmptyInvoiceLinesContinueShoppingButtonText}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private _getMessageTextArea(): JSX.Element | undefined {\r\n if (!this.props.config.contactAdminMessage) {\r\n return;\r\n } else {\r\n return \r\n }\r\n }\r\n\r\n private _renderContactMessage(forMobile: boolean): JSX.Element {\r\n if (!this.props.config.contactAdminMessage) {\r\n return <>;\r\n }\r\n return (\r\n
\r\n {this._getMessageTextArea()}\r\n
\r\n )\r\n }\r\n\r\n private _renderListContainer(): JSX.Element {\r\n const containerClass = `${this._className}__container`;\r\n const containerHeaderClass = `${containerClass}__header`;\r\n const containerContentClass = `${containerClass}__content`;\r\n\r\n return (\r\n
\r\n
\r\n {this._renderMakePayment(containerHeaderClass)}\r\n {this._renderInvoiceRequestButton()}\r\n {this._renderContactMessage(false)}\r\n
\r\n {this._renderContactMessage(true)}\r\n
{this._renderInvoiceErrors()}
\r\n
{this._renderInvoicesList(containerContentClass)}
\r\n
\r\n );\r\n }\r\n\r\n private _updateInvoicesState(): void {\r\n this.setState({\r\n invoices: this.state.invoices\r\n });\r\n }\r\n\r\n private async _getInvoicesSearchCriteria(state: InvoicesFilterState): Promise {\r\n const searchCriteria: InvoiceSearchCriteria = {};\r\n\r\n const context = this.props.context.actionContext;\r\n\r\n const businessPartner = await getCurrentAsync({ callerContext: context });\r\n searchCriteria.BusinessPartnerId = businessPartner.BusinessPartnerId;\r\n\r\n const customer = await getCustomer(new GetCustomerInput(context.requestContext.apiSettings), context);\r\n searchCriteria.CustomerId = customer.AccountNumber;\r\n\r\n switch (state) {\r\n case InvoicesFilterState.ShowAll:\r\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.None];\r\n break;\r\n case InvoicesFilterState.Paid:\r\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.Paid];\r\n break;\r\n case InvoicesFilterState.PartiallyPaid:\r\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.PartiallyPaid];\r\n break;\r\n case InvoicesFilterState.Unpaid:\r\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.Unpaid];\r\n break;\r\n default:\r\n throw new Error('Failed to process unknown invoices filter state.');\r\n }\r\n\r\n return searchCriteria;\r\n }\r\n\r\n private async _handleFilterStateChange(state: InvoicesFilterState): Promise {\r\n this.setState({\r\n invoicesFilterState: state,\r\n isLoading: true\r\n });\r\n\r\n const searchCriteria = await this._getInvoicesSearchCriteria(state);\r\n\r\n if (this._queryResultSettings.Paging) {\r\n this._queryResultSettings.Paging.Skip = 0;\r\n }\r\n\r\n const invoices = await getInvoices(\r\n new GetInvoicesInput(searchCriteria, this._queryResultSettings),\r\n this.props.context.actionContext\r\n );\r\n this._initializeWithInvoices(invoices);\r\n }\r\n\r\n private _renderInvoicesFilter(className: string): JSX.Element {\r\n const filterClassName = `${className}__filter`;\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _renderInvoicesList(className: string): JSX.Element {\r\n const tableClassName = `${className}__table`;\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _onAddToCartFailed(newErrorState: IInvoiceErrorState, reference?: React.RefObject): void {\r\n const errorState = { ...newErrorState };\r\n errorState.errorHost = 'ADDINVOICETOCART';\r\n errorState.errorMessage =\r\n newErrorState.errorReason?.failureReason === 'EMPTYINPUT'\r\n ? this.props.resources.invoiceErrorInvoiceIdNotExist\r\n : this.props.resources.invoiceErrorFailedAddInvoiceToCart;\r\n\r\n const shouldShowAdditionalInfoInPopup =\r\n errorState.errorCode === 'Microsoft_Dynamics_Commerce_Runtime_InvoiceLineNotAllowedWithItemLines';\r\n this.setState({ errorState, payInvoiceErrorModalOpen: shouldShowAdditionalInfoInPopup, selectedButtonElement: reference?.current });\r\n }\r\n\r\n private _renderMakePayment(className: string): JSX.Element {\r\n const id = `${className}__make-payment`;\r\n const makePaymentResources: IMakePaymentResources = {\r\n makePaymentButtonText: this.props.resources.makePaymentButtonText,\r\n makePaymentButtonAriaLabel: this.props.resources.makePaymentButtonAriaLabel\r\n };\r\n\r\n const selectedInvoices = this._getSelectedInvoices();\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _setPayInvoiceErrorModalClose(): void {\r\n this.setState({\r\n payInvoiceErrorModalOpen: false\r\n });\r\n this.state.selectedButtonElement?.focus();\r\n }\r\n\r\n private _renderInvoiceErrors(): JSX.Element {\r\n const {\r\n resources: {\r\n payInvoiceErrorDialogHeader,\r\n payInvoiceErrorDialogBodyErrorTitle,\r\n payInvoiceErrorDialogBodyErrorDescription,\r\n payInvoiceErrorDialogFooterGoToCartButtonText,\r\n payInvoiceErrorDialogFooterCancelButtonText\r\n }\r\n } = this.props;\r\n\r\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\r\n\r\n const errorClassName = `${this._className}__errors`;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _renderPagination(): JSX.Element | undefined {\r\n const { data, resources } = this.props;\r\n // const invoices = data?.invoices?.result;\r\n const invoices = data?.invoices?.result;\r\n if (!invoices || invoices.length < this._queryResultSettings.Paging!.Top!) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n {resources.invoicesLoadMore}\r\n \r\n );\r\n }\r\n\r\n private async _loadMoreInvoices(): Promise {\r\n this.setState({ isLoading: true });\r\n const searchCriteria = await this._getInvoicesSearchCriteria(this.state.invoicesFilterState);\r\n if (this._queryResultSettings.Paging) {\r\n this._queryResultSettings.Paging.Skip! += this._queryResultSettings.Paging.Top!;\r\n }\r\n const newInvoices = await getInvoices(\r\n new GetInvoicesInput(searchCriteria, this._queryResultSettings),\r\n this.props.context.actionContext\r\n );\r\n this._addInvoices(newInvoices);\r\n }\r\n\r\n private _renderInvoiceRequestModal(): JSX.Element {\r\n const customer = this.props.data.customer.result;\r\n const {\r\n invoiceRequestModalCancelLabel,\r\n invoiceRequestModalSubmitLabel,\r\n invoiceRequestModalHeaderLabel,\r\n invoiceRequestModalSendToEmailLabel,\r\n invoiceRequestModalSearch,\r\n invoiceRequestModalInvoiceSearchDisplay,\r\n invoiceRequestModalSingleInvoiceSearchDisplay,\r\n invoiceRequestModalSearchButton\r\n } = this.props.resources;\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _onToggleInvoiceRequestModal(): void {\r\n this.setState({\r\n isInvoiceRequestModalOpen: !this.state.isInvoiceRequestModalOpen\r\n });\r\n if (this.state.isInvoiceRequestModalOpen) {\r\n this.state.selectedButtonElement?.focus();\r\n }\r\n }\r\n\r\n /**\r\n * Request specific invoice function.\r\n */\r\n private readonly _onToggleInvoiceRequestParentModal = () => {\r\n this.setState(\r\n {\r\n selectedButtonElement: this.payInvoiceRequestReference.current\r\n },\r\n () => {\r\n this._onToggleInvoiceRequestModal();\r\n }\r\n );\r\n };\r\n\r\n private _renderInvoiceRequestButton(): JSX.Element | undefined {\r\n const { invoiceRequestButtonLabel } = this.props.resources;\r\n const customer = this.props.data.customer.result;\r\n\r\n if (StringExtensions.isNullOrWhitespace(customer?.Email)) {\r\n return;\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _requestInvoice(invoiceId: string): void {\r\n const context = { callerContext: this.props.context.actionContext };\r\n const b2bUserId: string = this.props.data.b2bUserInformation?.result?.B2BUserId || '';\r\n\r\n BusinessPartnerUsersDataActions.requestInvoiceCopyAsync(context, b2bUserId, invoiceId, BusinessPartnerOperationDeliveryType.Email);\r\n\r\n this._onToggleInvoiceRequestModal();\r\n }\r\n\r\n private _getSelectedInvoices(): InvoiceModel[] {\r\n let selectedInvoices = this.state.invoices.filter(invoice => invoice.isSelected);\r\n if (!ArrayExtensions.hasElements(selectedInvoices)) {\r\n selectedInvoices = this.state.invoices;\r\n }\r\n\r\n return selectedInvoices;\r\n }\r\n\r\n private _requestSpecificInvoice(\r\n specificInvoice: InvoiceModel,\r\n requestInvoiceButtonReference: React.RefObject\r\n ): void {\r\n this.state.invoices.forEach((invoice: InvoiceModel) => {\r\n if (invoice === specificInvoice) {\r\n invoice.isSelected = true;\r\n } else {\r\n invoice.isSelected = false;\r\n }\r\n });\r\n this.setState({\r\n selectedButtonElement: requestInvoiceButtonReference.current\r\n });\r\n this._onToggleInvoiceRequestModal();\r\n }\r\n}\r\n\r\nexport default InvoicesList;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IInvoicesListViewProps } from './b2b-citta-invoices-list';\r\n\r\nexport const InvoiceListView: React.FC = props => {\r\n const { header, filter, content, invoiceRequestModal, pagination } = props;\r\n\r\n return (\r\n \r\n {header}\r\n {invoiceRequestModal}\r\n {filter}\r\n {content}\r\n {pagination}\r\n \r\n );\r\n};\r\n\r\nexport default InvoiceListView;\r\n"],"names":["InvoiceErrorComponent","msdyn365Commerce","createComponent","component","_ref","messageHeader","errorMessage","otherError","showError","payInvoiceErrorModalOpen","errorDialogHeader","errorDialogBodyErrorTitle","errorDialogBodyErrorDescription","errorDialogFooterGoToCartButtonText","errorDialogFooterCancelButtonText","cartUrl","setPayInvoiceErrorModalClose","errorMessages","push","className","React","Alert","isOpen","length","color","assertive","map","message","index","key","Modal","toggle","ModalHeader","ModalBody","ModalFooter","Button","title","href","role","onClick","InvoicesFilterState","getInvoicesFilterStateResources","filterState","resources","ShowAll","invoicesFilterShowAll","Paid","invoiceStatusPaid","PartiallyPaid","invoiceStatusPartiallyPaid","Unpaid","invoiceStatusUnpaid","Error","onClickHandler","onStateClick","InvoicesFilterComponent","props","popoverRef","popoverState","setPopoverState","togglePopover","setFilterState","currentState","onFilterStateClick","clickedState","onFilterStateChanged","innerRef","disabled","Popover","id","placement","target","EnumExtensions","getEnumValues","state","renderFilterStateItem","stateStringRepresentation","InvoicesTableHeaderComponent","rowClassName","switchCheckedState","onSelectAll","isSelectedAll","headerCells","isMobile","getMobileHeaderCells","classnames","type","invoiceListSelectAllRadioAriaLabelText","checked","onChange","invoicesText","invoiceDateMobileText","getDesktopHeaderCells","invoiceNumberText","invoiceDateText","isAdmin","invoiceUsersText","invoiceAmountText","invoiceDueDateText","invoiceAmountDueText","invoiceStatusText","invoiceActionsText","getInvoiceStatusText","invoiceStatus","InvoicePaidStatus","None","invoiceStatusNone","RequestInvoiceButton","onClicked","requestInvoiceButtonLabel","innerReference","formatAmount","context","amount","currencyCode","undefined","cultureFormatter","formatCurrency","formatDate","date","year","month","day","onRequestSpecificInvoice","requestInvoiceButtonReference","onRequestInvoice","data","invoice","setShowPreviousActions","onClickViewDetails","linkToInvoiceDetails","MsDyn365","isBrowser","window","location","isShowActions","setShowActions","shouldShowActions","getMobileRowCells","onSelectLine","getInvoiceDetailsPageUrlSync","actionContext","invoiceRowArialabel","format","invoiceListSelectRadioAriaLabelText","isSelected","invoiceDate","status","invoiceViewDetailsButtonAriaLabel","invoiceViewDetailsButtonText","invoiceActionsButtonTextAriaLabel","showActions","useState","actionsContainerClassName","invoiceReferences","invoiceRequestButtonLabel","extraActionsPopup","InvoicesTableRowComponent","rowCells","getDesktopRowCells","customer","isCurrentUser","StringExtensions","isNullOrWhitespace","AccountNumber","customerAccountNumber","IsB2bAdmin","customerName","invoiceCurrentUser","dueDate","amountDue","isMobileView","viewport","_window","request","device","Type","innerWidth","gridSettings","xs","w","sm","md","lg","getViewport","onSelectAllHandler","invoices","forEach","InvoicesTableComponent","setIsMobile","updateViewport","addEventListener","headerClassName","typeName","ArrayExtensions","all","onError","invoiceButtonReferences","Number","payInvoiceReferences","payInvoiceButtonReferences","MakePaymentComponentActions","async","_event","setDisabled","invoicesToAdd","filter","canBePaid","hasElements","errorReason","failureReason","cartState","getCartState","result","addInvoicesToCart","invoiceIds","_result$errorDetails","_result$errorDetails2","errorDetails","LocalizedMessage","errorCode","ErrorResourceId","getUrlSync","assign","payInvoices","errorState","buttonReferences","input","event","MakePaymentComponent","hasInvoices","makePaymentButtonAriaLabel","makePaymentButtonText","onSubmitRequestClick","onClosing","filteredInvoices","onSubmitRequest","checkboxRef","closingFlag","_inputInvoice$current","current","searchInputChangedHandler","setSearchInput","value","onCancelHandler","renderInvoiceOptions","setSelectedInvoiceIndex","_invoice","i","_checkboxRef$current$","onInvoiceSelect","onInvoiceSelectHandler","checkboxId","checkboxName","name","ref","htmlFor","RequestInvoiceModal","email","isModalOpen","modalHeaderLabel","sendToEmailLabel","submitRequestLabel","cancelLabel","searchPlaceholderLabel","invoicesFoundString","singleInvoiceFoundString","searchButtonAltText","extraMessage","selectedInvoiceIndex","setFilteredInvoices","searchInput","shouldShowSearchResults","setShouldShowSearchResults","invoiceOptionsData","invoiceOptions","setInvoiceOptions","focusElement","setTimeout","_focusElement$current","focus","searchEntered","searchEnteredHandler","updatedInvoices","isNullOrEmpty","toLocaleUpperCase","includes","searchResultString","invoicesFoundReplaceIndex","indexOf","horizontalPosition","verticalPosition","autoFocus","fade","onOpened","setFilteredInvoicesToSelectedInvoices","selectedInvoices","requestInvoiceDialogAriaLabel","tag","substring","placeholder","InvoiceModel","constructor","this","Id","InvoiceDate","Date","CustomerAccountNumber","CustomerName","TotalAmount","InvoiceDueDate","AmountBalance","InvoicePaidStatusValue","CurrencyCode","InvoicesList","super","_className","buttonChildReference","buttonChildPayButtonReference","_onToggleInvoiceRequestParentModal","setState","selectedButtonElement","payInvoiceRequestReference","_onToggleInvoiceRequestModal","_queryResultSettings","QueryResultSettingsProxy","fromModuleData","config","QueryResultSettings","makePaymentReference","_updateInvoicesState","bind","_onAddToCartFailed","_handleFilterStateChange","_loadMoreInvoices","_requestInvoice","_requestSpecificInvoice","_setPayInvoiceErrorModalClose","invoicesFilterState","isLoading","isPageLoaded","isInvoiceRequestModalOpen","shouldComponentUpdate","nextProps","nextState","render","_customerBalance$resu","_customerBalance$resu2","_heading$text","heading","customerBalance","invoicesListTitle","invoicesListDescTitle","invoicesListDescCount","amountText","OpenInvoiceBalance","toFixed","totalCount","OpenInvoiceCount","countText","replace","toString","invoicesListTitleHeading","text","header","Heading","viewProps","_objectSpread","moduleProps","invoiceRequestModal","_renderInvoiceRequestModal","_renderInvoicesFilter","pagination","_renderPagination","content","_renderListContainer","_renderEmptyInvoiceLinesPageContent","renderView","invoicesData","_initializeWithInvoices","getTime","sortByinvoiceDate","myArray","sort","a","b","_addInvoices","newInvoices","concat","containerClass","actionsContainerClass","invoiceEmptyInvoiceLinesTitle","invoiceEmptyInvoiceLinesDescription","invoiceEmptyInvoiceLinesContinueShoppingButtonAriaLabel","invoiceEmptyInvoiceLinesContinueShoppingButtonText","_getMessageTextArea","contactAdminMessage","dangerouslySetInnerHTML","getRichTextHtml","_renderContactMessage","forMobile","containerHeaderClass","containerContentClass","_renderMakePayment","_renderInvoiceRequestButton","_renderInvoiceErrors","_renderInvoicesList","searchCriteria","businessPartner","getCurrentAsync","callerContext","BusinessPartnerId","getCustomer","GetCustomerInput","requestContext","apiSettings","CustomerId","InvoicePaidStatusValues","_getInvoicesSearchCriteria","Paging","Skip","getInvoices","GetInvoicesInput","filterClassName","tableClassName","newErrorState","reference","_newErrorState$errorR","errorHost","invoiceErrorInvoiceIdNotExist","invoiceErrorFailedAddInvoiceToCart","shouldShowAdditionalInfoInPopup","makePaymentResources","_getSelectedInvoices","telemetry","moduleId","moduleTypeName","navigationUrl","_this$state$selectedB","payInvoiceErrorDialogHeader","payInvoiceErrorDialogBodyErrorTitle","payInvoiceErrorDialogBodyErrorDescription","payInvoiceErrorDialogFooterGoToCartButtonText","payInvoiceErrorDialogFooterCancelButtonText","errorClassName","invoiceErrorMessageHeader","_data$invoices","Top","invoicesLoadMore","invoiceRequestModalCancelLabel","invoiceRequestModalSubmitLabel","invoiceRequestModalHeaderLabel","invoiceRequestModalSendToEmailLabel","invoiceRequestModalSearch","invoiceRequestModalInvoiceSearchDisplay","invoiceRequestModalSingleInvoiceSearchDisplay","invoiceRequestModalSearchButton","Email","_this$state$selectedB2","invoiceId","_this$props$data$b2bU","b2bUserId","b2bUserInformation","B2BUserId","BusinessPartnerUsersDataActions","BusinessPartnerOperationDeliveryType","specificInvoice","InvoiceListView","Module","Object"],"sourceRoot":""}