Skip to content

Commit

Permalink
update src/main/java/org/isf/accounting/gui/PatientBillEdit.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudFofou committed Nov 20, 2024
1 parent bc799e2 commit 76bb882
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/main/java/org/isf/accounting/gui/PatientBillEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -846,21 +846,21 @@ 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 -> {
if (thisBill.getBillPatient() != null) {
// BILL
thisBill.setBillPatient(null);
thisBill.setIsPatient(false);
thisBill.setPatName(""); //$NON-NLS-1$
thisBill.setAdmission(null);
// INTERFACE
jTextFieldPatient.setText("");
jTextFieldPatient.setEditable(false);
jButtonPickPatient.setText(MessageBundle.getMessage("angal.newbill.findpatient.btn"));
jButtonPickPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.associateapatientwiththisbill.tooltip"));
} else {
MessageDialog.info(null, MessageBundle.getMessage("angal.newbill.pleasefindpatientbeforeremotehim.msg"));
}
// BILL
thisBill.setBillPatient(null);
thisBill.setIsPatient(false);
thisBill.setPatName(""); //$NON-NLS-1$
thisBill.setAdmission(null);
// INTERFACE
jTextFieldPatient.setText("");
jTextFieldPatient.setEditable(false);
jButtonPickPatient.setText(MessageBundle.getMessage("angal.newbill.findpatient.btn"));
jButtonPickPatient.setToolTipText(MessageBundle.getMessage("angal.newbill.associateapatientwiththisbill.tooltip"));
jButtonTrashPatient.setEnabled(false);
});
}
return jButtonTrashPatient;
Expand Down Expand Up @@ -898,6 +898,7 @@ 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"));
jButtonTrashPatient.setEnabled(true);
}
}

Expand Down

0 comments on commit 76bb882

Please sign in to comment.