Skip to content

Commit 8baae96

Browse files
committed
[28416] check before access to side and bezug on ArzttarifDetailDialog
1 parent 562f9d2 commit 8baae96

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

bundles/ch.elexis.base.ch.arzttarife/src/ch/elexis/views/ArzttarifDetailDialog.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,19 +342,23 @@ public void create() {
342342
@Override
343343
protected void okPressed() {
344344
if (isArzttarif(billable)) {
345-
int idx = cSide.getSelectionIndex();
346-
if (idx < 1) {
347-
billed.setExtInfo(Constants.FLD_EXT_SIDE, null);
348-
} else if (idx == 1) {
349-
billed.setExtInfo(Constants.FLD_EXT_SIDE, Constants.SIDE_L);
350-
} else {
351-
billed.setExtInfo(Constants.FLD_EXT_SIDE, Constants.SIDE_R);
345+
if (requiresSide(billed.getBillable())) {
346+
int idx = cSide.getSelectionIndex();
347+
if (idx < 1) {
348+
billed.setExtInfo(Constants.FLD_EXT_SIDE, null);
349+
} else if (idx == 1) {
350+
billed.setExtInfo(Constants.FLD_EXT_SIDE, Constants.SIDE_L);
351+
} else {
352+
billed.setExtInfo(Constants.FLD_EXT_SIDE, Constants.SIDE_R);
353+
}
352354
}
353-
if (selectedBezug.isNoBezug) {
354-
billed.setExtInfo(Constants.FLD_EXT_REALTION, StringUtils.EMPTY);
355-
} else {
356-
billed.setExtInfo(Constants.FLD_EXT_REALTION, selectedBezug.getCode());
357-
billed.setExtInfo(Constants.FLD_EXT_REALTION_ID, selectedBezug.getId());
355+
if (selectedBezug != null) {
356+
if (selectedBezug.isNoBezug) {
357+
billed.setExtInfo(Constants.FLD_EXT_REALTION, StringUtils.EMPTY);
358+
} else {
359+
billed.setExtInfo(Constants.FLD_EXT_REALTION, selectedBezug.getCode());
360+
billed.setExtInfo(Constants.FLD_EXT_REALTION_ID, selectedBezug.getId());
361+
}
358362
}
359363

360364
if (bFranchiseFree.getSelection()) {

0 commit comments

Comments
 (0)