+
+
+
+
+
+
+ {({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (
+
+
+
+
+ {headers.map((header) => (
+
+ {header.header}
+
+ ))}
+
+
+
+ {rows.map((row) => (
+
+ {row.cells.map((cell) =>
+ cell.info.header !== 'actions' ? (
+ {cell.value}
+ ) : (
+
+
+ {
+ const selected = paymentModes.find((p) => p.uuid === row.id);
+ setSelectedPaymentMode(selected);
+ setIsDeleteModalOpen(true);
+ }}
+ />
+
+
+ ),
+ )}
+
+ ))}
+
+
+
+ )}
+
+
+
+
+ {/* Modal for Adding New Payment Mode */}
+
setIsModalOpen(false)}
+ onRequestSubmit={handleSubmit(onSubmit)}
+ primaryButtonText={t('save', 'Save')}
+ secondaryButtonText={t('cancel', 'Cancel')}
+ isPrimaryButtonDisabled={isSubmitting}>
+
+
+
+ {/* Modal for Deleting Payment Mode */}
+
setIsDeleteModalOpen(false)}
+ onRequestSubmit={handleDelete}
+ primaryButtonText={t('delete', 'Delete')}
+ secondaryButtonText={t('cancel', 'Cancel')}
+ primaryButtonDanger
+ danger>
+ {t('confirmDeleteMessage', 'Are you sure you want to delete this payment mode? Proceed cautiously.')}
+
+
+ );
+};
+
+export default PaymentModesConfig;
diff --git a/src/billable-services/payyment-modes/payment-modes-config.scss b/src/billable-services/payyment-modes/payment-modes-config.scss
new file mode 100644
index 0000000..6b7efc4
--- /dev/null
+++ b/src/billable-services/payyment-modes/payment-modes-config.scss
@@ -0,0 +1,23 @@
+@use '@carbon/layout';
+@use '@carbon/type';
+@use '@openmrs/esm-styleguide/src/vars' as *;
+
+.container {
+ padding: layout.$spacing-05;
+}
+
+.card {
+ width: 100%;
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: layout.$spacing-05;
+}
+
+.historyContainer {
+ margin-top: layout.$spacing-05;
+}
+
+.table {
+ width: 100%;
+ table-layout: auto;
+}
\ No newline at end of file
diff --git a/translations/en.json b/translations/en.json
index cc60651..0e3dfdb 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -2,8 +2,10 @@
"actions": "Actions",
"addBill": "Add bill item(s)",
"addBillableServices": "Add Billable Services",
+ "addCashPoint": "Add Cash Point",
"addNewBillableService": "Add new billable service",
"addNewService": "Add new service",
+ "addPaymentMode": "Add Payment Mode",
"addPaymentOptions": "Add payment option",
"amount": "Amount",
"amountDue": "Amount Due",
@@ -18,6 +20,7 @@
"billing": "Billing",
"billingForm": "Billing form",
"billingHistory": "Billing History",
+ "billingSettings": "Billing Settings",
"billItem": "Bill item",
"billItems": "Bill Items",
"billLineItemEmpty": "This bill has no line items",
@@ -34,13 +37,28 @@
"billWaiverError": "Bill waiver failed {{error}}",
"billWaiverSuccess": "Bill waiver successful",
"cancel": "Cancel",
+ "cashPointConfig": "Cash Point Config",
+ "cashPointHistory": "Cash Point History",
+ "cashPointLocation": "Cash Point Location",
+ "cashPointName": "Cash Point Name",
+ "cashPointNamePlaceholder": "e.g., Pharmacy Cash Point",
+ "cashPointSaved": "Cash point was successfully saved.",
+ "cashPointUuid": "Cash Point UUID",
+ "cashPointUuidPlaceholder": "Enter UUID",
"checkFilters": "Check the filters above",
"clearSearchInput": "Clear search input",
"clientBalance": "Client Balance",
+ "confirmDeleteMessage": "Are you sure you want to delete this payment mode? Proceed cautiously.",
"createdSuccessfully": "Billable service created successfully",
"currentPrice": "Current price",
+ "delete": "Delete",
+ "deletePaymentMode": "Delete Payment Mode",
+ "description": "Description",
+ "descriptionPlaceholder": "e.g., Used for all cash transactions",
"discard": "Discard",
"discount": "Discount",
+ "duplicateCashPointError": "A cash point with the same name or UUID already exists. Please use a unique name and UUID.",
+ "duplicatePaymentModeError": "A payment mode with the same name already exists. Please create another payment mode",
"editBillableService": "Edit billable service",
"editBillableServices": "Edit Billable Services",
"editBillLineItem": "Edit bill line item?",
@@ -49,8 +67,14 @@
"enterConcept": "Associated concept",
"enterReferenceNumber": "Enter ref. number",
"error": "Error",
+ "errorDeletingPaymentMode": "An error occurred while deleting the payment mode.",
+ "errorFetchingCashPoints": "An error occurred while fetching cash points.",
+ "errorFetchingLocations": "An error occurred while fetching locations.",
+ "errorFetchingPaymentModes": "An error occurred while fetching payment modes.",
"errorLoadingBillServices": "Error loading bill services",
"errorLoadingPaymentModes": "Payment modes error",
+ "errorSavingCashPoint": "An error occurred while saving the cash point.",
+ "errorSavingPaymentMode": "An error occurred while saving the payment mode.",
"filterBy": "Filter by",
"filterTable": "Filter table",
"grandTotal": "Grand total",
@@ -68,6 +92,7 @@
"loading": "Loading data...",
"loadingBillingServices": "Loading billing services...",
"loadingDescription": "Loading",
+ "location": "Select Location",
"manageBillableServices": "Manage billable services",
"name": "Name",
"nextPage": "Next page",
@@ -87,6 +112,12 @@
"paymentMethod": "Payment method",
"paymentMethods": "Payment methods",
"paymentMode": "Payment Mode",
+ "paymentModeDeleted": "Payment mode was successfully deleted.",
+ "paymentModeHistory": "Payment Mode History",
+ "paymentModeName": "Payment Mode Name",
+ "paymentModeNamePlaceholder": "e.g., Cash, Credit Card",
+ "paymentModeSaved": "Payment mode was successfully saved.",
+ "paymentModesConfig": "Payment Modes Config",
"payments": "Payments",
"pleaseRequiredFields": "Please fill all required fields",
"policyNumber": "Policy number",
@@ -127,11 +158,13 @@
"status": "Service Status",
"stockItem": "Stock Item",
"submitting": "Submitting...",
+ "success": "Success",
"total": "Total",
"totalAmount": "Total Amount",
"totalTendered": "Total Tendered",
"unitPrice": "Unit price",
"updatedSuccessfully": "Billable service updated successfully",
+ "uuid": "UUID",
"visitTime": "Visit time",
"waiverForm": "Waiver form"
}