diff --git a/src/main/java/org/isf/accounting/gui/PatientBillEdit.java b/src/main/java/org/isf/accounting/gui/PatientBillEdit.java index 4923780d49..23349004c3 100644 --- a/src/main/java/org/isf/accounting/gui/PatientBillEdit.java +++ b/src/main/java/org/isf/accounting/gui/PatientBillEdit.java @@ -845,11 +845,13 @@ private JButton getJButtonTrashPatient() { jButtonTrashPatient.setPreferredSize(new Dimension(25, 25)); jButtonTrashPatient.setIcon(new ImageIcon("rsc/icons/remove_patient_button.png")); jButtonTrashPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.removethepatientassociatedwiththisbill.tooltip")); + if (thisBill.getBillPatient() == null) { + jButtonTrashPatient.setEnabled(false); + } jButtonTrashPatient.addActionListener(actionEvent -> { // BILL thisBill.setBillPatient(null); thisBill.setIsPatient(false); - thisBill.getBillPatient().setCode(0); thisBill.setPatName(""); //$NON-NLS-1$ thisBill.setAdmission(null); // INTERFACE @@ -895,6 +897,9 @@ private void setJButtonPickPatient() { jButtonPickPatient.setText(MessageBundle.getMessage("angal.newbill.changepatient.btn")); jButtonPickPatient.setMnemonic(MessageBundle.getMnemonic("angal.newbill.changepatient.btn.key")); jButtonPickPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.changethepatientassociatedwiththisbill.tooltip")); + if (jButtonTrashPatient != null) { + jButtonTrashPatient.setEnabled(true); + } } } diff --git a/src/main/java/org/isf/medicalstockward/gui/WardPharmacy.java b/src/main/java/org/isf/medicalstockward/gui/WardPharmacy.java index 5c50678441..587ad2a2d0 100644 --- a/src/main/java/org/isf/medicalstockward/gui/WardPharmacy.java +++ b/src/main/java/org/isf/medicalstockward/gui/WardPharmacy.java @@ -1461,8 +1461,8 @@ class DrugsModel extends DefaultTableModel { public DrugsModel() { try { - tableModel = movWardBrowserManager.getMedicalsWardTotalQuantity(wardSelected.getCode().charAt(0)); - wardDrugs = movWardBrowserManager.getMedicalsWard(wardSelected.getCode().charAt(0), true); + tableModel = movWardBrowserManager.getMedicalsWardTotalQuantity(wardSelected.getCode()); + wardDrugs = movWardBrowserManager.getMedicalsWard(wardSelected.getCode(), true); } catch (OHServiceException e) { OHServiceExceptionUtil.showMessages(e); tableModel = new ArrayList<>(); diff --git a/src/main/java/org/isf/medicalstockward/gui/WardPharmacyRectify.java b/src/main/java/org/isf/medicalstockward/gui/WardPharmacyRectify.java index 194ade63bb..7264a6f36e 100644 --- a/src/main/java/org/isf/medicalstockward/gui/WardPharmacyRectify.java +++ b/src/main/java/org/isf/medicalstockward/gui/WardPharmacyRectify.java @@ -162,7 +162,7 @@ public WardPharmacyRectify(JFrame owner, Ward ward) { super(owner, true); selectedWard = ward; try { - wardDrugs = movWardBrowserManager.getMedicalsWard(selectedWard.getCode().charAt(0), false); + wardDrugs = movWardBrowserManager.getMedicalsWard(selectedWard.getCode(), false); } catch (OHServiceException e) { OHServiceExceptionUtil.showMessages(e); } @@ -184,7 +184,7 @@ public WardPharmacyRectify(JFrame owner, Ward ward, Medical medical) { super(owner, true); selectedWard = ward; try { - wardDrugs = movWardBrowserManager.getMedicalsWard(selectedWard.getCode().charAt(0), false); + wardDrugs = movWardBrowserManager.getMedicalsWard(selectedWard.getCode(), false); } catch (OHServiceException e) { OHServiceExceptionUtil.showMessages(e); }