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

(feat) : added a refund option to the bill manager. #296

Merged
merged 11 commits into from
Aug 7, 2024
Prev Previous commit
Next Next commit
feat: credit amount header
amosmachora committed Aug 5, 2024
commit a7a89002b426a8ff29e05fd7d73a02de15edc34a
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@ export const RefundBillModal: React.FC<{
lineItems: [lineItemToBeRefunded],
payments: bill.payments,
patient: bill.patientUuid,
// status: bill.status,
status: 'REFUNDED',
status: bill.status,
};

setIsLoading(true);
Original file line number Diff line number Diff line change
@@ -34,14 +34,22 @@ const PatientBills: React.FC<PatientBillsProps> = ({ bills }) => {
const tableHeaders = [
{ header: 'Date', key: 'date' },
{ header: 'Billable Service', key: 'billableService' },
{ header: 'Status', key: 'status' },
{ header: 'Credit Amount', key: 'creditAmount' },
{ header: 'Total Amount', key: 'totalAmount' },
];

console.log('bills', bills);

const tableRows = bills.map((bill) => ({
id: `${bill.uuid}`,
date: bill.dateCreated,
billableService: extractString(bill.billingService),
totalAmount: convertToCurrency(bill.totalAmount),
status: bill.status,
creditAmount: convertToCurrency(
bill.lineItems.filter((li) => Math.sign(li.price) === -1).reduce((acc, curr) => acc + Math.abs(curr.price), 0),
),
}));

const handleOpenWaiveBillWorkspace = (bill: MappedBill) => {