Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/bills status #88

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/esm-billing-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ehospital/esm-billing-app",
"version": "1.0.5",
"version": "1.0.6",
"description": "Billing frontend module for use in O3",
"browser": "dist/ehospital-esm-billing-app.js",
"main": "src/index.ts",
Expand Down Expand Up @@ -120,5 +120,5 @@
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
},
"packageManager": "yarn@4.1.1",
"gitHead": "5423ece3ee2d68371f78ff585003c794a97b9b8a"
"gitHead": "27f80c085bda44314a96269a35c1a13907758a0d"
}
9 changes: 2 additions & 7 deletions packages/esm-billing-app/src/billing.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useBills = (patientUuid: string = '', billStatus: string = '') => {
patientName: bill?.patient?.display.split('-')?.[1],
identifier: bill?.patient?.display.split('-')?.[0],
patientUuid: bill?.patient?.uuid,
status: bill.lineItems.some((item) => item.paymentStatus === 'PENDING') ? 'PENDING' : 'PAID',
status: bill.status,
receiptNumber: bill?.receiptNumber,
cashier: bill?.cashier,
cashPointUuid: bill?.cashPoint?.uuid,
Expand Down Expand Up @@ -66,12 +66,7 @@ export const useBill = (billUuid: string) => {
patientName: bill?.patient?.display.split('-')?.[1],
identifier: bill?.patient?.display.split('-')?.[0],
patientUuid: bill?.patient?.uuid,
status:
bill.lineItems.length > 1
? bill.lineItems.some((item) => item.paymentStatus === 'PENDING')
? 'PENDING'
: 'PAID'
: bill.status,
status: bill.status,
receiptNumber: bill?.receiptNumber,
cashier: bill?.cashier,
cashPointUuid: bill?.cashPoint?.uuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type InvoiceTableProps = {
const InvoiceTable: React.FC<InvoiceTableProps> = ({ bill, isSelectable = true, isLoadingBill, onSelectItem }) => {
const { t } = useTranslation();
const lineItems = bill?.lineItems ?? [];
const status = bill?.status;
const paidLineItems = lineItems?.filter((item) => item.paymentStatus === 'PAID') ?? [];
const layout = useLayoutType();
const responsiveSize = isDesktop(layout) ? 'sm' : 'lg';
Expand Down Expand Up @@ -90,7 +91,7 @@ const InvoiceTable: React.FC<InvoiceTableProps> = ({ bill, isSelectable = true,
id: `${item.uuid}`,
billItem: item.billableService ? item.billableService : item?.item,
billCode: <span data-testid={`receipt-number-${index}`}>{bill?.receiptNumber}</span>,
status: item.paymentStatus,
status: status,
quantity: item.quantity,
price: convertToCurrency(item.price, defaultCurrency),
total: item.price * item.quantity,
Expand Down
Loading