@openmrs/esm-billing-app 1.3.2-pre.2107 → 1.3.2-pre.2109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/cache/15f86e2249957534-meta.json +1 -0
- package/.turbo/cache/15f86e2249957534.tar.zst +0 -0
- package/.turbo/turbo-build.log +1 -1
- package/dist/350.css +1 -1
- package/dist/350.css.map +1 -1
- package/dist/350.js +1 -1
- package/dist/350.js.map +1 -1
- package/dist/5117.js +1 -1
- package/dist/5117.js.map +1 -1
- package/dist/7968.css +1 -1
- package/dist/7968.css.map +1 -1
- package/dist/7968.js +2 -2
- package/dist/7968.js.map +1 -1
- package/dist/openmrs-esm-billing-app.js +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/billing-dashboard/billing-dashboard.component.tsx +1 -1
- package/src/billing-dashboard/billing-dashboard.test.tsx +4 -2
- package/src/billing-header/billing-header.component.tsx +4 -13
- package/src/billing-header/billing-header.scss +1 -27
- package/translations/en.json +0 -1
- package/.turbo/cache/d7460f3949c30be5-meta.json +0 -1
- package/.turbo/cache/d7460f3949c30be5.tar.zst +0 -0
- package/src/billing-header/billing-illustration.component.tsx +0 -30
package/dist/7968.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.-esm-billing__billing-header__header___P\+PIw{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#525252;background-color:#fff;border-bottom:1px solid #e0e0e0;justify-content:space-between;height:6rem;padding:1rem;display:flex}.-esm-billing__billing-header__left-justified-items___0FINv{cursor:pointer;flex-direction:row;align-items:center;display:flex}.-esm-billing__billing-header__page-name___uiEHw{font-size:var(--cds-heading-04-font-size,1.75rem);font-weight:var(--cds-heading-04-font-weight,400);line-height:var(--cds-heading-04-line-height,1.28572);letter-spacing:var(--cds-heading-04-letter-spacing,0)}.-esm-billing__billing-header__page-labels___Z52tc{margin:1rem}.-esm-billing__billing-header__page-labels___Z52tc p:first-of-type{margin-bottom:.25rem}.-esm-billing__bills-table__container___PDs67,.-esm-billing__bills-table__emptyStateContainer___\+sc4M,.-esm-billing__bills-table__loaderContainer___9\+3cP{margin:2rem 0}.-esm-billing__bills-table__billListContainer___z5Mjt{background-color:#fff;border:1px solid #e0e0e0;width:100%;max-width:95vw;margin:0 auto;padding-bottom:0}.-esm-billing__bills-table__billListContainer___z5Mjt :has(.-esm-billing__bills-table__filterEmptyState___hV8Kp){border-bottom:none}.-esm-billing__bills-table__filterContainer___HlgpD{flex-wrap:wrap;flex:1;justify-content:space-between;align-items:flex-end;gap:.75rem;display:flex}.-esm-billing__bills-table__filterContainer___HlgpD .cds--dropdown__wrapper--inline{gap:0}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box__menu-icon{height:1rem}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box__menu{min-width:max-content}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box{margin-left:.5rem}.-esm-billing__bills-table__datePickerContainer___Ss4P3{flex-wrap:wrap;gap:.75rem;display:flex}.-esm-billing__bills-table__datePickerContainer___Ss4P3 .-esm-billing__bills-table__clearDatesButton___ZS5e8{align-self:end}.-esm-billing__bills-table__menu___F7TXn{margin-left:.5rem}.-esm-billing__bills-table__headerContainer___FouPn{background-color:#fff;justify-content:space-between;align-items:center;gap:1rem;padding:.75rem 1rem;display:flex}.-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2{justify-content:center;align-items:center;display:flex}.-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2.cds--inline-loading{max-height:1rem}.-esm-billing__bills-table__tableContainer___-rFXM section{position:relative}.-esm-billing__bills-table__tableContainer___-rFXM a{text-decoration:none}.-esm-billing__bills-table__hiddenRow___UsKb7{display:none}.-esm-billing__bills-table__emptyRow___kJSR-{align-items:center;padding:0 1rem;display:flex}.-esm-billing__bills-table__visitSummaryContainer___TzYie{width:100%;max-width:768px;margin:1rem auto}.-esm-billing__bills-table__expandedActiveVisitRow___-imGs>td>div{max-height:max-content!important}.-esm-billing__bills-table__expandedActiveVisitRow___-imGs td,.-esm-billing__bills-table__expandedActiveVisitRow___-imGs th[colspan] td[colspan]>div:first-child{padding:0 1rem}.-esm-billing__bills-table__action___T5jNA{margin-bottom:.5rem}.-esm-billing__bills-table__illo___zE0Ny{margin-top:1rem}.-esm-billing__bills-table__content___XIyTL{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-billing__bills-table__desktopHeading___qYmFK,.-esm-billing__bills-table__tabletHeading___JVDgu{text-align:left;text-transform:capitalize;flex:1}.-esm-billing__bills-table__desktopHeading___qYmFK h4,.-esm-billing__bills-table__tabletHeading___JVDgu h4{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252}.-esm-billing__bills-table__desktopHeading___qYmFK h4:after,.-esm-billing__bills-table__tabletHeading___JVDgu h4:after{content:"";border-bottom:.375rem solid #007d79;border-bottom-color:var(--brand-03);width:2rem;padding-top:3px;display:block}.-esm-billing__bills-table__tile___Zxkhk{text-align:center;border:1px solid #e0e0e0}.-esm-billing__bills-table__menuitem___owZSX{max-width:none}.-esm-billing__bills-table__filterEmptyState___hV8Kp{text-align:center;justify-content:center;align-items:center;margin:3rem;padding:1rem;display:flex}.-esm-billing__bills-table__filterEmptyStateTile___qWUMb{margin:auto}.-esm-billing__bills-table__filterEmptyStateContent___W3mdv{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__bills-table__filterEmptyStateHelper___nvBYb{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252}.-esm-billing__billing-dashboard__container___3bf4z{height:calc(100vh - 3rem)}.-esm-billing__billing-dashboard__billsTableContainer___XBT2N{margin:1rem}.-esm-billing__billing-dashboard__illo___Ld3Or{margin-top:1rem}.-esm-billing__billing-dashboard__content___E5cTJ{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#525252;margin-top:1rem}.-esm-billing__billing-dashboard__tile___EG4Yd{text-align:center;border:1px solid #e0e0e0;padding:1.5rem 0}.-esm-billing__line-item-action-menu__menuitem___lOuJD{max-width:none}.-esm-billing__invoice-table__lineItemsWrapper___ABU3I{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__invoice-table__filterEmptyState___ZtVBH{text-align:center;background-color:#fff;justify-content:center;align-items:center;display:flex;padding:3rem!important}.-esm-billing__invoice-table__filterEmptyStateTile___j92yY{margin:auto}.-esm-billing__invoice-table__filterEmptyStateContent___41NoP{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__invoice-table__filterEmptyStateHelper___\+DQR2{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252}.-esm-billing__invoice-table__searchbox___oxEnj{height:3rem}.-esm-billing__invoice-table__searchbox___oxEnj input:focus{outline:2px solid #ff832b!important}.-esm-billing__invoice-table__invoiceTable___2hd71{width:100%}.-esm-billing__invoice-table__invoiceTable___2hd71 td{border-bottom:none!important}.-esm-billing__invoice-table__tableDescription___JKz3j{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__invoice-table__tableDescription___JKz3j :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__invoice-table__tableDescription___JKz3j>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}.-esm-billing__invoice-breakdown__invoiceBreakdown___IGWfb{grid-template-columns:1fr 1fr;align-items:center;margin:.5rem 0;display:grid}.-esm-billing__invoice-breakdown__label___WpAJx{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#161616;text-align:left}.-esm-billing__invoice-breakdown__value___L3Y8v{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#161616;text-align:left;margin-left:.5rem}.-esm-billing__invoice-breakdown__extendedLabel___fJ78V{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#dc143c;text-align:left}.-esm-billing__payment-form__container___P4SMq{gap:1.5rem;margin:1rem}.-esm-billing__payment-form__paymentContainer___w2KXI{border-right:1px solid #a2a9b0;width:70%;margin:1rem;padding:1rem}.-esm-billing__payment-form__paymentButtons___Wx8KE{margin:1rem 0}.-esm-billing__payment-form__paymentMethodContainer___fZiwB{grid-template-columns:1fr 1fr 1fr auto;align-items:baseline;gap:1rem;width:100%;margin:1rem 0;display:grid}.-esm-billing__payment-form__paymentTotals___Kcqhm{margin-top:.125rem}.-esm-billing__payment-form__processPayments___ytcE5{justify-content:flex-end;column-gap:.75rem;margin:1rem;display:flex}.-esm-billing__payment-form__errorPaymentContainer___Ft9DN{min-height:3rem;margin:.75rem}.-esm-billing__payment-form__removeButtonContainer___ZtL8L{align-self:center;display:flex}.-esm-billing__payment-form__removeButton___tUx85{color:#da1e28}.-esm-billing__payments__wrapper___V4WiR{display:flex}.-esm-billing__payments__divider___C6sdr{background:#e0e0e0;width:1px;height:12rem;margin:2rem}.-esm-billing__payments__paymentContainer___1SfXU{width:70%;margin:1rem 0;padding:1rem 0}.-esm-billing__payments__paymentButtons___qHpdl{margin:1rem 0}.-esm-billing__payments__pendingEmptyState___jUFD7{text-align:center;background-color:#fff;justify-content:center;align-items:center;display:flex;padding:3rem!important}.-esm-billing__payments__pendingEmptyStateTile___q\+iuz{margin:auto}.-esm-billing__payments__pendingEmptyStateContent___B8pVF{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__payments__pendingEmptyStateHelper___amDGw{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252;margin-bottom:1rem}.-esm-billing__payments__finalizeButton___nCnCg{margin:0 auto}.-esm-billing__payments__paymentMethodContainer___EW3nN{grid-template-columns:1fr 1fr 1fr 1fr;align-items:baseline;column-gap:1rem;margin:.625rem 0;display:grid}.-esm-billing__payments__paymentTotals___-3A2t{max-width:90%;margin:1rem auto;padding:2rem 1rem}.-esm-billing__payments__processPayments___RG8aV{border-top:1px solid #a2a9b0;justify-content:flex-end;column-gap:.75rem;margin:1rem 0;padding-top:1rem;display:flex}.-esm-billing__print-receipt__configurableLink___BW3h1{color:#fff;margin:0;padding:0;text-decoration:none}.-esm-billing__print-receipt__button___QnAQS{margin-left:.75rem}.-esm-billing__printable-footer__container___mTh7B{flex-direction:column;width:100%;display:flex;position:fixed;bottom:0}.-esm-billing__printable-footer__itemFooter___Y5pkL{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#21272a;padding:1rem}.-esm-billing__printable-invoice-header__container___1u0nI{padding:2rem}.-esm-billing__printable-invoice-header__printableBody___cMhfI{border-bottom:.1pt solid #c1c7cd;padding:.25rem}.-esm-billing__printable-invoice-header__printableBody___cMhfI .-esm-billing__printable-invoice-header__detailsContainer___rJn9A{justify-content:space-between;gap:2rem;display:flex}.-esm-billing__printable-invoice-header__printableHeader___Jl02J{justify-content:space-between;align-items:flex-start;margin-bottom:.25rem;padding-bottom:.25rem;display:flex}.-esm-billing__printable-invoice-header__logo___ZpVka{flex:1}.-esm-billing__printable-invoice-header__img___rSlvX{height:auto}.-esm-billing__printable-invoice-header__facilityDetails___uJPtI{text-align:right;flex:1}.-esm-billing__printable-invoice-header__invoiceHeading___9Xftg{font-size:var(--cds-heading-04-font-size,1.75rem);font-weight:var(--cds-heading-04-font-weight,400);line-height:var(--cds-heading-04-line-height,1.28572);letter-spacing:var(--cds-heading-04-letter-spacing,0);text-transform:uppercase;text-align:center;font-size:40px}.-esm-billing__printable-invoice-header__facilityName___81nN9{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#0e6027;font-weight:700}.-esm-billing__printable-invoice-header__sectionHeading___tOV2s{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);margin-bottom:.75rem;padding-bottom:.5rem}.-esm-billing__printable-invoice-header__itemLabel___\+hACh{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);margin-bottom:.125rem}.-esm-billing__printable-invoice__itemsContainer___EA1KS{flex-direction:column;margin:1rem;padding:1rem;display:flex}.-esm-billing__printable-invoice__tableContainer___CeBjk{min-height:50vh}.-esm-billing__printable-invoice__totalContainer___\+8XbC{flex-direction:column;display:flex}.-esm-billing__printable-invoice__item___U-0e6{margin:.75rem}.-esm-billing__printable-invoice__itemHeading___mHy3a{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#21272a;margin-bottom:.25rem;font-weight:700}.-esm-billing__printable-invoice__itemTotal___pOXNY{border-top:.1pt solid #c1c7cd;padding:.25rem}.-esm-billing__printable-invoice__itemLabel___i\+Nva{float:right}.-esm-billing__printable-invoice__summaryContainer___A5A-s,.-esm-billing__printable-invoice__paymentHistoryContainer___Z\+0Pi{margin-top:1rem}.-esm-billing__printable-invoice__balanceContainer___oekII{border-top:.1pt solid #c1c7cd;border-bottom:.1pt solid #c1c7cd;margin-top:1rem;padding:.25rem}.-esm-billing__discounts-table__discountsWrapper___nAknV{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__discounts-table__discountsTable___Wd5vG{width:100%}.-esm-billing__discounts-table__discountsTable___Wd5vG td{border-bottom:none!important}.-esm-billing__discounts-table__tableDescription___dsPxA{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__discounts-table__tableDescription___dsPxA :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__discounts-table__tableDescription___dsPxA>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}:root{--brand-01:#005d5d;--brand-02:#004144;--brand-03:#007d79;--bottom-nav-height:4rem;--workspace-header-height:3rem;--tablet-workspace-window-height:calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height:calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-billing__refunds-table__refundsWrapper___ZvDhw{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__refunds-table__refundsTable___B5xVc{width:100%}.-esm-billing__refunds-table__refundsTable___B5xVc td{border-bottom:none!important}.-esm-billing__refunds-table__tableDescription___hGPCT{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__refunds-table__tableDescription___hGPCT :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__refunds-table__tableDescription___hGPCT>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}.-esm-billing__invoice__invoiceContainer___6Vmk0{background-color:#f4f4f4;height:calc(100vh - 3rem)}.-esm-billing__invoice__errorContainer___b\+MxG{margin:1rem}.-esm-billing__invoice__loader___YjE\+7{justify-content:center;min-height:3rem;display:flex}.-esm-billing__invoice__actionsContainer___CSsXH{justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1rem;display:flex}.-esm-billing__invoice__detailsContainer___93jPh{display:flex}.-esm-billing__invoice__details___zIHv7{flex-flow:wrap;flex:3;justify-content:space-between;align-items:center;row-gap:1.5rem;margin:1rem 1.5rem;display:flex}.-esm-billing__invoice__label___Ecjiu{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#525252;margin:.125rem}.-esm-billing__invoice__value___1rJZi{font-size:var(--cds-heading-03-font-size,1.25rem);font-weight:var(--cds-heading-03-font-weight,400);line-height:var(--cds-heading-03-line-height,1.4);letter-spacing:var(--cds-heading-03-letter-spacing,0);margin-top:.75rem;display:inline-block}.-esm-billing__invoice__backButton___dKGGF{margin:.75rem}.-esm-billing__invoice__backButton___dKGGF button{display:flex;padding-left:0!important}.-esm-billing__invoice__backButton___dKGGF button svg{order:1;margin-right:.5rem;margin-left:0!important}.-esm-billing__invoice__backButton___dKGGF button span{order:2}.-esm-billing__invoice__invoicePaymentsContainer___hl3kD{flex-direction:column;margin:1rem;display:flex}.-esm-billing__invoice__paymentSection___\+eoMm{flex-direction:row;display:flex}.-esm-billing__invoice__invoiceContent___Yd6Pt{margin:1rem}.-esm-billing__invoice__billDetail___YeuwL{color:#21272a;font-weight:700}.-esm-billing__invoice__printContainer___9D3HY{background-color:#fff;display:none}@media print{.-esm-billing__invoice__printContainer___9D3HY{display:block!important}}
|
|
1
|
+
.-esm-billing__billing-header__header___P\+PIw{background-color:#fff;border-bottom:1px solid #e0e0e0;flex-shrink:0}.-esm-billing__bills-table__container___PDs67,.-esm-billing__bills-table__emptyStateContainer___\+sc4M,.-esm-billing__bills-table__loaderContainer___9\+3cP{margin:2rem 0}.-esm-billing__bills-table__billListContainer___z5Mjt{background-color:#fff;border:1px solid #e0e0e0;width:100%;max-width:95vw;margin:0 auto;padding-bottom:0}.-esm-billing__bills-table__billListContainer___z5Mjt :has(.-esm-billing__bills-table__filterEmptyState___hV8Kp){border-bottom:none}.-esm-billing__bills-table__filterContainer___HlgpD{flex-wrap:wrap;flex:1;justify-content:space-between;align-items:flex-end;gap:.75rem;display:flex}.-esm-billing__bills-table__filterContainer___HlgpD .cds--dropdown__wrapper--inline{gap:0}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box__menu-icon{height:1rem}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box__menu{min-width:max-content}.-esm-billing__bills-table__filterContainer___HlgpD .cds--list-box{margin-left:.5rem}.-esm-billing__bills-table__datePickerContainer___Ss4P3{flex-wrap:wrap;gap:.75rem;display:flex}.-esm-billing__bills-table__datePickerContainer___Ss4P3 .-esm-billing__bills-table__clearDatesButton___ZS5e8{align-self:end}.-esm-billing__bills-table__menu___F7TXn{margin-left:.5rem}.-esm-billing__bills-table__headerContainer___FouPn{background-color:#fff;justify-content:space-between;align-items:center;gap:1rem;padding:.75rem 1rem;display:flex}.-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2{justify-content:center;align-items:center;display:flex}.-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2.cds--inline-loading{max-height:1rem}.-esm-billing__bills-table__tableContainer___-rFXM section{position:relative}.-esm-billing__bills-table__tableContainer___-rFXM a{text-decoration:none}.-esm-billing__bills-table__hiddenRow___UsKb7{display:none}.-esm-billing__bills-table__emptyRow___kJSR-{align-items:center;padding:0 1rem;display:flex}.-esm-billing__bills-table__visitSummaryContainer___TzYie{width:100%;max-width:768px;margin:1rem auto}.-esm-billing__bills-table__expandedActiveVisitRow___-imGs>td>div{max-height:max-content!important}.-esm-billing__bills-table__expandedActiveVisitRow___-imGs td,.-esm-billing__bills-table__expandedActiveVisitRow___-imGs th[colspan] td[colspan]>div:first-child{padding:0 1rem}.-esm-billing__bills-table__action___T5jNA{margin-bottom:.5rem}.-esm-billing__bills-table__illo___zE0Ny{margin-top:1rem}.-esm-billing__bills-table__content___XIyTL{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#525252;margin-top:1rem;margin-bottom:.5rem}.-esm-billing__bills-table__desktopHeading___qYmFK,.-esm-billing__bills-table__tabletHeading___JVDgu{text-align:left;text-transform:capitalize;flex:1}.-esm-billing__bills-table__desktopHeading___qYmFK h4,.-esm-billing__bills-table__tabletHeading___JVDgu h4{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252}.-esm-billing__bills-table__desktopHeading___qYmFK h4:after,.-esm-billing__bills-table__tabletHeading___JVDgu h4:after{content:"";border-bottom:.375rem solid #007d79;border-bottom-color:var(--brand-03);width:2rem;padding-top:3px;display:block}.-esm-billing__bills-table__tile___Zxkhk{text-align:center;border:1px solid #e0e0e0}.-esm-billing__bills-table__menuitem___owZSX{max-width:none}.-esm-billing__bills-table__filterEmptyState___hV8Kp{text-align:center;justify-content:center;align-items:center;margin:3rem;padding:1rem;display:flex}.-esm-billing__bills-table__filterEmptyStateTile___qWUMb{margin:auto}.-esm-billing__bills-table__filterEmptyStateContent___W3mdv{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__bills-table__filterEmptyStateHelper___nvBYb{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252}.-esm-billing__billing-dashboard__container___3bf4z{height:calc(100vh - 3rem)}.-esm-billing__billing-dashboard__billsTableContainer___XBT2N{margin:1rem}.-esm-billing__billing-dashboard__illo___Ld3Or{margin-top:1rem}.-esm-billing__billing-dashboard__content___E5cTJ{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#525252;margin-top:1rem}.-esm-billing__billing-dashboard__tile___EG4Yd{text-align:center;border:1px solid #e0e0e0;padding:1.5rem 0}.-esm-billing__line-item-action-menu__menuitem___lOuJD{max-width:none}.-esm-billing__invoice-table__lineItemsWrapper___ABU3I{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__invoice-table__filterEmptyState___ZtVBH{text-align:center;background-color:#fff;justify-content:center;align-items:center;display:flex;padding:3rem!important}.-esm-billing__invoice-table__filterEmptyStateTile___j92yY{margin:auto}.-esm-billing__invoice-table__filterEmptyStateContent___41NoP{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__invoice-table__filterEmptyStateHelper___\+DQR2{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252}.-esm-billing__invoice-table__searchbox___oxEnj{height:3rem}.-esm-billing__invoice-table__searchbox___oxEnj input:focus{outline:2px solid #ff832b!important}.-esm-billing__invoice-table__invoiceTable___2hd71{width:100%}.-esm-billing__invoice-table__invoiceTable___2hd71 td{border-bottom:none!important}.-esm-billing__invoice-table__tableDescription___JKz3j{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__invoice-table__tableDescription___JKz3j :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__invoice-table__tableDescription___JKz3j>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}.-esm-billing__invoice-breakdown__invoiceBreakdown___IGWfb{grid-template-columns:1fr 1fr;align-items:center;margin:.5rem 0;display:grid}.-esm-billing__invoice-breakdown__label___WpAJx{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#161616;text-align:left}.-esm-billing__invoice-breakdown__value___L3Y8v{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#161616;text-align:left;margin-left:.5rem}.-esm-billing__invoice-breakdown__extendedLabel___fJ78V{font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);line-height:var(--cds-heading-compact-01-line-height,1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);color:#dc143c;text-align:left}.-esm-billing__payment-form__container___P4SMq{gap:1.5rem;margin:1rem}.-esm-billing__payment-form__paymentContainer___w2KXI{border-right:1px solid #a2a9b0;width:70%;margin:1rem;padding:1rem}.-esm-billing__payment-form__paymentButtons___Wx8KE{margin:1rem 0}.-esm-billing__payment-form__paymentMethodContainer___fZiwB{grid-template-columns:1fr 1fr 1fr auto;align-items:baseline;gap:1rem;width:100%;margin:1rem 0;display:grid}.-esm-billing__payment-form__paymentTotals___Kcqhm{margin-top:.125rem}.-esm-billing__payment-form__processPayments___ytcE5{justify-content:flex-end;column-gap:.75rem;margin:1rem;display:flex}.-esm-billing__payment-form__errorPaymentContainer___Ft9DN{min-height:3rem;margin:.75rem}.-esm-billing__payment-form__removeButtonContainer___ZtL8L{align-self:center;display:flex}.-esm-billing__payment-form__removeButton___tUx85{color:#da1e28}.-esm-billing__payments__wrapper___V4WiR{display:flex}.-esm-billing__payments__divider___C6sdr{background:#e0e0e0;width:1px;height:12rem;margin:2rem}.-esm-billing__payments__paymentContainer___1SfXU{width:70%;margin:1rem 0;padding:1rem 0}.-esm-billing__payments__paymentButtons___qHpdl{margin:1rem 0}.-esm-billing__payments__pendingEmptyState___jUFD7{text-align:center;background-color:#fff;justify-content:center;align-items:center;display:flex;padding:3rem!important}.-esm-billing__payments__pendingEmptyStateTile___q\+iuz{margin:auto}.-esm-billing__payments__pendingEmptyStateContent___B8pVF{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#525252;margin-bottom:.5rem}.-esm-billing__payments__pendingEmptyStateHelper___amDGw{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);color:#525252;margin-bottom:1rem}.-esm-billing__payments__finalizeButton___nCnCg{margin:0 auto}.-esm-billing__payments__paymentMethodContainer___EW3nN{grid-template-columns:1fr 1fr 1fr 1fr;align-items:baseline;column-gap:1rem;margin:.625rem 0;display:grid}.-esm-billing__payments__paymentTotals___-3A2t{max-width:90%;margin:1rem auto;padding:2rem 1rem}.-esm-billing__payments__processPayments___RG8aV{border-top:1px solid #a2a9b0;justify-content:flex-end;column-gap:.75rem;margin:1rem 0;padding-top:1rem;display:flex}.-esm-billing__print-receipt__configurableLink___BW3h1{color:#fff;margin:0;padding:0;text-decoration:none}.-esm-billing__print-receipt__button___QnAQS{margin-left:.75rem}.-esm-billing__printable-footer__container___mTh7B{flex-direction:column;width:100%;display:flex;position:fixed;bottom:0}.-esm-billing__printable-footer__itemFooter___Y5pkL{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#21272a;padding:1rem}.-esm-billing__printable-invoice-header__container___1u0nI{padding:2rem}.-esm-billing__printable-invoice-header__printableBody___cMhfI{border-bottom:.1pt solid #c1c7cd;padding:.25rem}.-esm-billing__printable-invoice-header__printableBody___cMhfI .-esm-billing__printable-invoice-header__detailsContainer___rJn9A{justify-content:space-between;gap:2rem;display:flex}.-esm-billing__printable-invoice-header__printableHeader___Jl02J{justify-content:space-between;align-items:flex-start;margin-bottom:.25rem;padding-bottom:.25rem;display:flex}.-esm-billing__printable-invoice-header__logo___ZpVka{flex:1}.-esm-billing__printable-invoice-header__img___rSlvX{height:auto}.-esm-billing__printable-invoice-header__facilityDetails___uJPtI{text-align:right;flex:1}.-esm-billing__printable-invoice-header__invoiceHeading___9Xftg{font-size:var(--cds-heading-04-font-size,1.75rem);font-weight:var(--cds-heading-04-font-weight,400);line-height:var(--cds-heading-04-line-height,1.28572);letter-spacing:var(--cds-heading-04-letter-spacing,0);text-transform:uppercase;text-align:center;font-size:40px}.-esm-billing__printable-invoice-header__facilityName___81nN9{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);color:#0e6027;font-weight:700}.-esm-billing__printable-invoice-header__sectionHeading___tOV2s{font-size:var(--cds-heading-compact-02-font-size,1rem);font-weight:var(--cds-heading-compact-02-font-weight,600);line-height:var(--cds-heading-compact-02-line-height,1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing,0);margin-bottom:.75rem;padding-bottom:.5rem}.-esm-billing__printable-invoice-header__itemLabel___\+hACh{font-size:var(--cds-body-compact-01-font-size,.875rem);font-weight:var(--cds-body-compact-01-font-weight,400);line-height:var(--cds-body-compact-01-line-height,1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing,.16px);margin-bottom:.125rem}.-esm-billing__printable-invoice__itemsContainer___EA1KS{flex-direction:column;margin:1rem;padding:1rem;display:flex}.-esm-billing__printable-invoice__tableContainer___CeBjk{min-height:50vh}.-esm-billing__printable-invoice__totalContainer___\+8XbC{flex-direction:column;display:flex}.-esm-billing__printable-invoice__item___U-0e6{margin:.75rem}.-esm-billing__printable-invoice__itemHeading___mHy3a{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#21272a;margin-bottom:.25rem;font-weight:700}.-esm-billing__printable-invoice__itemTotal___pOXNY{border-top:.1pt solid #c1c7cd;padding:.25rem}.-esm-billing__printable-invoice__itemLabel___i\+Nva{float:right}.-esm-billing__printable-invoice__summaryContainer___A5A-s,.-esm-billing__printable-invoice__paymentHistoryContainer___Z\+0Pi{margin-top:1rem}.-esm-billing__printable-invoice__balanceContainer___oekII{border-top:.1pt solid #c1c7cd;border-bottom:.1pt solid #c1c7cd;margin-top:1rem;padding:.25rem}.-esm-billing__discounts-table__discountsWrapper___nAknV{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__discounts-table__discountsTable___Wd5vG{width:100%}.-esm-billing__discounts-table__discountsTable___Wd5vG td{border-bottom:none!important}.-esm-billing__discounts-table__tableDescription___dsPxA{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__discounts-table__tableDescription___dsPxA :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__discounts-table__tableDescription___dsPxA>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}:root{--brand-01:#005d5d;--brand-02:#004144;--brand-03:#007d79;--bottom-nav-height:4rem;--workspace-header-height:3rem;--tablet-workspace-window-height:calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height:calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-billing__refunds-table__refundsWrapper___ZvDhw{background-color:#fff;border:1px solid #e0e0e0;margin-bottom:1rem}.-esm-billing__refunds-table__refundsTable___B5xVc{width:100%}.-esm-billing__refunds-table__refundsTable___B5xVc td{border-bottom:none!important}.-esm-billing__refunds-table__tableDescription___hGPCT{align-items:flex-start;column-gap:.125rem;margin-top:.25rem;display:flex}.-esm-billing__refunds-table__tableDescription___hGPCT :after{content:"";border-bottom:.375rem solid var(--brand-03);width:2rem;padding-top:.188rem;display:block}.-esm-billing__refunds-table__tableDescription___hGPCT>span{font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);line-height:var(--cds-body-01-line-height,1.42857);letter-spacing:var(--cds-body-01-letter-spacing,.16px)}.-esm-billing__invoice__invoiceContainer___6Vmk0{background-color:#f4f4f4;height:calc(100vh - 3rem)}.-esm-billing__invoice__errorContainer___b\+MxG{margin:1rem}.-esm-billing__invoice__loader___YjE\+7{justify-content:center;min-height:3rem;display:flex}.-esm-billing__invoice__actionsContainer___CSsXH{justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1rem;display:flex}.-esm-billing__invoice__detailsContainer___93jPh{display:flex}.-esm-billing__invoice__details___zIHv7{flex-flow:wrap;flex:3;justify-content:space-between;align-items:center;row-gap:1.5rem;margin:1rem 1.5rem;display:flex}.-esm-billing__invoice__label___Ecjiu{font-size:var(--cds-body-compact-02-font-size,1rem);font-weight:var(--cds-body-compact-02-font-weight,400);line-height:var(--cds-body-compact-02-line-height,1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing,0);color:#525252;margin:.125rem}.-esm-billing__invoice__value___1rJZi{font-size:var(--cds-heading-03-font-size,1.25rem);font-weight:var(--cds-heading-03-font-weight,400);line-height:var(--cds-heading-03-line-height,1.4);letter-spacing:var(--cds-heading-03-letter-spacing,0);margin-top:.75rem;display:inline-block}.-esm-billing__invoice__backButton___dKGGF{margin:.75rem}.-esm-billing__invoice__backButton___dKGGF button{display:flex;padding-left:0!important}.-esm-billing__invoice__backButton___dKGGF button svg{order:1;margin-right:.5rem;margin-left:0!important}.-esm-billing__invoice__backButton___dKGGF button span{order:2}.-esm-billing__invoice__invoicePaymentsContainer___hl3kD{flex-direction:column;margin:1rem;display:flex}.-esm-billing__invoice__paymentSection___\+eoMm{flex-direction:row;display:flex}.-esm-billing__invoice__invoiceContent___Yd6Pt{margin:1rem}.-esm-billing__invoice__billDetail___YeuwL{color:#21272a;font-weight:700}.-esm-billing__invoice__printContainer___9D3HY{background-color:#fff;display:none}@media print{.-esm-billing__invoice__printContainer___9D3HY{display:block!important}}
|
package/dist/7968.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"7968.css","sources":["webpack://@openmrs/esm-billing-app/./src/billing-header/billing-header.scss","webpack://@openmrs/esm-billing-app/./src/bills-table/bills-table.scss","webpack://@openmrs/esm-billing-app/./src/billing-dashboard/billing-dashboard.scss","webpack://@openmrs/esm-billing-app/./src/invoice/line-item-action-menu.scss","webpack://@openmrs/esm-billing-app/./src/invoice/invoice-table.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/invoice-breakdown/invoice-breakdown.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/payment-form/payment-form.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/payments.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/print-receipt.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-footer.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-invoice-header.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-invoice.scss","webpack://@openmrs/esm-billing-app/./src/discounts/discounts-table.scss","webpack://@openmrs/esm-billing-app/./node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://@openmrs/esm-billing-app/./src/refunds/refunds-table.scss","webpack://@openmrs/esm-billing-app/./src/invoice/invoice.scss"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"7968.css","sources":["webpack://@openmrs/esm-billing-app/./src/billing-header/billing-header.scss","webpack://@openmrs/esm-billing-app/./src/bills-table/bills-table.scss","webpack://@openmrs/esm-billing-app/./src/billing-dashboard/billing-dashboard.scss","webpack://@openmrs/esm-billing-app/./src/invoice/line-item-action-menu.scss","webpack://@openmrs/esm-billing-app/./src/invoice/invoice-table.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/invoice-breakdown/invoice-breakdown.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/payment-form/payment-form.scss","webpack://@openmrs/esm-billing-app/./src/invoice/payments/payments.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/print-receipt.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-footer.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-invoice-header.scss","webpack://@openmrs/esm-billing-app/./src/invoice/printable-invoice/printable-invoice.scss","webpack://@openmrs/esm-billing-app/./src/discounts/discounts-table.scss","webpack://@openmrs/esm-billing-app/./node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://@openmrs/esm-billing-app/./src/refunds/refunds-table.scss","webpack://@openmrs/esm-billing-app/./src/invoice/invoice.scss"],"names":[],"mappings":"AAEA,mHCEA,0KASA,8JAQE,oIAKF,qJAQE,0FAIA,0FAIA,+FAIA,qFAKF,+FAKE,4HAKF,2DAIA,qKASA,2HAKE,wGAKF,6EAIA,0EAIA,2DAIA,4FAMA,sGAMA,mGAIA,gLAQA,+DAIA,yDAIA,kVAOA,sJAME,oWAIE,mPAWJ,oFAKA,4DAIA,uJASA,qEAIA,yUAMA,iTCpLA,8EAIA,0EAIA,+DAIA,oUAMA,2GCtBA,sECKA,yHAMA,6KASA,uEAIA,2UAMA,oTAKA,4DAGE,gGAKF,8DAGE,mFAKF,gIAME,kKAQA,oQC7DF,wIAOA,sTAMA,wUAOA,0UCpBA,sEAKA,wHAOA,kEAIA,uKASA,sEAIA,yHAOA,yFAKA,0FAKA,gEC7CA,sDAIA,+FAOA,yFAMA,8DAIA,yKASA,oEAIA,uUAMA,kUAMA,8DAIA,iKAQA,gGAMA,qKCjEA,0GAOA,gECPA,yHAQA,8SCRA,wEAIA,+GACE,qLASF,8KAQA,6DAIA,iEAIA,yFAKA,0UAOA,uUAMA,qVAMA,0TCrDA,qHAOA,yEAIA,6FAKA,6DAIA,wUAOA,iGAKA,iEAIA,8IAQA,yJC5CA,2HAMA,kEAGE,uFAKF,kIAME,oKAQA,sQCqBF,sUCjDA,uHAMA,8DAGE,mFAKF,gIAME,kKAQA,oQC7BF,oGAKA,4DAIA,4FAMA,wIAQA,8DAIA,8JAUA,kSAMA,yRAMA,yDAGE,wFAIE,yGAMA,+DAMJ,wGAMA,gFAKA,2DAIA,yEAKA,kFAIE,aAJF"}
|
package/dist/7968.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_billing_app=globalThis.webpackChunk_openmrs_esm_billing_app||[]).push([["7968"],{2300(e,t,a){a.d(t,{A:()=>s});var l=a(5275),n=a.n(l),i=a(8395);let r=()=>n().createElement("svg",{width:"64",height:"64",viewBox:"10 10 60 60.02"},n().createElement("title",null,"Billing module illustration"),n().createElement("g",{fill:"none",fillRule:"evenodd"},n().createElement("path",{opacity:"0.5",d:"M58.75 68.639C60.8886 66.8242 64.1114 66.8242 66.25 68.639C67.703 69.8719 70 68.8873 70 67.0314V12.9686C70 11.1128 67.703 10.1281 66.25 11.3611C64.1114 13.1758 60.8886 13.1758 58.75 11.3611C56.6114 9.54632 53.3886 9.54632 51.25 11.3611C49.1114 13.1758 45.8886 13.1758 43.75 11.3611C41.6114 9.54632 38.3886 9.54632 36.25 11.3611C34.1114 13.1758 30.8886 13.1758 28.75 11.3611C26.6114 9.54632 23.3886 9.54632 21.25 11.3611C19.1114 13.1758 15.8886 13.1758 13.75 11.3611C12.297 10.1281 10 11.1128 10 12.9686V67.0314C10 68.8873 12.297 69.8719 13.75 68.639C15.8886 66.8242 19.1114 66.8242 21.25 68.639C23.3886 70.4537 26.6114 70.4537 28.75 68.639C30.8886 66.8242 34.1114 66.8242 36.25 68.639C38.3886 70.4537 41.6114 70.4537 43.75 68.639C45.8886 66.8242 49.1114 66.8242 51.25 68.639C53.3886 70.4537 56.6114 70.4537 58.75 68.639Z",fill:"#CEE6E5"}),n().createElement("path",{d:"M22.5 51.6666C22.5 50.2859 23.6193 49.1666 25 49.1666H55C56.3807 49.1666 57.5 50.2859 57.5 51.6666C57.5 53.0474 56.3807 54.1666 55 54.1666H25C23.6193 54.1666 22.5 53.0474 22.5 51.6666Z",fill:"#7BBCB9"}),n().createElement("path",{d:"M22.5 40C22.5 38.6193 23.6193 37.5 25 37.5H55C56.3807 37.5 57.5 38.6193 57.5 40C57.5 41.3807 56.3807 42.5 55 42.5H25C23.6193 42.5 22.5 41.3807 22.5 40Z",fill:"#7BBCB9"}),n().createElement("path",{d:"M22.5 28.3333C22.5 26.9526 23.6193 25.8333 25 25.8333H55C56.3807 25.8333 57.5 26.9526 57.5 28.3333C57.5 29.714 56.3807 30.8333 55 30.8333H25C23.6193 30.8333 22.5 29.714 22.5 28.3333Z",fill:"#7BBCB9"}))),s=({title:e})=>{let{t}=(0,i.useTranslation)();return n().createElement("div",{className:"-esm-billing__billing-header__header___P+PIw","data-testid":"billing-header"},n().createElement("div",{className:"-esm-billing__billing-header__left-justified-items___0FINv"},n().createElement(r,null),n().createElement("div",{className:"-esm-billing__billing-header__page-labels___Z52tc"},n().createElement("p",null,t("billing","Billing")),n().createElement("p",{className:"-esm-billing__billing-header__page-name___uiEHw"},e))))}},2373(e,t,a){a.d(t,{Zz:()=>n,aL:()=>i,o_:()=>r});var l=a(3137);function n(e){return Array.isArray(e)?e.reduce((e,t)=>"number"==typeof t.price&&"number"==typeof t.quantity&&!0!==t.voided?e+t.price*t.quantity:e,0):0}let i=(e,t)=>{let a=window.i18next?.language?.substring(0,2)??"",l=new Intl.NumberFormat(a,{style:"currency",currency:t,minimumFractionDigits:2}).format(Math.abs(e));return e<0&&(l=`(${l})`),l},r=(e,t)=>{switch(e){case"male":return(0,l.getCoreTranslation)("male");case"female":return(0,l.getCoreTranslation)("female");case"other":return(0,l.getCoreTranslation)("other");case"unknown":return(0,l.getCoreTranslation)("unknown");default:return e}}},1772(e,t,a){a.d(t,{aL:()=>l.aL,o_:()=>l.o_});var l=a(2373)},6762(e,t,a){a.d(t,{A:()=>h});var l=a(5275),n=a.n(l),i=a(6942),r=a.n(i),s=a(8395),m=a(4751),o=a.n(m),u=a(1752),c=a(3137),d=a(5084);let _="-esm-billing__line-item-action-menu__menuitem___lOuJD",b=({bill:e,item:t,onMutate:a,showDiscountRequest:i,onDiscountRequest:r,showRefundRequest:m,onRefundRequest:o})=>{let{t:b}=(0,s.useTranslation)(),p=(0,c.useLayoutType)(),E=(0,l.useCallback)(()=>{let l=(0,c.showModal)("edit-bill-line-item-modal",{bill:e,item:t,closeModal:()=>l(),onMutate:a})},[e,t,a]),h=(0,l.useCallback)(()=>{let e=(0,c.showModal)("delete-line-item-confirmation-modal",{item:t,closeModal:()=>e(),onMutate:a})},[t,a]),g=e?.status===d.ih.PENDING;return n().createElement(u.Layer,null,n().createElement(u.OverflowMenu,{align:"left",flipped:!0,size:(0,c.isDesktop)(p)?"sm":"lg","data-testid":`action-menu-${t.uuid}`},n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`edit-button-${t.uuid}`,disabled:!g,itemText:(0,c.getCoreTranslation)("edit"),onClick:E}),n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`delete-button-${t.uuid}`,disabled:!g,isDelete:!0,itemText:(0,c.getCoreTranslation)("delete"),onClick:h}),i&&n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`request-discount-button-${t.uuid}`,itemText:b("requestDiscount","Request discount"),onClick:r}),m&&n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`request-refund-button-${t.uuid}`,itemText:b("requestRefund","Request refund"),onClick:o})))};var p=a(1772);let E=e=>(e.price??0)*(e.quantity??0),h=({bill:e,isLoadingBill:t,onMutate:a,viewOnly:i})=>{let{t:m}=(0,s.useTranslation)(),{defaultCurrency:_}=(0,c.useConfig)(),h=(0,c.useLayoutType)(),g=(0,l.useMemo)(()=>e?.lineItems??[],[e?.lineItems]),y=(0,c.isDesktop)(h)?"sm":"lg",[f,v]=(0,l.useState)(""),C=(0,c.useDebounce)(f),T=(0,l.useMemo)(()=>(e?.discounts??[]).filter(e=>!e.voided),[e?.discounts]),N=e?.status===d.ih.PENDING||e?.status===d.ih.POSTED,k=T.some(e=>!e.lineItemUuid),D=(0,l.useMemo)(()=>(e?.refunds??[]).filter(e=>!e.voided),[e?.refunds]),w=e?.status===d.ih.PAID||e?.status===d.ih.PARTIALLY_REFUNDED||e?.status===d.ih.REFUND_REQUESTED,A=D.filter(e=>e.status===d.fH.REQUESTED||e.status===d.fH.APPROVED),S=A.some(e=>!e.lineItemUuid),P=(0,l.useMemo)(()=>C?o().filter(C,g,{extract:e=>`${e.billableService} ${e.item}`}).sort((e,t)=>e.score-t.score).map(e=>e.original):g,[C,g]),I=(0,l.useMemo)(()=>new Map(g.map(e=>[e.uuid,e])),[g]),B=[{header:m("number","Number"),key:"no",width:7},{header:m("billItem","Bill item"),key:"billItem",width:25},{header:m("status","Status"),key:"status",width:25},{header:m("quantity","Quantity"),key:"quantity",width:15},{header:m("price","Price"),key:"price",width:24},{header:m("total","Total"),key:"total",width:15}],R=(0,l.useMemo)(()=>P?.map((e,t)=>({no:`${t+1}`,id:`${e.uuid}`,billItem:e.billableService?e.billableService:e?.item,status:e.status,quantity:e.quantity,price:(0,p.aL)(e.price,_),total:(0,p.aL)(E(e),_)}))??[],[P,_]);return t?n().createElement(u.DataTableSkeleton,{"data-testid":"loader",columnCount:B.length,showHeader:!1,showToolbar:!1,zebra:!0}):n().createElement("div",{className:"-esm-billing__invoice-table__lineItemsWrapper___ABU3I"},n().createElement(u.DataTable,{headers:B,rows:R,size:y,useZebraStyles:!0,overflowMenuOnHover:(0,c.isDesktop)(h)},({rows:t,headers:l,getRowProps:s,getTableProps:o})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__invoice-table__tableDescription___JKz3j"},n().createElement("span",null,m("itemsToBeBilled","Items to be billed"))),title:m("lineItems","Line items")},!i&&n().createElement(u.TableToolbarSearch,{className:"-esm-billing__invoice-table__searchbox___oxEnj",expanded:!0,onChange:e=>v(e.target.value),placeholder:m("searchThisTable","Search this table"),size:y}),n().createElement(u.Table,{...o(),"aria-label":m("invoiceLineItems","Invoice line items"),className:r()("-esm-billing__invoice-table__invoiceTable___2hd71","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,l.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)),!i&&n().createElement(u.TableHeader,{"aria-label":(0,c.getCoreTranslation)("actions")}))),n().createElement(u.TableBody,null,t.map(t=>{let l,r,m=I.get(t.id);return n().createElement(u.TableRow,{key:t.id,...s({row:t})},t.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)),!i&&n().createElement(u.TableCell,{className:"cds--table-column-menu"},m&&n().createElement(b,{bill:e,item:m,onMutate:a,showDiscountRequest:N&&!k&&(l=m.uuid,!T.some(e=>e.lineItemUuid===l)),onDiscountRequest:()=>{let t;t=(0,c.showModal)("request-discount-modal",{bill:{uuid:e.uuid,total:e.totalAmount??0,amountDue:Math.max(0,(e.netAmount??e.totalAmount??0)-(e.tenderedAmount??0)),receiptNumber:e.receiptNumber,lineItemCount:g.length},lineItem:{uuid:m.uuid,display:m.item||m.billableService||"--",total:E(m),quantity:m.quantity,price:m.price},onMutate:()=>a?.(),closeModal:()=>t()})},showRefundRequest:w&&!S&&(r=m.uuid??"",!A.some(e=>e.lineItemUuid===r))&&!!m.uuid,onRefundRequest:()=>(t=>{if(!t.uuid)return;let l=E(t),n=l-D.filter(e=>e.lineItemUuid===t.uuid&&(e.status===d.fH.APPROVED||e.status===d.fH.COMPLETED)).reduce((e,t)=>e+t.refundAmount,0),i=(0,c.showModal)("request-refund-modal",{bill:{uuid:e.uuid,total:e.totalAmount??0,amountAfterDiscount:e.netAmount??e.totalAmount??0},lineItem:{uuid:t.uuid,display:t.item||t.billableService||"--",total:l,quantity:t.quantity,price:t.price},remainingRefundable:Math.max(0,n),onMutate:()=>a?.(),closeModal:()=>i()})})(m)})))}))))),P?.length===0&&n().createElement("div",{className:"-esm-billing__invoice-table__filterEmptyState___ZtVBH"},n().createElement(u.Layer,null,n().createElement(u.Tile,{className:"-esm-billing__invoice-table__filterEmptyStateTile___j92yY"},n().createElement("p",{className:"-esm-billing__invoice-table__filterEmptyStateContent___41NoP"},m("noMatchingItemsToDisplay","No matching items to display")),!i&&n().createElement("p",{className:"-esm-billing__invoice-table__filterEmptyStateHelper___+DQR2"},m("checkFilters","Check the filters above"))))))}},8683(e,t,a){a.d(t,{KY:()=>s,eK:()=>o,qC:()=>m,zb:()=>u});var l=a(3137),n=a(7003);let i=`${n.B}billRefund`,r=`${n.B}bill`;function s({statuses:e}){let t=new URLSearchParams({refundStatus:e.join(","),v:"default"}),a=`${r}?${t.toString()}`,{data:n,isLoading:i,error:m,mutate:o,isValidating:u}=(0,l.useOpenmrsFetchAll)(a);return{bills:n??[],isLoading:i,error:m,mutate:o,isValidating:u}}async function m(e){return(await (0,l.openmrsFetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:e})).data}async function o(e,t){return(await (0,l.openmrsFetch)(`${i}/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:t})).data}async function u(e,t){await (0,l.openmrsFetch)(`${i}/${e}?reason=${encodeURIComponent(t)}`,{method:"DELETE"})}},7283(e,t,a){a.r(t),a.d(t,{default:()=>K});var l=a(5275),n=a.n(l),i=a(9335),r=a(8395),s=a(2300),m=a(6942),o=a.n(m),u=a(1752),c=a(3137),d=a(6199),_=a(5084);let b={container:"-esm-billing__bills-table__container___PDs67",emptyStateContainer:"-esm-billing__bills-table__emptyStateContainer___+sc4M",loaderContainer:"-esm-billing__bills-table__loaderContainer___9+3cP",billListContainer:"-esm-billing__bills-table__billListContainer___z5Mjt",filterEmptyState:"-esm-billing__bills-table__filterEmptyState___hV8Kp",filterContainer:"-esm-billing__bills-table__filterContainer___HlgpD",datePickerContainer:"-esm-billing__bills-table__datePickerContainer___Ss4P3",clearDatesButton:"-esm-billing__bills-table__clearDatesButton___ZS5e8",menu:"-esm-billing__bills-table__menu___F7TXn",headerContainer:"-esm-billing__bills-table__headerContainer___FouPn",backgroundDataFetchingIndicator:"-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2",tableContainer:"-esm-billing__bills-table__tableContainer___-rFXM",hiddenRow:"-esm-billing__bills-table__hiddenRow___UsKb7",emptyRow:"-esm-billing__bills-table__emptyRow___kJSR-",visitSummaryContainer:"-esm-billing__bills-table__visitSummaryContainer___TzYie",expandedActiveVisitRow:"-esm-billing__bills-table__expandedActiveVisitRow___-imGs",action:"-esm-billing__bills-table__action___T5jNA",illo:"-esm-billing__bills-table__illo___zE0Ny",content:"-esm-billing__bills-table__content___XIyTL",desktopHeading:"-esm-billing__bills-table__desktopHeading___qYmFK",tabletHeading:"-esm-billing__bills-table__tabletHeading___JVDgu",tile:"-esm-billing__bills-table__tile___Zxkhk",menuitem:"-esm-billing__bills-table__menuitem___owZSX",filterEmptyStateTile:"-esm-billing__bills-table__filterEmptyStateTile___qWUMb",filterEmptyStateContent:"-esm-billing__bills-table__filterEmptyStateContent___W3mdv",filterEmptyStateHelper:"-esm-billing__bills-table__filterEmptyStateHelper___nvBYb"};function p({layout:e,handleSearch:t,isValidating:a,responsiveSize:l,searchString:i,t:r}){return n().createElement(n().Fragment,null,n().createElement("div",{className:b.headerContainer},n().createElement("div",{className:o()({[b.tabletHeading]:!(0,c.isDesktop)(e),[b.desktopHeading]:(0,c.isDesktop)(e)})},n().createElement("h4",null,r("billList","Bill list"))),a&&n().createElement("div",{className:b.backgroundDataFetchingIndicator},n().createElement("span",null,n().createElement(u.InlineLoading,null)))),n().createElement(u.Search,{autoFocus:!0,closeButtonLabelText:r("clearSearch","Clear"),"data-testid":"billsTableSearchBar",labelText:r("searchForPatient","Search for a patient"),placeholder:r("filterBillsByPatient","Filter bills by patient name or identifier"),value:i,onChange:t,size:l}))}let E=()=>{let{t:e}=(0,r.useTranslation)(),t=(0,c.useLayoutType)(),{pageSize:a}=(0,c.useConfig)(),[i,s]=(0,l.useState)(a??10),m=(0,c.isDesktop)(t)?"sm":"lg",o=(0,l.useMemo)(()=>[{id:"",text:e("allBills","All bills"),status:""},{id:_.ih.PENDING,text:e("pendingConfirmationBills","Pending confirmation"),status:_.ih.PENDING},{id:_.ih.POSTED,text:e("pendingPaymentBills","Pending payment"),status:_.ih.POSTED},{id:_.ih.PAID,text:e("paidBills","Paid bills"),status:_.ih.PAID},{id:_.ih.REFUNDED,text:e("refundedBills","Refunded bills"),status:`${_.ih.REFUNDED},${_.ih.PARTIALLY_REFUNDED}`},{id:_.ih.REFUND_REQUESTED,text:e("pendingRefundBills","Pending refunds"),status:_.ih.REFUND_REQUESTED}],[e]),[E,h]=(0,l.useState)(()=>o.find(e=>e.id===_.ih.PENDING)??o[0]),[g,y]=(0,l.useState)(""),f=(0,c.useDebounce)(g,500),[v,C]=(0,l.useState)(null),[T,N]=(0,l.useState)(null),{bills:k,error:D,currentPage:w,isLoading:A,isValidating:S,totalCount:P,goTo:I}=(0,d.fu)(i,E.status,f||void 0,v,T),B=[{header:e("billDate","Bill date"),key:"dateCreated"},{header:e("invoiceNumber","Invoice number"),key:"receiptNumberDisplay"},{header:e("patientIdentifier","Patient identifier"),key:"identifier"},{header:e("patientName","Patient name"),key:"patientName"},{header:e("billedItems","Billed items"),key:"billedItems"}],R=(0,l.useMemo)(()=>k?.map(e=>({...e,id:String(e.id),dateCreated:e.dateCreated?(0,c.formatDate)((0,c.parseDate)(e.dateCreated),{mode:"wide"}):"--",receiptNumberDisplay:n().createElement(c.ConfigurableLink,{style:{textDecoration:"none"},to:"${openmrsSpaBase}/home/billing/patient/${patientUuid}/${uuid}",templateParams:{patientUuid:e.patientUuid,uuid:e.uuid}},e.receiptNumber),billedItems:e?.lineItems?.map(e=>e.billableService||e.item).filter(Boolean).join(" & ")})),[k]),M=""!==g.trim()||""!==E.id||null!==v||null!==T,L=(0,l.useCallback)(e=>{I(1),y(e.target.value)},[I,y]),H=(0,l.useCallback)(({selectedItem:e})=>{h(e),I(1)},[I]),x=(0,l.useCallback)(e=>{C(e??null),I(1)},[I]),$=(0,l.useCallback)(e=>{N(e??null),I(1)},[I]),z=(0,l.useCallback)(()=>{C(null),N(null),I(1)},[I]);return n().createElement(n().Fragment,null,n().createElement("div",{className:b.filterContainer},n().createElement(u.Dropdown,{className:b.filterDropdown,direction:"bottom",id:"bill-payment-status-filter",selectedItem:E,items:o,itemToString:e=>e?e.text:"",label:"",onChange:H,size:m,titleText:e("filterBy","Filter by:"),type:"inline"}),n().createElement("div",{className:b.datePickerContainer},n().createElement(c.OpenmrsDatePicker,{id:"bill-start-date-filter",labelText:e("from","From"),maxDate:T,value:v,onChange:x,size:m}),n().createElement(c.OpenmrsDatePicker,{id:"bill-end-date-filter",labelText:e("to","To"),minDate:v,value:T,onChange:$,size:m,invalidText:e("endDateBeforeStartDate","End date must be after the start date")}),v||T?n().createElement(u.Button,{className:b.clearDatesButton,kind:"ghost",onClick:z,size:m},e("clearDates","Clear dates")):null)),A&&!k?.length?n().createElement("div",{className:b.loaderContainer,"data-testid":"bills-table-skeleton"},n().createElement(u.DataTableSkeleton,{rowCount:i,showHeader:!1,showToolbar:!1,zebra:!0,columnCount:B?.length})):D?n().createElement("div",{className:b.errorContainer},n().createElement(u.Layer,null,n().createElement(c.ErrorState,{error:D,headerTitle:e("billList","Bill list")}))):R?.length>0||M?n().createElement("div",{className:b.billListContainer},n().createElement(p,{handleSearch:L,isValidating:S,layout:t,responsiveSize:m,searchString:g,t:e}),n().createElement(u.DataTable,{isSortable:!0,rows:R,headers:B,size:m,useZebraStyles:R?.length>1},({rows:t,headers:a,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...i(),"aria-label":e("billList","Bill list")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,a.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,t.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))),R?.length===0&&n().createElement("div",{className:b.filterEmptyState},n().createElement(u.Layer,{level:0},n().createElement(u.Tile,{className:b.filterEmptyStateTile},n().createElement("p",{className:b.filterEmptyStateContent},e("noMatchingBillsToDisplay","No matching bills to display")),n().createElement("p",{className:b.filterEmptyStateHelper},e("checkFilters","Check the filters above"))))),P>0&&n().createElement(u.Pagination,{forwardText:e("nextPage","Next page"),backwardText:e("previousPage","Previous page"),page:w,pageSize:i,pageSizes:[10,20,30,40,50],totalItems:P,onChange:({pageSize:e,page:t})=>{e!==i?(s(e),I(1)):t!==w&&I(t)}})):n().createElement(u.Layer,{className:b.emptyStateContainer},n().createElement(u.Tile,{className:b.tile},n().createElement("div",{className:b.illo},n().createElement(c.EmptyCardIllustration,null)),n().createElement("p",{className:b.content},e("noBillsToDisplay","There are no bills to display.")))))};function h(){let{t:e}=(0,r.useTranslation)();return n().createElement(n().Fragment,null,n().createElement(s.A,{title:e("home","Home")}),n().createElement("section",{className:"-esm-billing__billing-dashboard__billsTableContainer___XBT2N"},n().createElement(E,null)))}var g=a(2137),y=a(9564),f=a(7240),v=a(1772),C=a(6762),T=a(9785),N=a(4476),k=a(3285);let D=({label:e,value:t,hasBalance:a})=>n().createElement("div",{className:"-esm-billing__invoice-breakdown__invoiceBreakdown___IGWfb"},n().createElement("span",{className:a?"-esm-billing__invoice-breakdown__extendedLabel___fJ78V":"-esm-billing__invoice-breakdown__label___WpAJx"},e,": "),n().createElement("span",{className:"-esm-billing__invoice-breakdown__value___L3Y8v"},t));var w=a(6335),A=a.n(w),S=a(7003);let P={errorRetryCount:2},I=async e=>{let{uuid:t,attributes:a}=e,l=a?.find(e=>"919b51c9-8e2e-468f-8354-181bf3e55786"===e.attributeType.uuid)?.uuid;return(0,c.openmrsFetch)(`${c.restBaseUrl}/visit/${t}/attribute/${l}`,{body:{value:!1},headers:{"Content-Type":"application/json"},method:"POST"})},B=({disablePayment:e})=>{let{t}=(0,r.useTranslation)(),{control:a,formState:{errors:l}}=(0,T.xW)(),{paymentModes:i,isLoading:s,error:m}=(()=>{let e=`${S.B}paymentMode`,{data:t,isLoading:a,error:l,mutate:n}=A()(e,c.openmrsFetch,P);return{paymentModes:t?.data?.results??[],isLoading:a,mutate:n,error:l}})();return s?n().createElement(u.NumberInputSkeleton,null):m?n().createElement("div",{className:"-esm-billing__payment-form__errorPaymentContainer___Ft9DN"},n().createElement(c.ErrorState,{headerTitle:t("errorLoadingPaymentModes","Error loading payment modes"),error:m})):e?null:n().createElement("div",{className:"-esm-billing__payment-form__container___P4SMq"},n().createElement("div",{className:"-esm-billing__payment-form__paymentMethodContainer___fZiwB"},n().createElement(T.xI,{control:a,name:"payment.method",render:({field:e})=>n().createElement(u.Dropdown,{id:"paymentMethod",selectedItem:i?.find(t=>t.uuid===e.value)??null,onChange:({selectedItem:t})=>e.onChange(t?.uuid??""),titleText:t("paymentMethod","Payment method"),label:t("selectPaymentMethod","Select payment method"),items:i,itemToString:e=>e?e.name:"",invalid:!!l?.payment?.method,invalidText:l?.payment?.method?.message})}),n().createElement(T.xI,{control:a,name:"payment.amount",render:({field:e})=>n().createElement(u.NumberInput,{allowEmpty:!0,disableWheel:!0,hideSteppers:!0,id:"paymentAmount",invalid:!!l?.payment?.amount,invalidText:l?.payment?.amount?.message,label:t("amount","Amount"),onChange:(t,{value:a})=>{let l=""===a||void 0===a?void 0:Number(a);e.onChange(l)},placeholder:t("enterAmount","Enter amount"),value:e.value??""})}),n().createElement(T.xI,{name:"payment.referenceCode",control:a,render:({field:e})=>n().createElement(u.TextInput,{id:"paymentReferenceCode",labelText:t("referenceNumber","Reference number"),name:e.name,onBlur:e.onBlur,onChange:e.onChange,placeholder:t("enterReferenceNumber","Enter reference number"),type:"text",value:e.value??""})})))},R=({bill:e})=>{let{t}=(0,r.useTranslation)(),{defaultCurrency:a}=(0,c.useConfig)(),l=[{key:"dateCreated",header:t("dateOfPayment","Date of payment")},{key:"amount",header:t("billAmount","Bill amount")},{key:"amountTendered",header:t("amountTendered","Amount tendered")},{key:"paymentMethod",header:t("paymentMethod","Payment method")}],i=(e?.payments??[]).map((e,t)=>{let l=new Date(e.dateCreated);return{id:`${e.uuid}-${t}`,dateCreated:(0,c.formatDate)(l),amountTendered:(0,v.aL)(e.amountTendered,a),amount:(0,v.aL)(e.amount,a),paymentMethod:e.instanceType.name,sortKey:l.getTime()}});if(i.sort((e,t)=>t.sortKey-e.sortKey),0!==Object.values(e?.payments??{}).length)return n().createElement(u.DataTable,{size:"sm",rows:i,headers:l},({rows:e,headers:t,getTableProps:a,getHeaderProps:l,getRowProps:i})=>n().createElement(u.Table,a(),n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,l({header:e}),e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,i({row:e}),e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))},M=({bill:e,mutate:t,onFinalizeBill:a})=>{let{t:l}=(0,r.useTranslation)(),{mutate:i}=(0,w.useSWRConfig)(),s=N.z.object({method:N.z.string().refine(e=>!!e,"Payment method is required"),amount:N.z.number({required_error:l("amountRequired","Amount is required"),invalid_type_error:l("amountRequired","Amount is required")}).positive({message:l("amountMustBePositive","Amount must be greater than 0")}).max((e?.netAmount??0)-(e?.tenderedAmount??0),{message:l("paymentAmountCannotExceedAmountDue","Payment amount cannot exceed amount due")}),referenceCode:N.z.union([N.z.number(),N.z.string()]).optional()}),m=N.z.object({payment:s}),{currentVisit:o}=(0,c.useVisit)(e?.patientUuid),{defaultCurrency:b}=(0,c.useConfig)(),p={payment:{method:"",amount:void 0,referenceCode:""}},E=(0,T.mN)({mode:"all",defaultValues:p,resolver:(0,k.u)(m)}),h=(0,T.FH)({name:"payment",control:E.control,defaultValue:p.payment});if(!e)return null;let g=(e.refunds??[]).filter(e=>e.status===_.fH.COMPLETED).reduce((e,t)=>e+t.refundAmount,0),y=(e.netAmount??0)-(e.tenderedAmount??0),f=e.status===_.ih.PENDING,C=async()=>{if(h?.method&&null!=h.amount)try{await (0,d.TS)({instanceType:h.method,amountTendered:Number(h.amount),amount:e.totalAmount??0},e.uuid),(0,c.showSnackbar)({title:l("billPayment","Bill payment"),subtitle:l("paymentProcessedSuccessfully","Payment processed successfully"),kind:"success"}),o&&I(o),E.reset(p),t(),i((0,d.Z5)(e.patientUuid))}catch(e){(0,c.showSnackbar)({title:l("errorProcessingPayment","Error processing payment"),kind:"error",subtitle:e?.message})}};return n().createElement(T.Op,E,n().createElement("div",{className:"-esm-billing__payments__wrapper___V4WiR"},n().createElement("div",{className:"-esm-billing__payments__paymentContainer___1SfXU"},n().createElement(c.CardHeader,{title:l("payments","Payments")},n().createElement("span",null)),n().createElement("div",null,f?n().createElement("div",{className:"-esm-billing__payments__pendingEmptyState___jUFD7"},n().createElement(u.Layer,null,n().createElement(u.Tile,{className:"-esm-billing__payments__pendingEmptyStateTile___q+iuz"},n().createElement("p",{className:"-esm-billing__payments__pendingEmptyStateContent___B8pVF"},l("billNotFinalized","Bill not finalized")),n().createElement("p",{className:"-esm-billing__payments__pendingEmptyStateHelper___amDGw"},l("finalizeBillToRecordPayment","Finalize this bill before recording a payment.")),n().createElement(u.Button,{className:"-esm-billing__payments__finalizeButton___nCnCg",kind:"primary",size:"sm",onClick:a},l("finalizeBill","Finalize bill"))))):n().createElement(n().Fragment,null,n().createElement(R,{bill:e}),n().createElement(B,{disablePayment:y<=0})))),n().createElement("div",{className:"-esm-billing__payments__divider___C6sdr"}),n().createElement("div",{className:"-esm-billing__payments__paymentTotals___-3A2t"},n().createElement(D,{label:l("totalAmount","Total amount"),value:(0,v.aL)(e.totalAmount??0,b)}),n().createElement(D,{label:l("totalTendered","Total tendered"),value:(0,v.aL)(e.tenderedAmount??0,b)}),n().createElement(D,{label:l("discount","Discount"),value:`- ${(0,v.aL)((e.totalAmount??0)-(e.netAmount??0),b)}`}),n().createElement(D,{label:l("refunds","Refunds"),value:`- ${(0,v.aL)(g,b)}`}),n().createElement(D,{hasBalance:y<0,label:l("amountDue","Amount due"),value:(0,v.aL)(y,b)}),n().createElement("div",{className:"-esm-billing__payments__processPayments___RG8aV"},n().createElement(u.Button,{onClick:()=>(0,c.navigate)({to:window.getOpenmrsSpaBase()+"home/billing"}),kind:"secondary"},l("discard","Discard")),!f&&n().createElement(u.Button,{onClick:C,disabled:!h?.method||null==h.amount||!E.formState.isValid},l("processPayment","Process Payment"))))))},L=({billUuid:e})=>{let{t}=(0,r.useTranslation)(),[a,i]=(0,l.useState)(!1),s=new URL(window.location.href);return n().createElement(u.Button,{kind:"secondary",className:"-esm-billing__print-receipt__button___QnAQS",renderIcon:e=>n().createElement(y.xj,{size:24,...e}),onClick:()=>{i(!0),setTimeout(()=>{let t=`${s.origin}/openmrs${S.B}receipt?billUuid=${e}`,a=document.createElement("a");a.href=t,a.download=`receipt_${e}.pdf`,document.body.appendChild(a),a.click(),document.body.removeChild(a),i(!1)},1e3)},disabled:a},a?(0,c.getCoreTranslation)("loading"):t("printReceipt","Print receipt"))},H=()=>{let{data:e}=(0,d.eC)();return e?n().createElement("div",{className:"-esm-billing__printable-footer__container___mTh7B"},n().createElement("p",{className:"-esm-billing__printable-footer__itemFooter___Y5pkL"},e?.display)):n().createElement("div",null,"--")};var x=a(2193),$=a.n(x);let z="-esm-billing__printable-invoice-header__img___rSlvX",F="-esm-billing__printable-invoice-header__sectionHeading___tOV2s",U="-esm-billing__printable-invoice-header__itemLabel___+hACh",q=({patientDetails:e,defaultFacility:t,bill:a})=>{let{t:l}=(0,r.useTranslation)(),{logo:i,country:s,defaultCurrency:m}=(0,c.useConfig)(),o={[l("invoiceNo","Invoice #")]:a?.receiptNumber,[l("invoiceDate","Invoice date")]:a?.dateCreated?(0,c.formatDate)((0,c.parseDate)(a.dateCreated),{mode:"wide",noToday:!0,time:!1}):"--",[l("totalAmount","Total amount")]:`${m} ${a?.totalAmount}`,[l("totalPaid","Total paid")]:`${m} ${a?.tenderedAmount}`,[l("amountBalance","Amount balance")]:`${m} ${a?.netAmount-a?.tenderedAmount}`,...a?.status&&{[l("invoiceStatus","Invoice status")]:a.status}},u={[l("name","Name")]:e?.name,...e.gender&&{[l("gender","Gender")]:e.gender},...e.birthDate&&{[l("birthDate","Date of birth")]:(0,c.formatDate)((0,c.parseDate)(e.birthDate),{time:!1})},...e.address&&{[l("address","Address")]:e.address}};return n().createElement("div",{className:"-esm-billing__printable-invoice-header__container___1u0nI"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__printableHeader___Jl02J"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__logo___ZpVka"},i?.src&&!$()(i.src)?n().createElement("img",{className:z,src:(0,c.interpolateUrl)(i.src),alt:i.alt}):i?.alt&&!$()(i.alt)?i.alt:n().createElement("svg",{className:z,role:"img",width:110,height:40,viewBox:"0 0 380 119",xmlns:"http://www.w3.org/2000/svg"},n().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.29 40.328a27.755 27.755 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.835 42.835 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968l.021 18.36ZM79.645 79.671a27.744 27.744 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.857 42.857 0 0 0 59.96 103a42.833 42.833 0 0 0 19.672-4.751l.013-18.578ZM40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.819 42.819 0 0 0 4.752 19.672l18.576.013ZM79.634 40.289a27.753 27.753 0 0 1 8.154 19.688 27.744 27.744 0 0 1-8.117 19.646l18.542.02a42.842 42.842 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675l-18.577-.013ZM156.184 60.002c0-8.748-6.118-15.776-15.025-15.776-8.909 0-15.025 7.028-15.025 15.776 0 8.749 6.116 15.78 15.025 15.78 8.907 0 15.025-7.031 15.025-15.78Zm-34.881 0c0-11.482 8.318-19.958 19.856-19.958 11.536 0 19.855 8.477 19.855 19.959 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.965ZM179.514 75.54c5.507 0 9.05-4.14 9.05-9.482 0-5.341-3.543-9.483-9.05-9.483-5.505 0-9.046 4.142-9.046 9.483 0 5.342 3.541 9.482 9.046 9.482ZM166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248V53.306ZM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193h16.021Zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868l3.219 2.508ZM227.854 59.356c0-2.346-.216-4.36-.216-6.05h4.031c0 1.363.11 2.777.11 4.195h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25V59.356ZM259.211 41.008h6.708L278.8 70.791h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507V41.01ZM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333v12.558Zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506V41.01ZM358.123 47.712c-1.506-2.413-4.187-3.486-6.926-3.486-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45l-3.699 3.218Z"}))),n().createElement("div",{className:"-esm-billing__printable-invoice-header__facilityDetails___uJPtI"},n().createElement("p",{className:"-esm-billing__printable-invoice-header__facilityName___81nN9"},t?.display),n().createElement("p",{className:U},s))),n().createElement("h1",{className:"-esm-billing__printable-invoice-header__invoiceHeading___9Xftg"},l("invoice","Invoice")),n().createElement("div",{className:"-esm-billing__printable-invoice-header__printableBody___cMhfI"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__detailsContainer___rJn9A"},n().createElement("div",null,n().createElement("h2",{className:F},l("patientInformation","Patient information")),Object.entries(u).map(([e,t])=>n().createElement("p",{className:U,key:e},n().createElement("strong",null,e),n().createElement("span",null,": ",t)))),n().createElement("div",null,n().createElement("h2",{className:F},l("invoiceSummary","Invoice summary")),Object.entries(o).map(([e,t])=>n().createElement("p",{className:U,key:e},n().createElement("strong",null,e),n().createElement("span",null,": ",t)))))))},O={itemsContainer:"-esm-billing__printable-invoice__itemsContainer___EA1KS",tableContainer:"-esm-billing__printable-invoice__tableContainer___CeBjk",totalContainer:"-esm-billing__printable-invoice__totalContainer___+8XbC",item:"-esm-billing__printable-invoice__item___U-0e6",itemHeading:"-esm-billing__printable-invoice__itemHeading___mHy3a",itemTotal:"-esm-billing__printable-invoice__itemTotal___pOXNY",itemLabel:"-esm-billing__printable-invoice__itemLabel___i+Nva",summaryContainer:"-esm-billing__printable-invoice__summaryContainer___A5A-s",paymentHistoryContainer:"-esm-billing__printable-invoice__paymentHistoryContainer___Z+0Pi",balanceContainer:"-esm-billing__printable-invoice__balanceContainer___oekII"},V=({bill:e,patient:t,componentRef:a,defaultFacility:i})=>{let{t:s}=(0,r.useTranslation)(),m=(0,c.useLayoutType)(),{defaultCurrency:o}=(0,c.useConfig)(),d=(0,c.isDesktop)(m)?"sm":"lg",_=[{header:s("inventoryItem","Inventory item"),key:"billItem"},{header:s("quantity","Quantity"),key:"quantity"},{header:s("unitPrice","Unit price"),key:"price"},{header:s("total","Total"),key:"total"}],b=e?.lineItems?.map(e=>({id:`${e.uuid}`,billItem:e.billableService?e.billableService:e.item,quantity:e.quantity,price:`${o} ${e.price}`,total:`${o} ${e.price*e.quantity}`}))??[],p=[{key:"no",header:s("no","No")},{key:"paymentMethod",header:s("paymentMethod","Payment method")},{key:"amountPaid",header:s("amountPaid","Amount paid")},{key:"dateCreated",header:s("dateOfPayment","Date of payment")}],E=(0,l.useMemo)(()=>e?e.payments?.map((e,t)=>({no:t+1,id:`${e.uuid}-${t}`,paymentMethod:e.instanceType.name,amountPaid:`${o} ${e.amountTendered.toFixed(2)}`,dateCreated:(0,c.formatDate)(new Date(e.dateCreated))})):[],[e,o]),h=(0,l.useMemo)(()=>{let e=t?.address?.[0],a=[e?.line?.join(" "),e?.city,e?.district,e?.state].filter(Boolean).join(", ");return{name:`${t?.name?.[0]?.given?.join(" ")} ${t?.name?.[0].family}`,birthDate:t?.birthDate,gender:(0,v.o_)(t?.gender,s),address:a}},[t,s]);return n().createElement("div",{className:O.container,ref:a},n().createElement(q,{patientDetails:h,defaultFacility:i,bill:e}),n().createElement("div",{className:O.itemsContainer},n().createElement("div",{className:O.tableContainer},n().createElement(u.DataTable,{rows:b,headers:_,size:d,useZebraStyles:!1},({rows:e,headers:t,getRowProps:a,getTableProps:l})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...l(),"aria-label":s("invoiceLineItems","Invoice line items")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...a({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))),e?.netAmount!=null&&e.totalAmount!==e.netAmount?n().createElement(n().Fragment,null,n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("subtotal","Subtotal"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,o," ",e?.totalAmount))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("discount","Discount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,"- ",o," ",(e?.totalAmount??0)-(e?.netAmount??0)))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalAmount","Total amount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,o," ",e?.netAmount)))):n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalAmount","Total amount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,o," ",e?.totalAmount))),e?.payments?.length>0&&n().createElement("div",{className:O.paymentHistoryContainer},n().createElement(u.DataTable,{rows:E,headers:p,size:d},({rows:e,headers:t,getRowProps:a,getTableProps:l})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...l(),"aria-label":s("paymentHistory","Payment History")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...a({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalTendered","Total tendered"),":"),n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,o," ",e?.tenderedAmount))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("balance","Balance"),":"),n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,o," ",e?.netAmount-e?.tenderedAmount))))),n().createElement(H,null))},Z=({bill:e})=>{let{t}=(0,r.useTranslation)(),{defaultCurrency:a}=(0,c.useConfig)(),i=(0,c.useLayoutType)(),s=(0,c.isDesktop)(i)?"sm":"lg",m=(0,l.useMemo)(()=>(e.discounts??[]).filter(e=>!e.voided),[e.discounts]),d=[{header:t("discountItem","Item"),key:"item",width:25},{header:t("discountType","Type"),key:"type",width:15},{header:t("discountAmount","Amount"),key:"amount",width:15},{header:t("justification","Justification"),key:"justification",width:30},{header:t("status","Status"),key:"status",width:15}],b=(0,l.useMemo)(()=>(m??[]).map(l=>({id:l.uuid,item:function(e,t,a){if(!e.lineItemUuid)return a;let l=t.lineItems?.find(t=>t.uuid===e.lineItemUuid);return l?.item||l?.billableService||a}(l,e,t("wholeBill","Whole bill")),type:l.discountType===_.Bp.PERCENTAGE?t("percentage","Percentage"):t("fixedAmount","Fixed amount"),amount:(0,v.aL)(l.discountAmount,a),justification:l.justification,status:t(l.status.toLowerCase(),l.status)})),[m,e,a,t]);return m&&0!==m.length?n().createElement("div",{className:"-esm-billing__discounts-table__discountsWrapper___nAknV"},n().createElement(u.DataTable,{headers:d,rows:b,size:s,useZebraStyles:!0,overflowMenuOnHover:(0,c.isDesktop)(i)},({rows:e,headers:a,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__discounts-table__tableDescription___dsPxA"},n().createElement("span",null,t("discountsAppliedToBill","Discounts applied to this bill"))),title:t("discounts","Discounts")},n().createElement(u.Table,{...i(),"aria-label":t("billDiscounts","Bill discounts"),className:o()("-esm-billing__discounts-table__discountsTable___Wd5vG","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,a.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))):null};var j=a(8683);let G=({bill:e,onMutate:t})=>{let{t:a}=(0,r.useTranslation)(),{defaultCurrency:i}=(0,c.useConfig)(),s=(0,c.useSession)(),m=(0,c.useLayoutType)(),d=(0,c.isDesktop)(m)?"sm":"lg",[b,p]=(0,l.useState)(null),E=[{header:a("refundItem","Item"),key:"item"},{header:a("refundAmount","Refund amount"),key:"amount"},{header:a("reason","Reason"),key:"reason"},{header:a("status","Status"),key:"status"},{header:a("action","Action"),key:"action"}],h=(0,l.useMemo)(()=>(e.refunds??[]).filter(e=>!e.voided),[e.refunds]),g=(0,l.useCallback)(async e=>{p(e.uuid);try{await (0,j.eK)(e.uuid,{status:_.fH.COMPLETED,completer:s.user?.uuid}),(0,c.showSnackbar)({title:a("refundProcessed","Refund processed"),kind:"success"}),t?.()}catch(t){let e=t?.responseBody?.error?.message??(t instanceof Error?t.message:void 0);(0,c.showSnackbar)({title:a("refundProcessFailed","Could not process refund"),subtitle:e,kind:"error"})}finally{p(null)}},[t,s.user?.uuid,a]),y=(0,l.useMemo)(()=>(h??[]).map(t=>({id:t.uuid,item:function(e,t,a){if(!e.lineItemUuid)return a;let l=t.lineItems?.find(t=>t.uuid===e.lineItemUuid);return l?.item||l?.billableService||a}(t,e,a("wholeBill","Whole bill")),amount:(0,v.aL)(t.refundAmount,i),reason:t.reason,status:a(t.status.toLowerCase(),t.status),action:n().createElement(u.Button,{kind:"primary",size:"sm",disabled:b===t.uuid||t.status!==_.fH.APPROVED,onClick:()=>g(t)},b===t.uuid?n().createElement(u.InlineLoading,{description:a("processing","Processing")+"..."}):a("processRefund","Process refund"))})),[h,e,i,b,a,g]);return h&&0!==h.length?n().createElement("div",{className:"-esm-billing__refunds-table__refundsWrapper___ZvDhw"},n().createElement(u.DataTable,{headers:E,rows:y,size:d,useZebraStyles:!0},({rows:e,headers:t,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__refunds-table__tableDescription___hGPCT"},n().createElement("span",null,a("refundsOnBill","Refunds on this bill"))),title:a("refunds","Refunds")},n().createElement(u.Table,{...i(),"aria-label":a("billRefunds","Bill refunds"),className:o()("-esm-billing__refunds-table__refundsTable___B5xVc","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))):null},W="-esm-billing__invoice__invoiceContainer___6Vmk0",Y=`
|
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_billing_app=globalThis.webpackChunk_openmrs_esm_billing_app||[]).push([["7968"],{8730(e,t,a){a.d(t,{A:()=>r});var l=a(5275),n=a.n(l),i=a(3137);let r=({title:e})=>n().createElement(i.PageHeader,{className:"-esm-billing__billing-header__header___P+PIw","data-testid":"billing-header"},n().createElement(i.PageHeaderContent,{illustration:n().createElement(i.PaymentsDeskPictogram,null),title:e}))},2373(e,t,a){a.d(t,{Zz:()=>n,aL:()=>i,o_:()=>r});var l=a(3137);function n(e){return Array.isArray(e)?e.reduce((e,t)=>"number"==typeof t.price&&"number"==typeof t.quantity&&!0!==t.voided?e+t.price*t.quantity:e,0):0}let i=(e,t)=>{let a=window.i18next?.language?.substring(0,2)??"",l=new Intl.NumberFormat(a,{style:"currency",currency:t,minimumFractionDigits:2}).format(Math.abs(e));return e<0&&(l=`(${l})`),l},r=(e,t)=>{switch(e){case"male":return(0,l.getCoreTranslation)("male");case"female":return(0,l.getCoreTranslation)("female");case"other":return(0,l.getCoreTranslation)("other");case"unknown":return(0,l.getCoreTranslation)("unknown");default:return e}}},1772(e,t,a){a.d(t,{aL:()=>l.aL,o_:()=>l.o_});var l=a(2373)},6762(e,t,a){a.d(t,{A:()=>y});var l=a(5275),n=a.n(l),i=a(6942),r=a.n(i),s=a(8395),o=a(4751),m=a.n(o),u=a(1752),c=a(3137),d=a(5084);let _="-esm-billing__line-item-action-menu__menuitem___lOuJD",b=({bill:e,item:t,onMutate:a,showDiscountRequest:i,onDiscountRequest:r,showRefundRequest:o,onRefundRequest:m})=>{let{t:b}=(0,s.useTranslation)(),p=(0,c.useLayoutType)(),E=(0,l.useCallback)(()=>{let l=(0,c.showModal)("edit-bill-line-item-modal",{bill:e,item:t,closeModal:()=>l(),onMutate:a})},[e,t,a]),y=(0,l.useCallback)(()=>{let e=(0,c.showModal)("delete-line-item-confirmation-modal",{item:t,closeModal:()=>e(),onMutate:a})},[t,a]),h=e?.status===d.ih.PENDING;return n().createElement(u.Layer,null,n().createElement(u.OverflowMenu,{align:"left",flipped:!0,size:(0,c.isDesktop)(p)?"sm":"lg","data-testid":`action-menu-${t.uuid}`},n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`edit-button-${t.uuid}`,disabled:!h,itemText:(0,c.getCoreTranslation)("edit"),onClick:E}),n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`delete-button-${t.uuid}`,disabled:!h,isDelete:!0,itemText:(0,c.getCoreTranslation)("delete"),onClick:y}),i&&n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`request-discount-button-${t.uuid}`,itemText:b("requestDiscount","Request discount"),onClick:r}),o&&n().createElement(u.OverflowMenuItem,{className:_,"data-testid":`request-refund-button-${t.uuid}`,itemText:b("requestRefund","Request refund"),onClick:m})))};var p=a(1772);let E=e=>(e.price??0)*(e.quantity??0),y=({bill:e,isLoadingBill:t,onMutate:a,viewOnly:i})=>{let{t:o}=(0,s.useTranslation)(),{defaultCurrency:_}=(0,c.useConfig)(),y=(0,c.useLayoutType)(),h=(0,l.useMemo)(()=>e?.lineItems??[],[e?.lineItems]),g=(0,c.isDesktop)(y)?"sm":"lg",[f,v]=(0,l.useState)(""),T=(0,c.useDebounce)(f),C=(0,l.useMemo)(()=>(e?.discounts??[]).filter(e=>!e.voided),[e?.discounts]),N=e?.status===d.ih.PENDING||e?.status===d.ih.POSTED,k=C.some(e=>!e.lineItemUuid),D=(0,l.useMemo)(()=>(e?.refunds??[]).filter(e=>!e.voided),[e?.refunds]),w=e?.status===d.ih.PAID||e?.status===d.ih.PARTIALLY_REFUNDED||e?.status===d.ih.REFUND_REQUESTED,A=D.filter(e=>e.status===d.fH.REQUESTED||e.status===d.fH.APPROVED),P=A.some(e=>!e.lineItemUuid),S=(0,l.useMemo)(()=>T?m().filter(T,h,{extract:e=>`${e.billableService} ${e.item}`}).sort((e,t)=>e.score-t.score).map(e=>e.original):h,[T,h]),I=(0,l.useMemo)(()=>new Map(h.map(e=>[e.uuid,e])),[h]),B=[{header:o("number","Number"),key:"no",width:7},{header:o("billItem","Bill item"),key:"billItem",width:25},{header:o("status","Status"),key:"status",width:25},{header:o("quantity","Quantity"),key:"quantity",width:15},{header:o("price","Price"),key:"price",width:24},{header:o("total","Total"),key:"total",width:15}],R=(0,l.useMemo)(()=>S?.map((e,t)=>({no:`${t+1}`,id:`${e.uuid}`,billItem:e.billableService?e.billableService:e?.item,status:e.status,quantity:e.quantity,price:(0,p.aL)(e.price,_),total:(0,p.aL)(E(e),_)}))??[],[S,_]);return t?n().createElement(u.DataTableSkeleton,{"data-testid":"loader",columnCount:B.length,showHeader:!1,showToolbar:!1,zebra:!0}):n().createElement("div",{className:"-esm-billing__invoice-table__lineItemsWrapper___ABU3I"},n().createElement(u.DataTable,{headers:B,rows:R,size:g,useZebraStyles:!0,overflowMenuOnHover:(0,c.isDesktop)(y)},({rows:t,headers:l,getRowProps:s,getTableProps:m})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__invoice-table__tableDescription___JKz3j"},n().createElement("span",null,o("itemsToBeBilled","Items to be billed"))),title:o("lineItems","Line items")},!i&&n().createElement(u.TableToolbarSearch,{className:"-esm-billing__invoice-table__searchbox___oxEnj",expanded:!0,onChange:e=>v(e.target.value),placeholder:o("searchThisTable","Search this table"),size:g}),n().createElement(u.Table,{...m(),"aria-label":o("invoiceLineItems","Invoice line items"),className:r()("-esm-billing__invoice-table__invoiceTable___2hd71","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,l.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)),!i&&n().createElement(u.TableHeader,{"aria-label":(0,c.getCoreTranslation)("actions")}))),n().createElement(u.TableBody,null,t.map(t=>{let l,r,o=I.get(t.id);return n().createElement(u.TableRow,{key:t.id,...s({row:t})},t.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)),!i&&n().createElement(u.TableCell,{className:"cds--table-column-menu"},o&&n().createElement(b,{bill:e,item:o,onMutate:a,showDiscountRequest:N&&!k&&(l=o.uuid,!C.some(e=>e.lineItemUuid===l)),onDiscountRequest:()=>{let t;t=(0,c.showModal)("request-discount-modal",{bill:{uuid:e.uuid,total:e.totalAmount??0,amountDue:Math.max(0,(e.netAmount??e.totalAmount??0)-(e.tenderedAmount??0)),receiptNumber:e.receiptNumber,lineItemCount:h.length},lineItem:{uuid:o.uuid,display:o.item||o.billableService||"--",total:E(o),quantity:o.quantity,price:o.price},onMutate:()=>a?.(),closeModal:()=>t()})},showRefundRequest:w&&!P&&(r=o.uuid??"",!A.some(e=>e.lineItemUuid===r))&&!!o.uuid,onRefundRequest:()=>(t=>{if(!t.uuid)return;let l=E(t),n=l-D.filter(e=>e.lineItemUuid===t.uuid&&(e.status===d.fH.APPROVED||e.status===d.fH.COMPLETED)).reduce((e,t)=>e+t.refundAmount,0),i=(0,c.showModal)("request-refund-modal",{bill:{uuid:e.uuid,total:e.totalAmount??0,amountAfterDiscount:e.netAmount??e.totalAmount??0},lineItem:{uuid:t.uuid,display:t.item||t.billableService||"--",total:l,quantity:t.quantity,price:t.price},remainingRefundable:Math.max(0,n),onMutate:()=>a?.(),closeModal:()=>i()})})(o)})))}))))),S?.length===0&&n().createElement("div",{className:"-esm-billing__invoice-table__filterEmptyState___ZtVBH"},n().createElement(u.Layer,null,n().createElement(u.Tile,{className:"-esm-billing__invoice-table__filterEmptyStateTile___j92yY"},n().createElement("p",{className:"-esm-billing__invoice-table__filterEmptyStateContent___41NoP"},o("noMatchingItemsToDisplay","No matching items to display")),!i&&n().createElement("p",{className:"-esm-billing__invoice-table__filterEmptyStateHelper___+DQR2"},o("checkFilters","Check the filters above"))))))}},8683(e,t,a){a.d(t,{KY:()=>s,eK:()=>m,qC:()=>o,zb:()=>u});var l=a(3137),n=a(7003);let i=`${n.B}billRefund`,r=`${n.B}bill`;function s({statuses:e}){let t=new URLSearchParams({refundStatus:e.join(","),v:"default"}),a=`${r}?${t.toString()}`,{data:n,isLoading:i,error:o,mutate:m,isValidating:u}=(0,l.useOpenmrsFetchAll)(a);return{bills:n??[],isLoading:i,error:o,mutate:m,isValidating:u}}async function o(e){return(await (0,l.openmrsFetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:e})).data}async function m(e,t){return(await (0,l.openmrsFetch)(`${i}/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:t})).data}async function u(e,t){await (0,l.openmrsFetch)(`${i}/${e}?reason=${encodeURIComponent(t)}`,{method:"DELETE"})}},7283(e,t,a){a.r(t),a.d(t,{default:()=>K});var l=a(5275),n=a.n(l),i=a(9335),r=a(8395),s=a(8730),o=a(6942),m=a.n(o),u=a(1752),c=a(3137),d=a(6199),_=a(5084);let b={container:"-esm-billing__bills-table__container___PDs67",emptyStateContainer:"-esm-billing__bills-table__emptyStateContainer___+sc4M",loaderContainer:"-esm-billing__bills-table__loaderContainer___9+3cP",billListContainer:"-esm-billing__bills-table__billListContainer___z5Mjt",filterEmptyState:"-esm-billing__bills-table__filterEmptyState___hV8Kp",filterContainer:"-esm-billing__bills-table__filterContainer___HlgpD",datePickerContainer:"-esm-billing__bills-table__datePickerContainer___Ss4P3",clearDatesButton:"-esm-billing__bills-table__clearDatesButton___ZS5e8",menu:"-esm-billing__bills-table__menu___F7TXn",headerContainer:"-esm-billing__bills-table__headerContainer___FouPn",backgroundDataFetchingIndicator:"-esm-billing__bills-table__backgroundDataFetchingIndicator___-WVf2",tableContainer:"-esm-billing__bills-table__tableContainer___-rFXM",hiddenRow:"-esm-billing__bills-table__hiddenRow___UsKb7",emptyRow:"-esm-billing__bills-table__emptyRow___kJSR-",visitSummaryContainer:"-esm-billing__bills-table__visitSummaryContainer___TzYie",expandedActiveVisitRow:"-esm-billing__bills-table__expandedActiveVisitRow___-imGs",action:"-esm-billing__bills-table__action___T5jNA",illo:"-esm-billing__bills-table__illo___zE0Ny",content:"-esm-billing__bills-table__content___XIyTL",desktopHeading:"-esm-billing__bills-table__desktopHeading___qYmFK",tabletHeading:"-esm-billing__bills-table__tabletHeading___JVDgu",tile:"-esm-billing__bills-table__tile___Zxkhk",menuitem:"-esm-billing__bills-table__menuitem___owZSX",filterEmptyStateTile:"-esm-billing__bills-table__filterEmptyStateTile___qWUMb",filterEmptyStateContent:"-esm-billing__bills-table__filterEmptyStateContent___W3mdv",filterEmptyStateHelper:"-esm-billing__bills-table__filterEmptyStateHelper___nvBYb"};function p({layout:e,handleSearch:t,isValidating:a,responsiveSize:l,searchString:i,t:r}){return n().createElement(n().Fragment,null,n().createElement("div",{className:b.headerContainer},n().createElement("div",{className:m()({[b.tabletHeading]:!(0,c.isDesktop)(e),[b.desktopHeading]:(0,c.isDesktop)(e)})},n().createElement("h4",null,r("billList","Bill list"))),a&&n().createElement("div",{className:b.backgroundDataFetchingIndicator},n().createElement("span",null,n().createElement(u.InlineLoading,null)))),n().createElement(u.Search,{autoFocus:!0,closeButtonLabelText:r("clearSearch","Clear"),"data-testid":"billsTableSearchBar",labelText:r("searchForPatient","Search for a patient"),placeholder:r("filterBillsByPatient","Filter bills by patient name or identifier"),value:i,onChange:t,size:l}))}let E=()=>{let{t:e}=(0,r.useTranslation)(),t=(0,c.useLayoutType)(),{pageSize:a}=(0,c.useConfig)(),[i,s]=(0,l.useState)(a??10),o=(0,c.isDesktop)(t)?"sm":"lg",m=(0,l.useMemo)(()=>[{id:"",text:e("allBills","All bills"),status:""},{id:_.ih.PENDING,text:e("pendingConfirmationBills","Pending confirmation"),status:_.ih.PENDING},{id:_.ih.POSTED,text:e("pendingPaymentBills","Pending payment"),status:_.ih.POSTED},{id:_.ih.PAID,text:e("paidBills","Paid bills"),status:_.ih.PAID},{id:_.ih.REFUNDED,text:e("refundedBills","Refunded bills"),status:`${_.ih.REFUNDED},${_.ih.PARTIALLY_REFUNDED}`},{id:_.ih.REFUND_REQUESTED,text:e("pendingRefundBills","Pending refunds"),status:_.ih.REFUND_REQUESTED}],[e]),[E,y]=(0,l.useState)(()=>m.find(e=>e.id===_.ih.PENDING)??m[0]),[h,g]=(0,l.useState)(""),f=(0,c.useDebounce)(h,500),[v,T]=(0,l.useState)(null),[C,N]=(0,l.useState)(null),{bills:k,error:D,currentPage:w,isLoading:A,isValidating:P,totalCount:S,goTo:I}=(0,d.fu)(i,E.status,f||void 0,v,C),B=[{header:e("billDate","Bill date"),key:"dateCreated"},{header:e("invoiceNumber","Invoice number"),key:"receiptNumberDisplay"},{header:e("patientIdentifier","Patient identifier"),key:"identifier"},{header:e("patientName","Patient name"),key:"patientName"},{header:e("billedItems","Billed items"),key:"billedItems"}],R=(0,l.useMemo)(()=>k?.map(e=>({...e,id:String(e.id),dateCreated:e.dateCreated?(0,c.formatDate)((0,c.parseDate)(e.dateCreated),{mode:"wide"}):"--",receiptNumberDisplay:n().createElement(c.ConfigurableLink,{style:{textDecoration:"none"},to:"${openmrsSpaBase}/home/billing/patient/${patientUuid}/${uuid}",templateParams:{patientUuid:e.patientUuid,uuid:e.uuid}},e.receiptNumber),billedItems:e?.lineItems?.map(e=>e.billableService||e.item).filter(Boolean).join(" & ")})),[k]),M=""!==h.trim()||""!==E.id||null!==v||null!==C,L=(0,l.useCallback)(e=>{I(1),g(e.target.value)},[I,g]),H=(0,l.useCallback)(({selectedItem:e})=>{y(e),I(1)},[I]),x=(0,l.useCallback)(e=>{T(e??null),I(1)},[I]),$=(0,l.useCallback)(e=>{N(e??null),I(1)},[I]),z=(0,l.useCallback)(()=>{T(null),N(null),I(1)},[I]);return n().createElement(n().Fragment,null,n().createElement("div",{className:b.filterContainer},n().createElement(u.Dropdown,{className:b.filterDropdown,direction:"bottom",id:"bill-payment-status-filter",selectedItem:E,items:m,itemToString:e=>e?e.text:"",label:"",onChange:H,size:o,titleText:e("filterBy","Filter by:"),type:"inline"}),n().createElement("div",{className:b.datePickerContainer},n().createElement(c.OpenmrsDatePicker,{id:"bill-start-date-filter",labelText:e("from","From"),maxDate:C,value:v,onChange:x,size:o}),n().createElement(c.OpenmrsDatePicker,{id:"bill-end-date-filter",labelText:e("to","To"),minDate:v,value:C,onChange:$,size:o,invalidText:e("endDateBeforeStartDate","End date must be after the start date")}),v||C?n().createElement(u.Button,{className:b.clearDatesButton,kind:"ghost",onClick:z,size:o},e("clearDates","Clear dates")):null)),A&&!k?.length?n().createElement("div",{className:b.loaderContainer,"data-testid":"bills-table-skeleton"},n().createElement(u.DataTableSkeleton,{rowCount:i,showHeader:!1,showToolbar:!1,zebra:!0,columnCount:B?.length})):D?n().createElement("div",{className:b.errorContainer},n().createElement(u.Layer,null,n().createElement(c.ErrorState,{error:D,headerTitle:e("billList","Bill list")}))):R?.length>0||M?n().createElement("div",{className:b.billListContainer},n().createElement(p,{handleSearch:L,isValidating:P,layout:t,responsiveSize:o,searchString:h,t:e}),n().createElement(u.DataTable,{isSortable:!0,rows:R,headers:B,size:o,useZebraStyles:R?.length>1},({rows:t,headers:a,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...i(),"aria-label":e("billList","Bill list")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,a.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,t.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))),R?.length===0&&n().createElement("div",{className:b.filterEmptyState},n().createElement(u.Layer,{level:0},n().createElement(u.Tile,{className:b.filterEmptyStateTile},n().createElement("p",{className:b.filterEmptyStateContent},e("noMatchingBillsToDisplay","No matching bills to display")),n().createElement("p",{className:b.filterEmptyStateHelper},e("checkFilters","Check the filters above"))))),S>0&&n().createElement(u.Pagination,{forwardText:e("nextPage","Next page"),backwardText:e("previousPage","Previous page"),page:w,pageSize:i,pageSizes:[10,20,30,40,50],totalItems:S,onChange:({pageSize:e,page:t})=>{e!==i?(s(e),I(1)):t!==w&&I(t)}})):n().createElement(u.Layer,{className:b.emptyStateContainer},n().createElement(u.Tile,{className:b.tile},n().createElement("div",{className:b.illo},n().createElement(c.EmptyCardIllustration,null)),n().createElement("p",{className:b.content},e("noBillsToDisplay","There are no bills to display.")))))};function y(){let{t:e}=(0,r.useTranslation)();return n().createElement(n().Fragment,null,n().createElement(s.A,{title:e("billing","Billing")}),n().createElement("section",{className:"-esm-billing__billing-dashboard__billsTableContainer___XBT2N"},n().createElement(E,null)))}var h=a(2137),g=a(9564),f=a(7240),v=a(1772),T=a(6762),C=a(9785),N=a(4476),k=a(3285);let D=({label:e,value:t,hasBalance:a})=>n().createElement("div",{className:"-esm-billing__invoice-breakdown__invoiceBreakdown___IGWfb"},n().createElement("span",{className:a?"-esm-billing__invoice-breakdown__extendedLabel___fJ78V":"-esm-billing__invoice-breakdown__label___WpAJx"},e,": "),n().createElement("span",{className:"-esm-billing__invoice-breakdown__value___L3Y8v"},t));var w=a(6335),A=a.n(w),P=a(7003);let S={errorRetryCount:2},I=async e=>{let{uuid:t,attributes:a}=e,l=a?.find(e=>"919b51c9-8e2e-468f-8354-181bf3e55786"===e.attributeType.uuid)?.uuid;return(0,c.openmrsFetch)(`${c.restBaseUrl}/visit/${t}/attribute/${l}`,{body:{value:!1},headers:{"Content-Type":"application/json"},method:"POST"})},B=({disablePayment:e})=>{let{t}=(0,r.useTranslation)(),{control:a,formState:{errors:l}}=(0,C.xW)(),{paymentModes:i,isLoading:s,error:o}=(()=>{let e=`${P.B}paymentMode`,{data:t,isLoading:a,error:l,mutate:n}=A()(e,c.openmrsFetch,S);return{paymentModes:t?.data?.results??[],isLoading:a,mutate:n,error:l}})();return s?n().createElement(u.NumberInputSkeleton,null):o?n().createElement("div",{className:"-esm-billing__payment-form__errorPaymentContainer___Ft9DN"},n().createElement(c.ErrorState,{headerTitle:t("errorLoadingPaymentModes","Error loading payment modes"),error:o})):e?null:n().createElement("div",{className:"-esm-billing__payment-form__container___P4SMq"},n().createElement("div",{className:"-esm-billing__payment-form__paymentMethodContainer___fZiwB"},n().createElement(C.xI,{control:a,name:"payment.method",render:({field:e})=>n().createElement(u.Dropdown,{id:"paymentMethod",selectedItem:i?.find(t=>t.uuid===e.value)??null,onChange:({selectedItem:t})=>e.onChange(t?.uuid??""),titleText:t("paymentMethod","Payment method"),label:t("selectPaymentMethod","Select payment method"),items:i,itemToString:e=>e?e.name:"",invalid:!!l?.payment?.method,invalidText:l?.payment?.method?.message})}),n().createElement(C.xI,{control:a,name:"payment.amount",render:({field:e})=>n().createElement(u.NumberInput,{allowEmpty:!0,disableWheel:!0,hideSteppers:!0,id:"paymentAmount",invalid:!!l?.payment?.amount,invalidText:l?.payment?.amount?.message,label:t("amount","Amount"),onChange:(t,{value:a})=>{let l=""===a||void 0===a?void 0:Number(a);e.onChange(l)},placeholder:t("enterAmount","Enter amount"),value:e.value??""})}),n().createElement(C.xI,{name:"payment.referenceCode",control:a,render:({field:e})=>n().createElement(u.TextInput,{id:"paymentReferenceCode",labelText:t("referenceNumber","Reference number"),name:e.name,onBlur:e.onBlur,onChange:e.onChange,placeholder:t("enterReferenceNumber","Enter reference number"),type:"text",value:e.value??""})})))},R=({bill:e})=>{let{t}=(0,r.useTranslation)(),{defaultCurrency:a}=(0,c.useConfig)(),l=[{key:"dateCreated",header:t("dateOfPayment","Date of payment")},{key:"amount",header:t("billAmount","Bill amount")},{key:"amountTendered",header:t("amountTendered","Amount tendered")},{key:"paymentMethod",header:t("paymentMethod","Payment method")}],i=(e?.payments??[]).map((e,t)=>{let l=new Date(e.dateCreated);return{id:`${e.uuid}-${t}`,dateCreated:(0,c.formatDate)(l),amountTendered:(0,v.aL)(e.amountTendered,a),amount:(0,v.aL)(e.amount,a),paymentMethod:e.instanceType.name,sortKey:l.getTime()}});if(i.sort((e,t)=>t.sortKey-e.sortKey),0!==Object.values(e?.payments??{}).length)return n().createElement(u.DataTable,{size:"sm",rows:i,headers:l},({rows:e,headers:t,getTableProps:a,getHeaderProps:l,getRowProps:i})=>n().createElement(u.Table,a(),n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,l({header:e}),e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,i({row:e}),e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))},M=({bill:e,mutate:t,onFinalizeBill:a})=>{let{t:l}=(0,r.useTranslation)(),{mutate:i}=(0,w.useSWRConfig)(),s=N.z.object({method:N.z.string().refine(e=>!!e,"Payment method is required"),amount:N.z.number({required_error:l("amountRequired","Amount is required"),invalid_type_error:l("amountRequired","Amount is required")}).positive({message:l("amountMustBePositive","Amount must be greater than 0")}).max((e?.netAmount??0)-(e?.tenderedAmount??0),{message:l("paymentAmountCannotExceedAmountDue","Payment amount cannot exceed amount due")}),referenceCode:N.z.union([N.z.number(),N.z.string()]).optional()}),o=N.z.object({payment:s}),{currentVisit:m}=(0,c.useVisit)(e?.patientUuid),{defaultCurrency:b}=(0,c.useConfig)(),p={payment:{method:"",amount:void 0,referenceCode:""}},E=(0,C.mN)({mode:"all",defaultValues:p,resolver:(0,k.u)(o)}),y=(0,C.FH)({name:"payment",control:E.control,defaultValue:p.payment});if(!e)return null;let h=(e.refunds??[]).filter(e=>e.status===_.fH.COMPLETED).reduce((e,t)=>e+t.refundAmount,0),g=(e.netAmount??0)-(e.tenderedAmount??0),f=e.status===_.ih.PENDING,T=async()=>{if(y?.method&&null!=y.amount)try{await (0,d.TS)({instanceType:y.method,amountTendered:Number(y.amount),amount:e.totalAmount??0},e.uuid),(0,c.showSnackbar)({title:l("billPayment","Bill payment"),subtitle:l("paymentProcessedSuccessfully","Payment processed successfully"),kind:"success"}),m&&I(m),E.reset(p),t(),i((0,d.Z5)(e.patientUuid))}catch(e){(0,c.showSnackbar)({title:l("errorProcessingPayment","Error processing payment"),kind:"error",subtitle:e?.message})}};return n().createElement(C.Op,E,n().createElement("div",{className:"-esm-billing__payments__wrapper___V4WiR"},n().createElement("div",{className:"-esm-billing__payments__paymentContainer___1SfXU"},n().createElement(c.CardHeader,{title:l("payments","Payments")},n().createElement("span",null)),n().createElement("div",null,f?n().createElement("div",{className:"-esm-billing__payments__pendingEmptyState___jUFD7"},n().createElement(u.Layer,null,n().createElement(u.Tile,{className:"-esm-billing__payments__pendingEmptyStateTile___q+iuz"},n().createElement("p",{className:"-esm-billing__payments__pendingEmptyStateContent___B8pVF"},l("billNotFinalized","Bill not finalized")),n().createElement("p",{className:"-esm-billing__payments__pendingEmptyStateHelper___amDGw"},l("finalizeBillToRecordPayment","Finalize this bill before recording a payment.")),n().createElement(u.Button,{className:"-esm-billing__payments__finalizeButton___nCnCg",kind:"primary",size:"sm",onClick:a},l("finalizeBill","Finalize bill"))))):n().createElement(n().Fragment,null,n().createElement(R,{bill:e}),n().createElement(B,{disablePayment:g<=0})))),n().createElement("div",{className:"-esm-billing__payments__divider___C6sdr"}),n().createElement("div",{className:"-esm-billing__payments__paymentTotals___-3A2t"},n().createElement(D,{label:l("totalAmount","Total amount"),value:(0,v.aL)(e.totalAmount??0,b)}),n().createElement(D,{label:l("totalTendered","Total tendered"),value:(0,v.aL)(e.tenderedAmount??0,b)}),n().createElement(D,{label:l("discount","Discount"),value:`- ${(0,v.aL)((e.totalAmount??0)-(e.netAmount??0),b)}`}),n().createElement(D,{label:l("refunds","Refunds"),value:`- ${(0,v.aL)(h,b)}`}),n().createElement(D,{hasBalance:g<0,label:l("amountDue","Amount due"),value:(0,v.aL)(g,b)}),n().createElement("div",{className:"-esm-billing__payments__processPayments___RG8aV"},n().createElement(u.Button,{onClick:()=>(0,c.navigate)({to:window.getOpenmrsSpaBase()+"home/billing"}),kind:"secondary"},l("discard","Discard")),!f&&n().createElement(u.Button,{onClick:T,disabled:!y?.method||null==y.amount||!E.formState.isValid},l("processPayment","Process Payment"))))))},L=({billUuid:e})=>{let{t}=(0,r.useTranslation)(),[a,i]=(0,l.useState)(!1),s=new URL(window.location.href);return n().createElement(u.Button,{kind:"secondary",className:"-esm-billing__print-receipt__button___QnAQS",renderIcon:e=>n().createElement(g.xj,{size:24,...e}),onClick:()=>{i(!0),setTimeout(()=>{let t=`${s.origin}/openmrs${P.B}receipt?billUuid=${e}`,a=document.createElement("a");a.href=t,a.download=`receipt_${e}.pdf`,document.body.appendChild(a),a.click(),document.body.removeChild(a),i(!1)},1e3)},disabled:a},a?(0,c.getCoreTranslation)("loading"):t("printReceipt","Print receipt"))},H=()=>{let{data:e}=(0,d.eC)();return e?n().createElement("div",{className:"-esm-billing__printable-footer__container___mTh7B"},n().createElement("p",{className:"-esm-billing__printable-footer__itemFooter___Y5pkL"},e?.display)):n().createElement("div",null,"--")};var x=a(2193),$=a.n(x);let z="-esm-billing__printable-invoice-header__img___rSlvX",F="-esm-billing__printable-invoice-header__sectionHeading___tOV2s",U="-esm-billing__printable-invoice-header__itemLabel___+hACh",q=({patientDetails:e,defaultFacility:t,bill:a})=>{let{t:l}=(0,r.useTranslation)(),{logo:i,country:s,defaultCurrency:o}=(0,c.useConfig)(),m={[l("invoiceNo","Invoice #")]:a?.receiptNumber,[l("invoiceDate","Invoice date")]:a?.dateCreated?(0,c.formatDate)((0,c.parseDate)(a.dateCreated),{mode:"wide",noToday:!0,time:!1}):"--",[l("totalAmount","Total amount")]:`${o} ${a?.totalAmount}`,[l("totalPaid","Total paid")]:`${o} ${a?.tenderedAmount}`,[l("amountBalance","Amount balance")]:`${o} ${a?.netAmount-a?.tenderedAmount}`,...a?.status&&{[l("invoiceStatus","Invoice status")]:a.status}},u={[l("name","Name")]:e?.name,...e.gender&&{[l("gender","Gender")]:e.gender},...e.birthDate&&{[l("birthDate","Date of birth")]:(0,c.formatDate)((0,c.parseDate)(e.birthDate),{time:!1})},...e.address&&{[l("address","Address")]:e.address}};return n().createElement("div",{className:"-esm-billing__printable-invoice-header__container___1u0nI"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__printableHeader___Jl02J"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__logo___ZpVka"},i?.src&&!$()(i.src)?n().createElement("img",{className:z,src:(0,c.interpolateUrl)(i.src),alt:i.alt}):i?.alt&&!$()(i.alt)?i.alt:n().createElement("svg",{className:z,role:"img",width:110,height:40,viewBox:"0 0 380 119",xmlns:"http://www.w3.org/2000/svg"},n().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.29 40.328a27.755 27.755 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.835 42.835 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968l.021 18.36ZM79.645 79.671a27.744 27.744 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.857 42.857 0 0 0 59.96 103a42.833 42.833 0 0 0 19.672-4.751l.013-18.578ZM40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.819 42.819 0 0 0 4.752 19.672l18.576.013ZM79.634 40.289a27.753 27.753 0 0 1 8.154 19.688 27.744 27.744 0 0 1-8.117 19.646l18.542.02a42.842 42.842 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675l-18.577-.013ZM156.184 60.002c0-8.748-6.118-15.776-15.025-15.776-8.909 0-15.025 7.028-15.025 15.776 0 8.749 6.116 15.78 15.025 15.78 8.907 0 15.025-7.031 15.025-15.78Zm-34.881 0c0-11.482 8.318-19.958 19.856-19.958 11.536 0 19.855 8.477 19.855 19.959 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.965ZM179.514 75.54c5.507 0 9.05-4.14 9.05-9.482 0-5.341-3.543-9.483-9.05-9.483-5.505 0-9.046 4.142-9.046 9.483 0 5.342 3.541 9.482 9.046 9.482ZM166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248V53.306ZM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193h16.021Zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868l3.219 2.508ZM227.854 59.356c0-2.346-.216-4.36-.216-6.05h4.031c0 1.363.11 2.777.11 4.195h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25V59.356ZM259.211 41.008h6.708L278.8 70.791h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507V41.01ZM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333v12.558Zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506V41.01ZM358.123 47.712c-1.506-2.413-4.187-3.486-6.926-3.486-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45l-3.699 3.218Z"}))),n().createElement("div",{className:"-esm-billing__printable-invoice-header__facilityDetails___uJPtI"},n().createElement("p",{className:"-esm-billing__printable-invoice-header__facilityName___81nN9"},t?.display),n().createElement("p",{className:U},s))),n().createElement("h1",{className:"-esm-billing__printable-invoice-header__invoiceHeading___9Xftg"},l("invoice","Invoice")),n().createElement("div",{className:"-esm-billing__printable-invoice-header__printableBody___cMhfI"},n().createElement("div",{className:"-esm-billing__printable-invoice-header__detailsContainer___rJn9A"},n().createElement("div",null,n().createElement("h2",{className:F},l("patientInformation","Patient information")),Object.entries(u).map(([e,t])=>n().createElement("p",{className:U,key:e},n().createElement("strong",null,e),n().createElement("span",null,": ",t)))),n().createElement("div",null,n().createElement("h2",{className:F},l("invoiceSummary","Invoice summary")),Object.entries(m).map(([e,t])=>n().createElement("p",{className:U,key:e},n().createElement("strong",null,e),n().createElement("span",null,": ",t)))))))},O={itemsContainer:"-esm-billing__printable-invoice__itemsContainer___EA1KS",tableContainer:"-esm-billing__printable-invoice__tableContainer___CeBjk",totalContainer:"-esm-billing__printable-invoice__totalContainer___+8XbC",item:"-esm-billing__printable-invoice__item___U-0e6",itemHeading:"-esm-billing__printable-invoice__itemHeading___mHy3a",itemTotal:"-esm-billing__printable-invoice__itemTotal___pOXNY",itemLabel:"-esm-billing__printable-invoice__itemLabel___i+Nva",summaryContainer:"-esm-billing__printable-invoice__summaryContainer___A5A-s",paymentHistoryContainer:"-esm-billing__printable-invoice__paymentHistoryContainer___Z+0Pi",balanceContainer:"-esm-billing__printable-invoice__balanceContainer___oekII"},V=({bill:e,patient:t,componentRef:a,defaultFacility:i})=>{let{t:s}=(0,r.useTranslation)(),o=(0,c.useLayoutType)(),{defaultCurrency:m}=(0,c.useConfig)(),d=(0,c.isDesktop)(o)?"sm":"lg",_=[{header:s("inventoryItem","Inventory item"),key:"billItem"},{header:s("quantity","Quantity"),key:"quantity"},{header:s("unitPrice","Unit price"),key:"price"},{header:s("total","Total"),key:"total"}],b=e?.lineItems?.map(e=>({id:`${e.uuid}`,billItem:e.billableService?e.billableService:e.item,quantity:e.quantity,price:`${m} ${e.price}`,total:`${m} ${e.price*e.quantity}`}))??[],p=[{key:"no",header:s("no","No")},{key:"paymentMethod",header:s("paymentMethod","Payment method")},{key:"amountPaid",header:s("amountPaid","Amount paid")},{key:"dateCreated",header:s("dateOfPayment","Date of payment")}],E=(0,l.useMemo)(()=>e?e.payments?.map((e,t)=>({no:t+1,id:`${e.uuid}-${t}`,paymentMethod:e.instanceType.name,amountPaid:`${m} ${e.amountTendered.toFixed(2)}`,dateCreated:(0,c.formatDate)(new Date(e.dateCreated))})):[],[e,m]),y=(0,l.useMemo)(()=>{let e=t?.address?.[0],a=[e?.line?.join(" "),e?.city,e?.district,e?.state].filter(Boolean).join(", ");return{name:`${t?.name?.[0]?.given?.join(" ")} ${t?.name?.[0].family}`,birthDate:t?.birthDate,gender:(0,v.o_)(t?.gender,s),address:a}},[t,s]);return n().createElement("div",{className:O.container,ref:a},n().createElement(q,{patientDetails:y,defaultFacility:i,bill:e}),n().createElement("div",{className:O.itemsContainer},n().createElement("div",{className:O.tableContainer},n().createElement(u.DataTable,{rows:b,headers:_,size:d,useZebraStyles:!1},({rows:e,headers:t,getRowProps:a,getTableProps:l})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...l(),"aria-label":s("invoiceLineItems","Invoice line items")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...a({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value)))))))),e?.netAmount!=null&&e.totalAmount!==e.netAmount?n().createElement(n().Fragment,null,n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("subtotal","Subtotal"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,m," ",e?.totalAmount))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("discount","Discount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,"- ",m," ",(e?.totalAmount??0)-(e?.netAmount??0)))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalAmount","Total amount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,m," ",e?.netAmount)))):n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalAmount","Total amount"),":")," ",n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,m," ",e?.totalAmount))),e?.payments?.length>0&&n().createElement("div",{className:O.paymentHistoryContainer},n().createElement(u.DataTable,{rows:E,headers:p,size:d},({rows:e,headers:t,getRowProps:a,getTableProps:l})=>n().createElement(u.TableContainer,null,n().createElement(u.Table,{...l(),"aria-label":s("paymentHistory","Payment History")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...a({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("totalTendered","Total tendered"),":"),n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,m," ",e?.tenderedAmount))),n().createElement("div",{className:O.balanceContainer},n().createElement("span",{className:O.itemHeading},s("balance","Balance"),":"),n().createElement("span",{className:O.itemLabel},n().createElement("strong",null,m," ",e?.netAmount-e?.tenderedAmount))))),n().createElement(H,null))},j=({bill:e})=>{let{t}=(0,r.useTranslation)(),{defaultCurrency:a}=(0,c.useConfig)(),i=(0,c.useLayoutType)(),s=(0,c.isDesktop)(i)?"sm":"lg",o=(0,l.useMemo)(()=>(e.discounts??[]).filter(e=>!e.voided),[e.discounts]),d=[{header:t("discountItem","Item"),key:"item",width:25},{header:t("discountType","Type"),key:"type",width:15},{header:t("discountAmount","Amount"),key:"amount",width:15},{header:t("justification","Justification"),key:"justification",width:30},{header:t("status","Status"),key:"status",width:15}],b=(0,l.useMemo)(()=>(o??[]).map(l=>({id:l.uuid,item:function(e,t,a){if(!e.lineItemUuid)return a;let l=t.lineItems?.find(t=>t.uuid===e.lineItemUuid);return l?.item||l?.billableService||a}(l,e,t("wholeBill","Whole bill")),type:l.discountType===_.Bp.PERCENTAGE?t("percentage","Percentage"):t("fixedAmount","Fixed amount"),amount:(0,v.aL)(l.discountAmount,a),justification:l.justification,status:t(l.status.toLowerCase(),l.status)})),[o,e,a,t]);return o&&0!==o.length?n().createElement("div",{className:"-esm-billing__discounts-table__discountsWrapper___nAknV"},n().createElement(u.DataTable,{headers:d,rows:b,size:s,useZebraStyles:!0,overflowMenuOnHover:(0,c.isDesktop)(i)},({rows:e,headers:a,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__discounts-table__tableDescription___dsPxA"},n().createElement("span",null,t("discountsAppliedToBill","Discounts applied to this bill"))),title:t("discounts","Discounts")},n().createElement(u.Table,{...i(),"aria-label":t("billDiscounts","Bill discounts"),className:m()("-esm-billing__discounts-table__discountsTable___Wd5vG","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,a.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))):null};var Z=a(8683);let G=({bill:e,onMutate:t})=>{let{t:a}=(0,r.useTranslation)(),{defaultCurrency:i}=(0,c.useConfig)(),s=(0,c.useSession)(),o=(0,c.useLayoutType)(),d=(0,c.isDesktop)(o)?"sm":"lg",[b,p]=(0,l.useState)(null),E=[{header:a("refundItem","Item"),key:"item"},{header:a("refundAmount","Refund amount"),key:"amount"},{header:a("reason","Reason"),key:"reason"},{header:a("status","Status"),key:"status"},{header:a("action","Action"),key:"action"}],y=(0,l.useMemo)(()=>(e.refunds??[]).filter(e=>!e.voided),[e.refunds]),h=(0,l.useCallback)(async e=>{p(e.uuid);try{await (0,Z.eK)(e.uuid,{status:_.fH.COMPLETED,completer:s.user?.uuid}),(0,c.showSnackbar)({title:a("refundProcessed","Refund processed"),kind:"success"}),t?.()}catch(t){let e=t?.responseBody?.error?.message??(t instanceof Error?t.message:void 0);(0,c.showSnackbar)({title:a("refundProcessFailed","Could not process refund"),subtitle:e,kind:"error"})}finally{p(null)}},[t,s.user?.uuid,a]),g=(0,l.useMemo)(()=>(y??[]).map(t=>({id:t.uuid,item:function(e,t,a){if(!e.lineItemUuid)return a;let l=t.lineItems?.find(t=>t.uuid===e.lineItemUuid);return l?.item||l?.billableService||a}(t,e,a("wholeBill","Whole bill")),amount:(0,v.aL)(t.refundAmount,i),reason:t.reason,status:a(t.status.toLowerCase(),t.status),action:n().createElement(u.Button,{kind:"primary",size:"sm",disabled:b===t.uuid||t.status!==_.fH.APPROVED,onClick:()=>h(t)},b===t.uuid?n().createElement(u.InlineLoading,{description:a("processing","Processing")+"..."}):a("processRefund","Process refund"))})),[y,e,i,b,a,h]);return y&&0!==y.length?n().createElement("div",{className:"-esm-billing__refunds-table__refundsWrapper___ZvDhw"},n().createElement(u.DataTable,{headers:E,rows:g,size:d,useZebraStyles:!0},({rows:e,headers:t,getRowProps:l,getTableProps:i})=>n().createElement(u.TableContainer,{description:n().createElement("span",{className:"-esm-billing__refunds-table__tableDescription___hGPCT"},n().createElement("span",null,a("refundsOnBill","Refunds on this bill"))),title:a("refunds","Refunds")},n().createElement(u.Table,{...i(),"aria-label":a("billRefunds","Bill refunds"),className:m()("-esm-billing__refunds-table__refundsTable___B5xVc","billingTable")},n().createElement(u.TableHead,null,n().createElement(u.TableRow,null,t.map(e=>n().createElement(u.TableHeader,{key:e.key},e.header)))),n().createElement(u.TableBody,null,e.map(e=>n().createElement(u.TableRow,{key:e.id,...l({row:e})},e.cells.map(e=>n().createElement(u.TableCell,{key:e.id},e.value))))))))):null},W="-esm-billing__invoice__invoiceContainer___6Vmk0",Y=`
|
|
2
2
|
@page {
|
|
3
3
|
/* Remove the browser's default header (title) and footer (url) */
|
|
4
4
|
margin: 0;
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
-webkit-print-color-adjust: exact;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`;function J({label:e,value:t}){let{t:a}=(0,r.useTranslation)();return n().createElement("div",null,n().createElement("h1",{className:"-esm-billing__invoice__label___Ecjiu"},a(e)),n().createElement("span",{className:"-esm-billing__invoice__value___1rJZi"},t))}let X=()=>{let{t:e}=(0,r.useTranslation)(),{data:t}=(0,d.eC)(),{billUuid:a,patientUuid:s}=(0,i.useParams)(),{patient:
|
|
18
|
+
`;function J({label:e,value:t}){let{t:a}=(0,r.useTranslation)();return n().createElement("div",null,n().createElement("h1",{className:"-esm-billing__invoice__label___Ecjiu"},a(e)),n().createElement("span",{className:"-esm-billing__invoice__value___1rJZi"},t))}let X=()=>{let{t:e}=(0,r.useTranslation)(),{data:t}=(0,d.eC)(),{billUuid:a,patientUuid:s}=(0,i.useParams)(),{patient:o,isLoading:m}=(0,c.usePatient)(s),{bill:b,isLoading:p,error:E,isValidating:y,mutate:C}=(0,d.DX)(a),[N,k]=(0,l.useState)(!1),D=(0,l.useRef)(null),w=(0,l.useRef)(null),{defaultCurrency:A}=(0,c.useConfig)(),P=(b?.discounts??[]).filter(e=>!e.voided),S=P.some(e=>!e.lineItemUuid),I=P.some(e=>!!e.lineItemUuid),B=b?.status===_.ih.PENDING||b?.status===_.ih.POSTED,R=!!b&&B&&!S,H=P.some(e=>e.status===_.nT.APPROVED),x=(b?.refunds??[]).filter(e=>!e.voided),$=b?.status===_.ih.PAID||b?.status===_.ih.PARTIALLY_REFUNDED,z=x.filter(e=>e.status===_.fH.REQUESTED||e.status===_.fH.APPROVED),F=z.some(e=>!e.lineItemUuid),U=new Set(z.flatMap(e=>e.lineItemUuid?[e.lineItemUuid]:[])),q=!!b&&$&&!F,O=()=>{if(!b)return;if(null==b.netAmount)return void(0,c.showSnackbar)({title:e("refundUnavailable","Refund unavailable"),subtitle:e("refundUnavailableSubtitle","Bill amount could not be determined. Please reload and try again."),kind:"error"});let t=x.filter(e=>e.status===_.fH.APPROVED||e.status===_.fH.COMPLETED).reduce((e,t)=>e+t.refundAmount,0),a=b.netAmount-t,l=(0,c.showModal)("request-refund-modal",{bill:{uuid:b.uuid,total:b.totalAmount??0,amountAfterDiscount:b.netAmount,receiptNumber:b.receiptNumber,lineItemCount:b.lineItems?.length??0},remainingRefundable:Math.max(0,a),onMutate:()=>C(),closeModal:()=>l()})},Z=(0,l.useCallback)(()=>{w.current=null,k(!1)},[]),X=(0,l.useCallback)(()=>new Promise(e=>{o&&b&&(k(!0),w.current=e)}),[b,o]),K=()=>{let e=(0,c.showModal)("finalize-bill-confirmation-modal",{bill:b,onMutate:C,closeModal:()=>e()})},Q=(0,f.useReactToPrint)({contentRef:D,documentTitle:`Invoice ${b?.receiptNumber} - ${o?.name?.[0]?.given?.join(" ")} ${o?.name?.[0].family}`,pageStyle:Y,onBeforePrint:X,onAfterPrint:Z,preserveAfterPrint:!1,onPrintError:(t,a)=>(0,c.showSnackbar)({title:e("errorPrintingInvoice","Error printing invoice"),kind:"error",subtitle:a.message})});(0,l.useEffect)(()=>{N&&w.current&&w.current()},[N]);let ee={[e("dateBillCreated","Date bill created")]:b?.dateCreated?(0,c.formatDate)((0,c.parseDate)(b.dateCreated),{mode:"wide"}):"--",[e("totalAmount","Total amount")]:(0,v.aL)(b?.totalAmount,A),...H?{[e("discount","Discount")]:`- ${(0,v.aL)((b?.totalAmount??0)-(b?.netAmount??0),A)}`,[e("netAmount","Net amount")]:(0,v.aL)(b?.netAmount,A)}:{},[e("amountTendered","Amount tendered")]:(0,v.aL)(b?.tenderedAmount,A),[e("amountDue","Amount due")]:(0,v.aL)(b?(b.netAmount??0)-(b.tenderedAmount??0):void 0,A),[e("invoiceNumber","Invoice number")]:b?.receiptNumber,[e("invoiceStatus","Invoice status")]:b?.status};return m||p?n().createElement("div",{className:W},n().createElement(u.InlineLoading,{className:"-esm-billing__invoice__loader___YjE+7",description:`${e("loadingBillInfo","Loading bill information")}...`})):E?n().createElement("div",{className:"-esm-billing__invoice__errorContainer___b+MxG"},n().createElement(c.ErrorState,{headerTitle:e("invoiceError","Invoice error"),error:E})):n().createElement("div",{className:W},o&&s&&n().createElement(c.ExtensionSlot,{name:"patient-header-slot",state:{patient:o,patientUuid:s}}),n().createElement("div",{className:"-esm-billing__invoice__actionsContainer___CSsXH"},y&&n().createElement("span",null,n().createElement(u.InlineLoading,{status:"active"})),R&&n().createElement(u.Button,{kind:"tertiary",onClick:()=>{let e=(0,c.showModal)("request-discount-modal",{bill:{uuid:b.uuid,total:b.totalAmount??0,amountDue:Math.max(0,(b.netAmount??b.totalAmount??0)-(b.tenderedAmount??0)),receiptNumber:b.receiptNumber,lineItemCount:b.lineItems?.length??0},onMutate:()=>C(),closeModal:()=>e()})},disabled:I},e("requestDiscount","Request discount")),q&&(U.size>0?n().createElement(u.Tooltip,{align:"bottom",label:e("refundInProgress","A refund is already in progress for one or more line items")},n().createElement(u.Button,{kind:"tertiary",onClick:O,disabled:!0},e("requestRefund","Request refund"))):n().createElement(u.Button,{kind:"tertiary",onClick:O},e("requestRefund","Request refund"))),b?.status===_.ih.PENDING&&n().createElement(n().Fragment,null,n().createElement(u.Button,{kind:"ghost",renderIcon:h.OM,onClick:()=>(0,c.launchWorkspace2)("billing-form-workspace",{patientUuid:s,billUuid:b.uuid,onMutate:C})},e("addItemsToBill","Add items to bill")),n().createElement(u.Button,{kind:"danger--ghost",onClick:()=>{let e=(0,c.showModal)("delete-bill-confirmation-modal",{bill:b,onSuccess:()=>(0,c.navigate)({to:window.getOpenmrsSpaBase()+"home/billing"}),closeModal:()=>e()})}},e("deleteBill","Delete bill")),n().createElement(u.Button,{kind:"primary",onClick:K},e("finalizeBill","Finalize bill"))),n().createElement(u.Button,{disabled:N||m||p,onClick:Q,renderIcon:e=>n().createElement(g.xj,{size:24,...e}),iconDescription:e("printBill","Print bill")},e("printBill","Print bill")),b&&(b.status===_.ih.PAID||b.tenderedAmount>0)&&n().createElement(L,{billUuid:b.uuid})),n().createElement("div",{className:"-esm-billing__invoice__detailsContainer___93jPh"},n().createElement("section",{className:"-esm-billing__invoice__details___zIHv7"},Object.entries(ee).map(([e,t])=>n().createElement(J,{key:e,label:e,value:t})))),n().createElement("div",{className:"-esm-billing__invoice__invoiceContent___Yd6Pt"},n().createElement(T.A,{bill:b,isLoadingBill:p,onMutate:C}),b&&n().createElement(j,{bill:b}),b&&n().createElement(G,{bill:b,onMutate:C}),n().createElement(M,{bill:b,mutate:C,onFinalizeBill:K})),b&&o&&n().createElement("div",{className:"-esm-billing__invoice__printContainer___9D3HY"},n().createElement(V,{bill:b,patient:o,defaultFacility:t,componentRef:D})))},K=()=>{let e=window.getOpenmrsSpaBase()+"home/billing";return n().createElement(i.BrowserRouter,{basename:e},n().createElement(i.Routes,null,n().createElement(i.Route,{path:"/",element:n().createElement(y,null)}),n().createElement(i.Route,{path:"/patient/:patientUuid/:billUuid",element:n().createElement(X,null)})))}}}]);
|