{"version":3,"sources":["webpack:///src/modules/invoices-list/index.ts?0857","webpack:///src/modules/invoices-list/components/request-invoice-button.tsx?b5d9","webpack:///src/modules/invoice-details/invoice-details.view.tsx?5ebe","webpack:///src/modules/invoices-list/components/pay-invoice-component.tsx?41f4","webpack:///src/index.ts?c6ae","webpack:///src/modules/invoices-list/components/invoices-table/invoices-table-component.tsx?9105","webpack:///src/modules/invoices-list/invoices-list.view.tsx?0243","webpack:///src/modules/invoices-list/components/make-payment-component.tsx?c79a","webpack:///src/modules/invoices-list/components/invoice-error-component.tsx?2e12","webpack:///src/modules/invoices-list/helpers/pay-invoices.ts?f98a","webpack:///src/modules/invoice-details/components/invoice-details-header.tsx?d1cb","webpack:///src/modules/invoice-details/components/invoice-details-payment-summary.tsx?a7ab","webpack:///src/modules/invoice-details/components/invoice-details-products.tsx?d808","webpack:///src/modules/invoice-details/helpers/invoice-data.ts?1fa7","webpack:///src/modules/invoice-details/invoice-details.tsx?b5c9","webpack:///src/modules/invoices-list/components/invoices-table/components/invoices-table-header-component.tsx?6874","webpack:///src/modules/invoices-list/components/invoices-table/components/invoices-table-row-component.tsx?ba14","webpack:///src/modules/invoices-list/helpers/invoice-data.ts?6271","webpack:///src/modules/invoices-list/helpers/invoice-status.ts?442a","webpack:///src/modules/invoices-list/helpers/index.ts?7d24","webpack:///src/modules/invoices-list/components/invoices-filter-component.tsx?759c","webpack:///src/invoice-summary-lineitem.tsx?1b66","webpack:///src/modules/invoices-list/components/request-invoice-modal.tsx?f430","webpack:///src/modules/invoices-list/invoices-list.tsx?ba10"],"names":["RequestInvoiceButton","className","onClicked","requestInvoiceButtonLabel","onClick","InvoiceDetailsView","props","header","products","paymentDetails","payInvoiceError","moduleProps","PayInvoiceComponentActions","async","_event","setDisabled","data","invoice","context","actionContext","errorState","onError","PayInvoiceComponent","createComponent","component","disabled","resources","payInvoiceButtonAriaLabel","event","canBePaid","payInvoiceButtonText","isMobileView","viewport","request","device","Type","window","innerWidth","gridSettings","xs","w","sm","md","lg","getViewport","InvoicesTableComponent","isMobile","setIsMobile","updateViewport","undefined","addEventListener","rowClassName","headerClassName","typeName","id","isSelectedAll","all","invoices","isSelected","isAdmin","customer","IsB2bAdmin","onSelectAll","forEach","onChange","map","index","key","onRequestInvoice","InvoiceListView","filter","content","invoiceRequestModal","pagination","MakePaymentComponentActions","MakePaymentComponent","input","hasInvoices","hasElements","makePaymentButtonAriaLabel","makePaymentButtonText","InvoiceErrorComponent","messageHeader","errorMessage","otherError","showError","payInvoiceErrorModalOpen","errorDialogHeader","errorDialogBodyErrorTitle","errorDialogBodyErrorDescription","errorDialogFooterGoToCartButtonText","errorDialogFooterCancelButtonText","cartUrl","setPayInvoiceErrorModalClose","errorMessages","push","isOpen","length","color","assertive","message","toggle","title","href","payInvoices","invoicesToAdd","errorReason","failureReason","cartState","result","addInvoicesToCart","invoiceIds","status","errorDetails","LocalizedMessage","location","assign","InvoiceDetailsHeaderComponent","invoiceDetails","invoiceNumberText","invoiceIdLabel","replace","invoiceOrderItemsText","lines","invoiceOrderItem","invoiceOrderItems","toString","invoiceInfoContainerClassName","orderInfoContainerClassName","orderInfoClassName","orderMainInfoClassName","orderDetailsClassName","actionsClassName","amountSummaryClassName","orderDate","date","cultureFormatter","formatDate","year","month","day","formatShortDate","invoiceDate","dueDate","formatLongDate","dueDateText","invoicePaymentDueDateText","invoicePlacedByLabel","customerName","invoiceAmountDueText","amount","currencyCode","formatCurrency","formatAmount","amountDue","InvoiceDetailsPaymentDetailsComponent","invoicePaymentDetails","lineClassName","isNullOrUndefined","totalDiscount","label","invoicePaymentDiscounts","value","subtotal","invoicePaymentSubtotal","totalCharges","invoicePaymentCharges","totalTax","invoicePaymentTax","totalAmount","invoicePaymentInvoiceTotal","line","InvoiceDetailsProductsComponent","productLineClass","productLineInfoContainerClass","productLineDetailsClass","productLineSmallDetailsClass","product","quantity","Quantity","productUrl","ProductName","RecordId","imageSettings","cropFocalRegion","fallbackImage","ItemId","requestContext","apiSettings","altText","src","primaryImageUrl","fallBackSrc","viewports","q","h","xl","lazyload","loadFailureBehavior","_renderProductImage","isNullOrWhitespace","ColorName","invoiceProductColor","SizeName","invoiceProductSize","StyleName","invoiceProductStyle","_renderProductDimensions","Price","invoiceQuantity","NetAmount","InvoiceDetailsModel","this","Id","InvoiceDate","Date","CustomerName","InvoiceDueDate","AmountBalance","InvoicePaidStatusValue","SalesInvoiceLine","find","PrimaryImageUrl","TotalDiscount","InvoiceSubtotal","TotalCharges","TotalTaxAmount","TotalAmount","CurrencyCode","super","state","_onAddToCartFailed","bind","_setPayInvoiceErrorModalClose","_getProducts","ChannelId","invoiceDetailsModel","setState","_renderHeader","_renderProducts","_renderPaymentDetails","_renderInvoiceErrors","_className","renderView","invoiceLines","channelId","productInputs","payInvoiceErrorDialogHeader","payInvoiceErrorDialogBodyErrorTitle","payInvoiceErrorDialogBodyErrorDescription","payInvoiceErrorDialogFooterGoToCartButtonText","payInvoiceErrorDialogFooterCancelButtonText","errorClassName","InvoicesTableHeaderComponent","switchCheckedState","headerCells","type","checked","invoicesText","invoiceDateMobileText","getMobileHeaderCells","invoiceDateText","invoiceUsersText","invoiceAmountText","invoiceDueDateText","invoiceStatusText","invoiceActionsText","getDesktopHeaderCells","setShowPreviousActions","getMobileRowCells","onSelectLine","linkToInvoiceDetails","invoiceViewDetailsButtonAriaLabel","invoiceViewDetailsButtonText","showActions","setShowActions","actionsContainerClassName","payInvoiceClassName","shouldShowActions","isBrowser","invoiceRequestButtonLabel","extraActionsPopup","InvoicesTableRowComponent","rowCells","isCurrentUser","AccountNumber","customerAccountNumber","invoiceCurrentUser","getDesktopRowCells","InvoiceModel","CustomerAccountNumber","getInvoiceStatusText","invoiceStatus","invoiceStatusNone","invoiceStatusUnpaid","invoiceStatusPartiallyPaid","invoiceStatusPaid","InvoicesFilterState","getInvoicesFilterStateResources","filterState","ShowAll","invoicesFilterShowAll","Paid","PartiallyPaid","Unpaid","Error","InvoicesFilterComponent","popoverRef","createRef","popoverState","setPopoverState","useState","togglePopover","setFilterState","currentState","onFilterStateClick","clickedState","onFilterStateChanged","innerRef","placement","target","getEnumValues","onStateClick","stateStringRepresentation","role","renderFilterStateItem","InvoiceSummaryLine","price","toBeCalculatedText","freeText","cssLabel","CustomerContextualPrice","freePriceText","_buildPaymentSummarySection","telemetry","_computedLoyaltyAmount","checkoutState","loyaltyAmount","InvoiceSummary","CartLines","cart","cartLine","IsInvoiceLine","reactNodes","invoiceLine","InvoiceAmount","invoiceLabel","InvoiceId","orderTotal","orderTotalLabel","giftCardAmount","giftCardTotalValue","giftCardExtends","reduce","count","giftCard","Balance","Math","min","_computeGiftCardAmount","totalAmountAfterGiftCard","loyalty","loyaltyLabel","giftcardLabel","RequestInvoiceModal","email","isModalOpen","modalHeaderLabel","sendToEmailLabel","submitRequestLabel","cancelLabel","onSubmitRequest","searchPlaceholderLabel","invoicesFoundString","singleInvoiceFoundString","selectedInvoiceIndex","setSelectedInvoiceIndex","filteredInvoices","setFilteredInvoices","searchInput","setSearchInput","shouldShowSearchResults","setShouldShowSearchResults","setFilteredInvoicesToSelectedInvoices","selectedInvoices","invoiceOptions","renderInvoiceOptions","onClosing","onCancel","searchResultString","invoicesFoundReplaceIndex","indexOf","horizontalPosition","verticalPosition","autoFocus","fade","onOpened","htmlFor","substring","placeholder","e","updatedInvoices","isNullOrEmpty","includes","radioButtonId","name","_queryResultSettings","fromModuleData","config","QueryResultSettings","_updateInvoicesState","_onToggleInvoiceRequestModal","_handleFilterStateChange","_loadMoreInvoices","_requestInvoice","_requestSpecificInvoice","invoicesFilterState","isLoading","isPageLoaded","isInvoiceRequestModalOpen","channel","customerBalance","invoicesListTitle","invoicesListDescTitle","invoicesListDescCount","amountText","OpenInvoiceBalance","toFixed","Currency","totalCount","OpenInvoiceCount","countText","text","viewProps","_renderInvoiceRequestModal","_renderInvoicesFilter","_renderPagination","_renderListContainer","_renderEmptyInvoiceLinesPageContent","invoicesData","_initializeWithInvoices","newInvoices","concat","containerClass","actionsContainerClass","invoiceEmptyInvoiceLinesTitle","invoiceEmptyInvoiceLinesDescription","invoiceEmptyInvoiceLinesContinueShoppingButtonAriaLabel","invoiceEmptyInvoiceLinesContinueShoppingButtonText","containerHeaderClass","containerContentClass","_renderMakePayment","_renderInvoiceRequestButton","_renderInvoicesList","searchCriteria","businessPartner","callerContext","BusinessPartnerId","CustomerId","InvoicePaidStatusValues","_getInvoicesSearchCriteria","Paging","Skip","filterClassName","tableClassName","newErrorState","errorHost","invoiceErrorInvoiceIdNotExist","invoiceErrorFailedAddInvoiceToCart","makePaymentResources","_getSelectedInvoices","moduleId","moduleTypeName","navigationUrl","invoiceErrorMessageHeader","Top","invoicesLoadMore","_addInvoices","invoiceRequestModalCancelLabel","invoiceRequestModalSubmitLabel","invoiceRequestModalHeaderLabel","invoiceRequestModalSendToEmailLabel","invoiceRequestModalSearch","invoiceRequestModalInvoiceSearchDisplay","invoiceRequestModalSingleInvoiceSearchDisplay","Email","invoiceId","b2bUserId","b2bUserInformation","B2BUserId","requestInvoiceCopyAsync","specificInvoice"],"mappings":"6FAKA,6K,oCCAA,4DAUO,MAAMA,EAA8D,IAAuD,IAAvD,UAAEC,EAAF,UAAaC,EAAb,0BAAwBC,GAA+B,EAC9H,OACI,gBAAC,SAAM,CAACF,aAAcA,0BAAmCG,QAASF,GAC7DC,K,kICRN,MAAME,EAAyDC,IAClE,MAAM,OAAEC,EAAF,SAAUC,EAAV,eAAoBC,EAApB,gBAAoCC,GAAoBJ,EAE9D,OACI,gBAAC,SAAM,iBAAKA,EAAMK,aACbJ,EACAC,EACAC,EACAC,IAKE,a,uYCWf,MAaME,EAA6B,CAC/BR,QAdYS,MAAOC,EAAuCR,EAAyBS,KACnFA,GAAY,SASN,YAAY,CAACT,EAAMU,KAAKC,SAAUX,EAAMY,QAAQC,cAP9BC,IAChBd,EAAMe,SACNf,EAAMe,QAAQD,GAElBL,GAAY,OA8BPO,EAAiE,mBAAiBC,gBAC3F,sB,qWAD0E,EAExEC,UAtB0ClB,IAC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AwB2G,GAC5BvR,KAAKkB,MAAM7K,SAASM,QAAS9C,IAErBA,EAAQyC,WADRzC,IAAY0d,IAOpBvR,KAAKuM","file":"static/js/9.3e4b2d31c7091358.chunk.js","sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './components';\nexport * from './helpers';\nexport * from './invoices-list';\nexport * from './invoices-list.data';\nexport * from './invoices-list.props.autogenerated';\nexport * from './invoices-list.view';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 className: string;\n requestInvoiceButtonLabel: string;\n onClicked(): void;\n\n}\n\nexport const RequestInvoiceButton: React.FC = ({ className, onClicked, requestInvoiceButtonLabel }) => {\n return (\n \n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IInvoiceDetailsViewProps } from './invoice-details';\n\nexport const InvoiceDetailsView: React.FC = props => {\n const { header, products, paymentDetails, payInvoiceError } = props;\n\n return (\n \n {header}\n {products}\n {paymentDetails}\n {payInvoiceError}\n \n );\n};\n\nexport default InvoiceDetailsView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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\n resources: IPayInvoiceResources;\n\n onError?(errorState: IInvoiceErrorState): void;\n}\n\ninterface IPayInvoiceComponent extends IComponent {\n}\n\nconst onClick = async (_event: React.MouseEvent, props: IPayInvoiceProps, setDisabled: (disabled: boolean) => void): Promise => {\n setDisabled(true);\n\n const propagateError = (errorState: IInvoiceErrorState): void => {\n if (props.onError) {\n props.onError(errorState);\n }\n setDisabled(false);\n };\n\n await payInvoices([props.data.invoice], props.context.actionContext, propagateError);\n};\n\nconst PayInvoiceComponentActions = {\n onClick\n};\n\nconst PayInvoice: React.FC = (props: IPayInvoiceProps): JSX.Element => {\n const [disabled, setDisabled] = useState(false);\n\n const onClickHandler = async (event: React.MouseEvent) => {\n await PayInvoiceComponentActions.onClick(event, props, setDisabled);\n };\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. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './invoice-summary-lineitem';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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}\n\nexport interface IInvoicesTableProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n resources: IInvoicesTableResources;\n\n onChange(): void;\n onError?(errorState: IInvoiceErrorState): void;\n onRequestInvoice(invoice: InvoiceModel): void;\n}\n\nexport interface IInvoicesTableComponent extends IComponent {\n}\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\n return 'xs';\n};\n\nconst isMobileView = (context: ICoreContext) => {\n const viewport = getViewport(context);\n return viewport === 'xs' || viewport === 'sm';\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 const onSelectAll = (isSelected: boolean) => {\n props.data.invoices.forEach((invoice) => {\n invoice.isSelected = isSelected;\n });\n props.onChange();\n };\n\n return (\n \n invoice.isSelected)}\n isMobile={isMobile}\n isAdmin={props.data.customer.IsB2bAdmin || false}\n onSelectAll={onSelectAll}\n resources={props.resources}\n data={{}}\n />\n {\n props.data.invoices.map((invoice, index) => {\n return (\n \n );\n })\n }\n
\n );\n};\n\n// @ts-expect-error\nexport const InvoicesTableComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoicesTableComponent',\n { component: InvoicesTable }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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. All rights reserved.\n * See License.txt 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\n resources: IMakePaymentResources;\n\n onError?(errorState: IInvoiceErrorState): void;\n}\n\nexport interface IMakePaymentComponent extends IComponent {\n}\n\nconst onClick = async (_event: React.MouseEvent, props: IMakePaymentProps, setDisabled: (disabled: boolean) => void): Promise => {\n setDisabled(true);\n\n const propagateError = (errorState: IInvoiceErrorState): void => {\n if (props.onError) {\n props.onError(errorState);\n }\n setDisabled(false);\n };\n\n await payInvoices(props.data.invoices, props.context.actionContext, propagateError);\n};\n\nconst MakePaymentComponentActions = {\n onClick\n};\n\nconst MakePayment: React.FC = (input: IMakePaymentProps): JSX.Element => {\n const { data: { invoices } } = input;\n const hasInvoices = ArrayExtensions.hasElements(invoices.filter(invoice => invoice.canBePaid));\n const [disabled, setDisabled] = useState(false);\n\n const onClickHandler = async (event: React.MouseEvent) => {\n await MakePaymentComponentActions.onClick(event, input, setDisabled);\n };\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. All rights reserved.\n * See License.txt 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}\n\nexport const InvoiceError: React.FC = ({ messageHeader, errorMessage, otherError, showError, payInvoiceErrorModalOpen, errorDialogHeader, errorDialogBodyErrorTitle, errorDialogBodyErrorDescription,\n errorDialogFooterGoToCartButtonText, errorDialogFooterCancelButtonText, cartUrl, setPayInvoiceErrorModalClose }) => {\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\n aria-label={messageHeader} >\n \n {errorMessages.map((message, index) => {\n return (\n
\n {message}\n
\n );\n })}\n \n \n \n \n {errorDialogHeader}\n \n \n \n
\n
\n {errorDialogBodyErrorTitle}\n
\n
\n {errorDialogBodyErrorDescription}\n
\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. All rights reserved.\n * See License.txt 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 (invoices: IPayableInvoice[], actionContext: IActionContext, onError: (errorState: IInvoiceErrorState) => void) => {\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' } }); 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 }); 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. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IComponent, IComponentProps, ICoreContext, IDateFormatOptions, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { IPayInvoiceResources, PayInvoiceComponent } from '@msdyn365-commerce-modules/invoice';\nimport React from 'react';\n\nimport { InvoiceDetailsModel } from '../helpers/invoice-data';\n\nexport interface IInvoiceDetailsHeaderData {\n invoiceDetails: InvoiceDetailsModel;\n}\n\nexport interface IInvoiceDetailsHeaderResources extends IPayInvoiceResources {\n invoiceOrderItem: string;\n invoiceOrderItems: string;\n invoiceIdLabel: string;\n invoicePlacedByLabel: string;\n invoiceAmountDueText: string;\n invoicePaymentDueDateText: string;\n}\n\nexport interface IInvoiceDetailsHeaderProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n resources: IInvoiceDetailsHeaderResources;\n onError?(): void;\n}\n\nexport interface IInvoiceDetailsHeaderComponent extends IComponent {\n}\n\nconst formatShortDate = (context: ICoreContext, date: Date | undefined) => {\n if (date === undefined) {\n return '';\n }\n const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'numeric', day: 'numeric' };\n return context.cultureFormatter.formatDate(date, dateOptions);\n};\n\nconst formatLongDate = (context: ICoreContext, date: Date | undefined) => {\n if (date === undefined) {\n return '';\n }\n const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };\n return context.cultureFormatter.formatDate(date, dateOptions);\n};\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 InvoiceDetailsHeader: React.FC = (props: IInvoiceDetailsHeaderProps): JSX.Element => {\n const { className, data: { invoiceDetails }, resources, onError } = props;\n\n const invoiceNumberText = resources.invoiceIdLabel.replace('{0}', invoiceDetails.id);\n\n const invoiceOrderItemsText = invoiceDetails.lines.length === 1 ? resources.invoiceOrderItem : resources.invoiceOrderItems.replace('{0}', invoiceDetails.lines.length.toString());\n\n const invoiceInfoContainerClassName = `${className}__invoice-info-container`;\n const orderInfoContainerClassName = `${invoiceInfoContainerClassName}__order-info-container`;\n const orderInfoClassName = `${orderInfoContainerClassName}__order-info`;\n const orderMainInfoClassName = `${orderInfoClassName}__main-info`;\n const orderDetailsClassName = `${orderInfoClassName}__details`; `${className}__actions`;\n const actionsClassName = `${className}__actions`;\n const amountSummaryClassName = `${invoiceInfoContainerClassName}__amount-summary`;\n const orderDate = formatShortDate(props.context, invoiceDetails.invoiceDate);\n\n const dueDate = formatLongDate(props.context, invoiceDetails.dueDate);\n const dueDateText = resources.invoicePaymentDueDateText.replace('{0}', dueDate);\n\n return (\n
\n
\n {invoiceNumberText}\n
\n
\n
\n
\n
\n
\n {resources.invoicePlacedByLabel}\n \n {invoiceDetails.customerName}\n \n
\n
\n
\n
\n {orderDate}\n
\n
\n {invoiceOrderItemsText}\n
\n
\n
\n
\n
\n
\n {resources.invoiceAmountDueText}\n
\n
\n {formatAmount(props.context, invoiceDetails.amountDue, invoiceDetails.currencyCode)}\n
\n
\n {dueDateText}\n
\n
\n
\n
\n \n
\n
\n );\n};\n\n// @ts-expect-error\nexport const InvoiceDetailsHeaderComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoiceDetailsHeaderComponent',\n { component: InvoiceDetailsHeader }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IComponent, IComponentProps, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { IInvoicePaymentDetails } from '../helpers/invoice-data';\n\nexport interface IInvoiceDetailsPaymentDetailsData {\n invoicePaymentDetails: IInvoicePaymentDetails;\n}\n\nexport interface IInvoiceDetailsPaymentDetailsResources {\n invoicePaymentDiscounts: string;\n invoicePaymentSubtotal: string;\n invoicePaymentCharges: string;\n invoicePaymentTax: string;\n invoicePaymentInvoiceTotal: string;\n}\n\nexport interface IInvoiceDetailsPaymentDetailsProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n resources: IInvoiceDetailsPaymentDetailsResources;\n}\n\nexport interface IInvoiceDetailsPaymentDetailsComponent extends IComponent {\n}\n\ninterface IInvoicePaymentLineProps {\n label: string;\n value: number;\n className: string;\n}\n\nconst InvoiceDetailsPaymentDetails: React.FC = (props: IInvoiceDetailsPaymentDetailsProps): JSX.Element | null => {\n const { className, data: { invoicePaymentDetails }, resources } = props;\n\n const lineClassName = `${className}__line`;\n\n const lines: IInvoicePaymentLineProps[] = [];\n if (!ObjectExtensions.isNullOrUndefined(invoicePaymentDetails.totalDiscount)) {\n lines.push({\n label: resources.invoicePaymentDiscounts,\n value: invoicePaymentDetails.totalDiscount,\n className: `${lineClassName}-total-discount`\n });\n }\n if (!ObjectExtensions.isNullOrUndefined(invoicePaymentDetails.subtotal)) {\n lines.push({\n label: resources.invoicePaymentSubtotal,\n value: invoicePaymentDetails.subtotal,\n className: `${lineClassName}-subtotal`\n });\n }\n if (!ObjectExtensions.isNullOrUndefined(invoicePaymentDetails.totalCharges)) {\n lines.push({\n label: resources.invoicePaymentCharges,\n value: invoicePaymentDetails.totalCharges,\n className: `${lineClassName}-total-charges`\n });\n }\n if (!ObjectExtensions.isNullOrUndefined(invoicePaymentDetails.totalTax)) {\n lines.push({\n label: resources.invoicePaymentTax,\n value: invoicePaymentDetails.totalTax,\n className: `${lineClassName}-total-tax`\n });\n }\n if (!ObjectExtensions.isNullOrUndefined(invoicePaymentDetails.totalAmount)) {\n lines.push({\n label: resources.invoicePaymentInvoiceTotal,\n value: invoicePaymentDetails.totalAmount,\n className: `${lineClassName}-total-amount`\n });\n }\n\n if (!ArrayExtensions.hasElements(lines)) {\n return null;\n }\n\n return (\n
\n {\n lines.map(line => {\n return (\n
\n
\n {line.label}\n
\n
\n {props.context.cultureFormatter.formatCurrency(line.value, invoicePaymentDetails.currencyCode)}\n
\n
\n );\n })\n }\n
\n );\n};\n\n// @ts-expect-error\nexport const InvoiceDetailsPaymentDetailsComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoiceDetailsPaymentDetailsComponent',\n { component: InvoiceDetailsPaymentDetails }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IComponent, IComponentProps, ICoreContext, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { SalesInvoiceLine } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl, getProductPageUrlSync, ObjectExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\nimport { IInvoiceProductLine, InvoiceDetailsModel } from '../helpers/invoice-data';\n\nexport interface IInvoiceDetailsProductsData {\n invoiceDetails: InvoiceDetailsModel;\n}\n\nexport interface IInvoiceDetailsProductsResources {\n invoiceProductColor: string;\n invoiceProductSize: string;\n invoiceProductStyle: string;\n invoiceQuantity: string;\n}\n\nexport interface IInvoiceDetailsProductsProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n resources: IInvoiceDetailsProductsResources;\n}\n\nexport interface IInvoiceDetailsProductsComponent extends IComponent {\n}\n\nconst _renderProductDimensions = (className: string, resources: IInvoiceDetailsProductsResources, product: SalesInvoiceLine): JSX.Element => {\n return (\n
\n {StringExtensions.isNullOrWhitespace(product.ColorName) ? null :
\n {resources.invoiceProductColor.replace('{0}', product.ColorName!)}\n
}\n {StringExtensions.isNullOrWhitespace(product.SizeName) ? null :
\n {resources.invoiceProductSize.replace('{0}', product.SizeName!)}\n
}\n {StringExtensions.isNullOrWhitespace(product.StyleName) ? null :
\n {resources.invoiceProductStyle.replace('{0}', product.StyleName!)}\n
}\n
\n );\n};\n\nconst _renderProductImage = (className: string, context: ICoreContext, product: IInvoiceProductLine, imageSettings?: IImageSettings): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=315&h=315&m=6', w: 0, h: 0 },\n lg: { q: 'w=315&h=315&m=6', w: 0, h: 0 },\n xl: { q: 'w=315&h=315&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\n return (\n \n );\n};\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 InvoiceDetailsProducts: React.FC = (props: IInvoiceDetailsProductsProps): JSX.Element => {\n const { className, data: { invoiceDetails }, resources } = props;\n\n const productLineClass = `${className}__product-line`;\n const productLineInfoContainerClass = `${productLineClass}__product-info-container`;\n const productLineDetailsClass = `${productLineInfoContainerClass}__product-details`;\n const productLineSmallDetailsClass = `${productLineDetailsClass}__small-details`;\n\n return (\n
\n {\n invoiceDetails.lines.map(product => {\n const quantity = product.Quantity || 1;\n\n let productUrl = '';\n if (!ObjectExtensions.isNullOrUndefined(product.ProductName) &&\n !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.ProductName, product.RecordId, props.context.actionContext);\n }\n\n return (\n
\n
\n {_renderProductImage(`${productLineInfoContainerClass}__product-image`, props.context, product)}\n
\n \n {product.ProductName}\n \n
\n {_renderProductDimensions(`${productLineSmallDetailsClass}__dimensions`, resources, product)}\n
\n {formatAmount(props.context, product.Price, invoiceDetails.currencyCode)}\n
\n
\n {resources.invoiceQuantity.replace('{0}', quantity.toString())}\n
\n
\n
\n
\n
\n {formatAmount(props.context, product.NetAmount, invoiceDetails.currencyCode)}\n
\n
\n );\n })\n }\n
\n );\n};\n\n// @ts-expect-error\nexport const InvoiceDetailsProductsComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoiceDetailsProductsComponent',\n { component: InvoiceDetailsProducts }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { InvoicePaidStatus, OrderInvoice, SalesInvoice, SalesInvoiceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { IPayableInvoice } from '@msdyn365-commerce-modules/invoice';\n\nexport interface IInvoicePaymentDetails {\n totalDiscount?: number;\n subtotal?: number;\n totalCharges?: number;\n totalTax?: number;\n totalAmount?: number;\n currencyCode?: string;\n}\n\nexport interface IInvoiceProductLine extends SalesInvoiceLine {\n primaryImageUrl?: string;\n}\n\n/**\n * Represents invoice details data model.\n */\nexport class InvoiceDetailsModel implements IPayableInvoice, IInvoicePaymentDetails {\n public id: string;\n\n public invoiceDate?: Date;\n\n public customerAccountNumber?: string;\n\n public customerName?: string;\n\n public dueDate?: Date;\n\n public amountDue?: number;\n\n public status?: InvoicePaidStatus;\n\n public lines: IInvoiceProductLine[];\n\n public totalDiscount?: number;\n\n public subtotal?: number;\n\n public totalCharges?: number;\n\n public totalTax?: number;\n\n public totalAmount?: number;\n\n public currencyCode?: string;\n\n public constructor(invoice: OrderInvoice, invoiceDetails: SalesInvoice, products: SimpleProduct[]) {\n this.id = invoice.Id || '';\n this.invoiceDate = invoice.InvoiceDate ? new Date(invoice.InvoiceDate) : undefined;\n this.customerName = invoice.CustomerName;\n this.dueDate = invoice.InvoiceDueDate ? new Date(invoice.InvoiceDueDate) : undefined;\n this.amountDue = invoice.AmountBalance;\n this.status = invoice.InvoicePaidStatusValue;\n this.lines = (invoiceDetails.SalesInvoiceLine || []).map(line => {\n const productLine: IInvoiceProductLine = {\n ...line,\n primaryImageUrl: products.find(product => product.RecordId === line.RecordId)?.PrimaryImageUrl\n };\n return productLine;\n });\n\n this.totalDiscount = invoiceDetails.TotalDiscount;\n this.subtotal = invoiceDetails.InvoiceSubtotal;\n this.totalCharges = invoiceDetails.TotalCharges;\n this.totalTax = invoiceDetails.TotalTaxAmount;\n this.totalAmount = invoice.TotalAmount;\n this.currencyCode = invoice.CurrencyCode;\n }\n\n public get canBePaid(): boolean {\n return this.status !== InvoicePaidStatus.Paid;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getUrlSync } from '@msdyn365-commerce/core';\nimport { SalesInvoiceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { InvoiceErrorComponent } from '@msdyn365-commerce-modules/invoice';\nimport { getSimpleProductsAction, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { InvoiceDetailsHeaderComponent } from './components/invoice-details-header';\nimport { InvoiceDetailsPaymentDetailsComponent } from './components/invoice-details-payment-summary';\nimport { InvoiceDetailsProductsComponent } from './components/invoice-details-products';\nimport { InvoiceDetailsModel } from './helpers/invoice-data';\nimport { IInvoiceDetailsData } from './invoice-details.data';\nimport { IInvoiceDetailsProps } from './invoice-details.props.autogenerated';\n\nexport interface IInvoiceDetailsViewState {\n invoiceDetails?: InvoiceDetailsModel;\n payInvoiceErrorModalOpen?: boolean;\n}\n\nexport interface IInvoiceDetailsViewProps extends IInvoiceDetailsProps {\n moduleProps: IModuleProps;\n header: JSX.Element;\n products: JSX.Element;\n paymentDetails: JSX.Element;\n payInvoiceError?: JSX.Element;\n}\n\n/**\n * InvoiceDetails component.\n * @extends {React.PureComponent>}\n */\nclass InvoiceDetails extends React.PureComponent, IInvoiceDetailsViewState> {\n private static readonly _className: string = 'msc-invoice-details';\n\n public constructor(props: IInvoiceDetailsProps) {\n super(props);\n\n this.state = {};\n this._onAddToCartFailed = this._onAddToCartFailed.bind(this);\n this._setPayInvoiceErrorModalClose = this._setPayInvoiceErrorModalClose.bind(this);\n }\n\n public async componentDidMount(): Promise {\n const invoice = await this.props.data.invoice;\n const invoiceDetails = await this.props.data.invoiceDetails;\n\n const products = await this._getProducts(invoiceDetails.SalesInvoiceLine, invoiceDetails.ChannelId);\n\n const invoiceDetailsModel = new InvoiceDetailsModel(invoice, invoiceDetails, products);\n\n this.setState({\n invoiceDetails: invoiceDetailsModel,\n payInvoiceErrorModalOpen: false\n });\n }\n\n public render(): JSX.Element | null {\n if (!this.state.invoiceDetails) {\n return null;\n }\n\n const header = this._renderHeader();\n const products = this._renderProducts();\n const paymentDetails = this._renderPaymentDetails();\n const payInvoiceError = this._renderInvoiceErrors();\n\n const props: IInvoiceDetailsViewProps = {\n ...(this.props as IInvoiceDetailsProps),\n moduleProps: {\n moduleProps: this.props,\n className: InvoiceDetails._className\n },\n header,\n products,\n paymentDetails,\n payInvoiceError\n };\n\n return this.props.renderView(props);\n }\n\n private async _getProducts(invoiceLines: SalesInvoiceLine[] = [], channelId?: number): Promise {\n const productInputs = invoiceLines.filter(product => product.RecordId).map(product => new ProductInput(product.RecordId!, this.props.context.request.apiSettings, channelId));\n return getSimpleProductsAction(productInputs, this.props.context.actionContext);\n }\n\n private _renderHeader(): JSX.Element {\n const invoiceDetails = this.state.invoiceDetails!;\n return (\n \n );\n }\n\n private _renderProducts(): JSX.Element {\n const invoiceDetails = this.state.invoiceDetails!;\n return (\n \n );\n }\n\n private _renderPaymentDetails(): JSX.Element {\n const invoiceDetails = this.state.invoiceDetails!;\n return (\n \n );\n }\n\n private _onAddToCartFailed(): void {\n this.setState({ payInvoiceErrorModalOpen: true });\n }\n\n private _setPayInvoiceErrorModalClose(): void {\n this.setState({ payInvoiceErrorModalOpen: false });\n }\n\n private _renderInvoiceErrors(): JSX.Element {\n const {\n resources: { payInvoiceErrorDialogHeader, payInvoiceErrorDialogBodyErrorTitle, payInvoiceErrorDialogBodyErrorDescription,\n payInvoiceErrorDialogFooterGoToCartButtonText, payInvoiceErrorDialogFooterCancelButtonText }\n } = this.props;\n\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n\n const errorClassName = `${InvoiceDetails._className}__errors`;\n\n return (\n \n );\n }\n}\n\nexport default InvoiceDetails;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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}\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}\n\nconst getDesktopHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\n const { resources } = props;\n return (\n <>\n \n \n \n \n {resources.invoiceNumberText}\n \n \n {resources.invoiceDateText}\n \n { props.isAdmin ? \n {resources.invoiceUsersText}\n : null }\n \n {resources.invoiceAmountText}\n \n \n {resources.invoiceDueDateText}\n \n \n {resources.invoiceAmountDueText}\n \n \n {resources.invoiceStatusText}\n \n \n {resources.invoiceActionsText}\n \n \n );\n};\n\nconst getMobileHeaderCells = (props: IInvoicesTableHeaderProps, rowClassName: string, switchCheckedState: () => void) => {\n const { resources } = props;\n return (\n <>\n \n \n \n \n {resources.invoicesText}\n \n \n {resources.invoiceDateMobileText}\n \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 \n {headerCells}\n \n \n );\n};\n\n// @ts-expect-error\nexport const InvoicesTableHeaderComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoicesTableHeaderComponent',\n { component: InvoicesTableHeader }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { IComponent, IComponentProps, ICoreContext, IDateFormatOptions, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { getInvoiceDetailsPageUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button } 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 invoiceRequestButtonLabel: string;\n}\n\nexport interface IInvoicesTableRowProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n isMobile: boolean;\n\n resources: IInvoicesTableRowResources;\n\n onChange(): void;\n onError?(errorState: IInvoiceErrorState): void;\n onRequestInvoice(invoice: InvoiceModel): void;\n}\n\nexport interface IInvoicesTableRowComponent extends IComponent {\n\n}\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\nconst getDesktopRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\n const { data: { invoice, index, customer } } = props;\n\n const isCurrentUser = !StringExtensions.isNullOrWhitespace(customer.AccountNumber) && customer.AccountNumber === invoice.customerAccountNumber;\n const payInvoiceClassName = `${props.className}__pay-invoice`;\n\n const onRequestSpecificInvoice = () => {\n props.onRequestInvoice(props.data.invoice);\n };\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n\n return (\n <>\n \n \n \n \n \n {invoice.id}\n \n \n \n \n {formatDate(props.context, invoice.invoiceDate)}\n \n \n { customer.IsB2bAdmin ? \n {invoice.customerName}\n { isCurrentUser ? \n {props.resources.invoiceCurrentUser}\n : null}\n : null }\n \n {formatAmount(props.context, invoice.amount, invoice.currencyCode)}\n \n \n \n {formatDate(props.context, invoice.dueDate)}\n \n \n \n {formatAmount(props.context, invoice.amountDue, invoice.currencyCode)}\n \n \n \n {getInvoiceStatusText(props.resources, invoice.status)}\n \n \n \n \n \n \n \n );\n};\n\nlet setShowPreviousActions: React.Dispatch> | undefined;\n\nconst extraActionsPopup = (props: IInvoicesTableRowProps): JSX.Element | null => {\n const { resources: { invoiceViewDetailsButtonAriaLabel, invoiceViewDetailsButtonText }, data: { index } } = props;\n\n const [showActions, setShowActions] = useState(false);\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n\n const onClickViewDetails = () => {\n if (MsDyn365.isBrowser) {\n window.location.href = linkToInvoiceDetails;\n }\n return;\n };\n\n const toggle = (event: React.MouseEvent) => {\n const shouldShowActions = !showActions;\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\n const onRequestSpecificInvoice = () => {\n props.onRequestInvoice(props.data.invoice);\n };\n\n const className = `${props.className}__extra-actions-cell`;\n const actionsContainerClassName = `${className}__actions-container`;\n const payInvoiceClassName = `${actionsContainerClassName}__pay-invoice`;\n\n return (\n
\n \n \n \n
\n }\n \n );\n};\n\nconst getMobileRowCells = (props: IInvoicesTableRowProps, onSelectLine: () => void) => {\n const { data: { invoice } } = props;\n\n const linkToInvoiceDetails = getInvoiceDetailsPageUrlSync(props.data.invoice.id, props.context.actionContext);\n\n return (\n <>\n \n \n \n \n \n {invoice.id}\n \n
\n \n {invoice.customerName}\n \n \n \n \n {formatDate(props.context, invoice.dueDate)}\n \n
\n \n {getInvoiceStatusText(props.resources, invoice.status)}\n \n \n \n {extraActionsPopup(props)}\n \n \n );\n\n};\n\nconst InvoicesTableRow: React.FC = (props: IInvoicesTableRowProps): JSX.Element => {\n const { data: { invoice } } = 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 (\n \n {rowCells}\n \n );\n};\n\n// @ts-expect-error\nexport const InvoicesTableRowComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoicesTableRowComponent',\n { component: InvoicesTableRow }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 !== 3 as InvoicePaidStatus.Paid);\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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\n case 0 as InvoicePaidStatus.None:\n return resources.invoiceStatusNone;\n\n case 1 as InvoicePaidStatus.Unpaid:\n return resources.invoiceStatusUnpaid;\n\n case 2 as InvoicePaidStatus.PartiallyPaid:\n return resources.invoiceStatusPartiallyPaid;\n\n case 3 as InvoicePaidStatus.Paid:\n return resources.invoiceStatusPaid;\n default:\n return '';\n }\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './invoice-data';\nexport * from './invoice-status';\nexport * from './pay-invoices';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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\nconst renderFilterStateItem = (\n filterState: InvoicesFilterState,\n resources: IInvoicesFilterResources,\n className: string,\n onStateClick: (filterState: InvoicesFilterState) => void): React.ReactNode => {\n\n const stateStringRepresentation = InvoicesFilterState[filterState];\n\n const onClick = () => {\n onStateClick(filterState);\n };\n\n return (\n \n {getInvoicesFilterStateResources(filterState, resources)}\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 = () => {\n setPopoverState(!popoverState);\n };\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 {\n EnumExtensions.getEnumValues(InvoicesFilterState).map(state => {\n return renderFilterStateItem(state, props.resources, props.className, onFilterStateClick);\n })\n }\n \n
\n );\n};\n\n// @ts-expect-error\nexport const InvoicesFilterComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\n 'InvoicesFilterComponent',\n { component: InvoicesFilter }\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n

\n \n {label}\n \n {price || price === 0 ? (\n \n ) : (\n \n {toBeCalculatedText}\n \n )}\n

\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(props, invoiceLine.InvoiceAmount, format(props.invoiceLabel, invoiceLine.InvoiceId), 'invoice');\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(props, -giftCardAmount, props.giftcardLabel || 'Gift card amount', 'gift-card');\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection({ ...props, freeText: undefined }, totalAmountAfterGiftCard, props.orderTotalLabel, 'total');\n }\n\n return reactNodes;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 * as React from 'react';\n\nimport { InvoiceModel } from '../helpers/invoice-data';\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 toggle(): void;\n onSubmitRequest(invoiceId: string): void;\n}\n\nexport const RequestInvoiceModal: React.FC = ({ className, email, isModalOpen, toggle, modalHeaderLabel, sendToEmailLabel, submitRequestLabel, cancelLabel, onSubmitRequest, invoices, searchPlaceholderLabel,\n invoicesFoundString, singleInvoiceFoundString }) => {\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\n const onSubmitRequestClick = () => {\n if (selectedInvoiceIndex >= 0) {\n onClosing();\n onSubmitRequest(filteredInvoices[selectedInvoiceIndex].id);\n }\n };\n\n /**\n * Sets the filtered invoices to the ones that were selected on the main screen.\n */\n const setFilteredInvoicesToSelectedInvoices = () => {\n const selectedInvoices = invoices.filter(invoice => invoice.isSelected);\n if (ArrayExtensions.hasElements(selectedInvoices)) {\n setFilteredInvoices(selectedInvoices);\n }\n };\n\n if (StringExtensions.isNullOrWhitespace(searchInput) && !ArrayExtensions.hasElements(filteredInvoices)) {\n setFilteredInvoicesToSelectedInvoices();\n }\n\n let invoiceOptions = renderInvoiceOptions(filteredInvoices, setSelectedInvoiceIndex, className, selectedInvoiceIndex);\n\n const searchInputChanged = (e: React.ChangeEvent) => {\n setSearchInput(e.target.value);\n };\n\n const searchEntered = () => {\n let updatedInvoices = invoices;\n if (!StringExtensions.isNullOrEmpty(searchInput)) {\n updatedInvoices = invoices.filter((invoice) => invoice.id.includes(searchInput));\n }\n\n setFilteredInvoices(updatedInvoices);\n\n if (ArrayExtensions.hasElements(filteredInvoices)) {\n setSelectedInvoiceIndex(0);\n setShouldShowSearchResults(true);\n } else {\n setSelectedInvoiceIndex(-1);\n setShouldShowSearchResults(false);\n }\n\n invoiceOptions = renderInvoiceOptions(filteredInvoices, setSelectedInvoiceIndex, className, selectedInvoiceIndex);\n };\n\n const onClosing = () => {\n setSelectedInvoiceIndex(-1);\n setFilteredInvoices(invoices);\n setSearchInput('');\n setShouldShowSearchResults(false);\n };\n\n const onCancel = () => {\n onClosing();\n toggle();\n };\n\n /**\n * Sets the invoices that are possible to select when the dialog is opened.\n */\n function onOpened() {\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 \n {searchResultString.substring(0, invoicesFoundReplaceIndex)}\n \n \n {filteredInvoices.length}\n \n \n {searchResultString.substring(invoicesFoundReplaceIndex + 3)}\n \n
}\n
\n \n
\n {invoiceOptions}\n
\n
\n
\n \n \n \n \n \n );\n};\n\nconst renderInvoiceOptions = (filteredInvoices: InvoiceModel[], setSelectedInvoiceIndex: (newIndex: number) => void, className: string, selectedInvoiceIndex: number) => {\n return (\n
\n {filteredInvoices.map((invoice, index) => {\n const onInvoiceSelect = () => {\n setSelectedInvoiceIndex(index);\n };\n\n const radioButtonId = `invoice__${invoice.id}`;\n\n return (\n
\n \n \n
\n );\n })}\n
\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getUrlSync } from '@msdyn365-commerce/core';\nimport { BusinessPartnerOperationDeliveryType, BusinessPartnerUsersDataActions, InvoicePaidStatus, InvoiceSearchCriteria, IQueryResultSettings, OrderInvoice } from '@msdyn365-commerce/retail-proxy';\nimport { getCurrentAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\nimport { ArrayExtensions, getCustomer, GetCustomerInput, getInvoices, GetInvoicesInput, IQueryResultSettingsModuleConfig, QueryResultSettingsProxy, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from '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}\n\nexport interface IInvoicesListState {\n invoices: InvoiceModel[];\n invoicesFilterState: InvoicesFilterState;\n errorState: IInvoiceErrorState;\n isInvoiceRequestModalOpen: boolean;\n isLoading: boolean;\n isPageLoaded: boolean;\n payInvoiceErrorModalOpen: boolean;\n}\n\n/**\n * InvoicesList component.\n * @extends {React.Component, IInvoicesListState>}\n */\nclass InvoicesList extends React.Component, IInvoicesListState> {\n private readonly _className: string = 'msc-invoices-list';\n\n private readonly _queryResultSettings: IQueryResultSettings;\n\n constructor(props: IInvoicesListProps) {\n super(props);\n\n this._queryResultSettings = QueryResultSettingsProxy.fromModuleData(\n this.props.context.request, this.props.config as IQueryResultSettingsModuleConfig).QueryResultSettings;\n\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\n this.state = {\n invoices: [],\n invoicesFilterState: InvoicesFilterState.ShowAll,\n isLoading: true,\n isPageLoaded: false,\n errorState: { errorMessage: '' },\n isInvoiceRequestModalOpen: false,\n payInvoiceErrorModalOpen: false\n };\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className = '' },\n context: {\n request: {\n channel\n },\n cultureFormatter: {\n formatCurrency,\n\n // @ts-expect-error\n currencyCode\n }\n },\n data: {\n customerBalance\n },\n resources: {\n invoicesListTitle,\n invoicesListDescTitle,\n invoicesListDescCount\n }\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\n const headerClassName = `${this._className}__header`;\n\n const header = (\n
\n \n
\n
\n {invoicesListDescTitle}\n
\n
\n {amountText}\n
\n
\n {countText}\n
\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\n private _initializeWithInvoices(invoicesData: OrderInvoice[]): void {\n const invoices = invoicesData.map(invoice => new InvoiceModel(invoice));\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
\n {this.props.resources.invoiceEmptyInvoiceLinesTitle}\n
\n
\n {this.props.resources.invoiceEmptyInvoiceLinesDescription}\n
\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\n return (\n
\n
\n {this._renderMakePayment(containerHeaderClass)}\n {this._renderInvoiceRequestButton()}\n
\n
\n {this._renderInvoiceErrors()}\n
\n
\n {this._renderInvoicesList(containerContentClass)}\n
\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 0 as InvoicesFilterState.ShowAll:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.None];\n break;\n case 1 as InvoicesFilterState.Paid:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.Paid];\n break;\n case 2 as InvoicesFilterState.PartiallyPaid:\n searchCriteria.InvoicePaidStatusValues = [InvoicePaidStatus.PartiallyPaid];\n break;\n case 3 as 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(new GetInvoicesInput(searchCriteria, this._queryResultSettings), this.props.context.actionContext);\n this._initializeWithInvoices(invoices);\n }\n\n private _renderInvoicesFilter(className: string): JSX.Element {\n const filterClassName = `${className}__filter`;\n return (\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): void {\n const errorState = { ...newErrorState };\n errorState.errorHost = 'ADDINVOICETOCART';\n errorState.errorMessage = newErrorState.errorReason?.failureReason === 'EMPTYINPUT' ? this.props.resources.invoiceErrorInvoiceIdNotExist : this.props.resources.invoiceErrorFailedAddInvoiceToCart;\n\n this.setState({ errorState, payInvoiceErrorModalOpen: true });\n }\n\n private _renderMakePayment(className: string): 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 }\n\n private _renderInvoiceErrors(): JSX.Element {\n const {\n resources: { payInvoiceErrorDialogHeader, payInvoiceErrorDialogBodyErrorTitle, payInvoiceErrorDialogBodyErrorDescription,\n payInvoiceErrorDialogFooterGoToCartButtonText, payInvoiceErrorDialogFooterCancelButtonText }\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 _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(new GetInvoicesInput(searchCriteria, this._queryResultSettings), this.props.context.actionContext);\n this._addInvoices(newInvoices);\n }\n\n private _renderInvoiceRequestModal(): JSX.Element {\n const customer = this.props.data.customer.result;\n const { invoiceRequestModalCancelLabel, invoiceRequestModalSubmitLabel, invoiceRequestModalHeaderLabel, invoiceRequestModalSendToEmailLabel, invoiceRequestModalSearch,\n invoiceRequestModalInvoiceSearchDisplay, invoiceRequestModalSingleInvoiceSearchDisplay } = this.props.resources;\n\n return (\n \n );\n }\n\n private _onToggleInvoiceRequestModal(): void {\n this.setState({\n isInvoiceRequestModalOpen: !this.state.isInvoiceRequestModalOpen\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 private _requestInvoice(invoiceId: string): void {\n const context = { callerContext: this.props.context.actionContext };\n const b2bUserId: string = this.props.data.b2bUserInformation?.result?.B2BUserId || '';\n\n BusinessPartnerUsersDataActions.requestInvoiceCopyAsync(context, b2bUserId, invoiceId, BusinessPartnerOperationDeliveryType.Email);\n\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(specificInvoice: InvoiceModel): 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\n this._onToggleInvoiceRequestModal();\n }\n}\n\nexport default InvoicesList;\n"],"sourceRoot":""}