Skip to content
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
13 changes: 11 additions & 2 deletions src/main/java/com/divudi/bean/pharmacy/AmpController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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());
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/divudi/bean/pharmacy/PharmacySaleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/pharmacy/admin/amp.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/pharmacy/pharmacy_bill_retail_sale_1.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@

<p:commandButton icon="fas fa-file-invoice" value="Sale 1" action="pharmacy_bill_retail_sale?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController.pharmacyRetailSale()}" />
<p:commandButton icon="fas fa-file-invoice" disabled="true" value="Sale 2" action="pharmacy_bill_retail_sale_1?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController1.pharmacyRetailSale()}" />
<p:commandButton icon="fas fa-file-invoice" value="Sale 3" action="pharmacy_bill_retail_sale_2?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController12.pharmacyRetailSale()}" />
<p:commandButton icon="fas fa-file-invoice" value="Sale 4" action="pharmacy_bill_retail_sale_3?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController13.pharmacyRetailSale()}" />
<p:commandButton icon="fas fa-file-invoice" value="Sale 3" action="/pharmacy/pharmacy_bill_retail_sale_2?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController2.pharmacyRetailSale()}" />
<p:commandButton icon="fas fa-file-invoice" value="Sale 4" action="pharmacy_bill_retail_sale_3?faces-redirect=true" rendered="#{webUserController.hasPrivilege('PharmacySale')}" actionListener="#{pharmacySaleController3.pharmacyRetailSale()}" />


</div>
Expand Down