diff --git a/src/main/java/com/divudi/bean/pharmacy/AmpController.java b/src/main/java/com/divudi/bean/pharmacy/AmpController.java index fd0fc6c233b..6eb54cc8de3 100644 --- a/src/main/java/com/divudi/bean/pharmacy/AmpController.java +++ b/src/main/java/com/divudi/bean/pharmacy/AmpController.java @@ -655,11 +655,19 @@ private void saveVmp() { public void save() { if (current == null) { - JsfUtil.addErrorMessage("Nothuing selected"); + JsfUtil.addErrorMessage("No AMP is selected"); return; } + + if(current.getId() != null){ + if(!configOptionApplicationController.getBooleanValueByKey("Enable edit and delete AMP from Pharmacy Administration.", false)){ + JsfUtil.addErrorMessage("You have no privilage to edit AMPs."); + return; + } + } + if (current.getName() == null || current.getName().isEmpty()) { - JsfUtil.addErrorMessage("No Name"); + JsfUtil.addErrorMessage("Please add a name to AMP"); return; } @@ -681,6 +689,7 @@ public void save() { JsfUtil.addErrorMessage("No VMP selected"); return; } + if (current.getCategory() == null) { if (current.getVmp().getCategory() != null) { current.setCategory(current.getVmp().getCategory()); diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java b/src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java index a5a7c90ad9e..d2645b409f8 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java @@ -2067,6 +2067,21 @@ public void settlePreBill() { false ); + if (configOptionApplicationController.getBooleanValueByKey("Patient Phone number is mandotary in sale for cashier", true)) { + if (getPatient().getPatientPhoneNumber() == null && getPatient().getPatientMobileNumber() == null) { + JsfUtil.addErrorMessage("Please enter phone number of the patient"); + return; + } else if (getPatient().getId() == null) { + if (getPatient().getPatientPhoneNumber() != null && !(String.valueOf(getPatient().getPatientPhoneNumber()).length() >= 10)) { + JsfUtil.addErrorMessage("Please enter valid phone number with more than 10 digits of the patient"); + return; + } else if (getPatient().getPatientMobileNumber() != null && !(String.valueOf(getPatient().getPatientMobileNumber()).length() >= 10)) { + JsfUtil.addErrorMessage("Please enter valid mobile number with more than 10 digits of the patient"); + return; + } + } + } + Patient pt = null; if (patientRequiredForPharmacySale) { if (getPatient() == null diff --git a/src/main/webapp/pharmacy/admin/amp.xhtml b/src/main/webapp/pharmacy/admin/amp.xhtml index 87b2d7169c4..7383ff31089 100644 --- a/src/main/webapp/pharmacy/admin/amp.xhtml +++ b/src/main/webapp/pharmacy/admin/amp.xhtml @@ -37,6 +37,7 @@ icon="fa fa-trash" onclick="if (!confirm('Are you sure you want to delete this record?')) return false;" action="#{ampController.delete()}" + disabled="#{!configOptionApplicationController.getBooleanValueByKey('Enable edit and delete AMP from Pharmacy Administration.', false)}" value="Delete" update="acAmp gpDetail msg" process="btnDelete" class="m-1 ui-button-danger w-25"> diff --git a/src/main/webapp/pharmacy/pharmacy_bill_retail_sale_1.xhtml b/src/main/webapp/pharmacy/pharmacy_bill_retail_sale_1.xhtml index af06f907e7e..ef0c4292643 100644 --- a/src/main/webapp/pharmacy/pharmacy_bill_retail_sale_1.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_bill_retail_sale_1.xhtml @@ -712,8 +712,8 @@ - - + +