Skip to content

Commit

Permalink
[26167] remove billing service reference from adjuster
Browse files Browse the repository at this point in the history
  • Loading branch information
huthomas authored and col-panic committed Apr 4, 2024
1 parent e0ccaf6 commit 5da50d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0" name="at.medevit.ch.artikelstamm.ui.internal.GenericTypeOriginalAdjuster">
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="at.medevit.ch.artikelstamm.ui.internal.GenericTypeOriginalAdjuster">
<service>
<provide interface="ch.elexis.core.services.IBilledAdjuster"/>
</service>
<reference cardinality="1..1" field="billingService" interface="ch.elexis.core.services.IBillingService" name="billingService"/>
<implementation class="at.medevit.ch.artikelstamm.ui.internal.GenericTypeOriginalAdjuster"/>
</scr:component>
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import at.medevit.ch.artikelstamm.IArtikelstammItem;
import at.medevit.ch.artikelstamm.model.common.preference.PreferenceConstants;
import ch.elexis.core.model.IBillable;
import ch.elexis.core.model.IBilled;
import ch.elexis.core.model.verrechnet.Constants;
import ch.elexis.core.services.IBilledAdjuster;
import ch.elexis.core.services.IBillingService;
import ch.elexis.core.services.holder.BillingServiceHolder;
import ch.elexis.core.services.holder.ConfigServiceHolder;
import ch.elexis.core.services.holder.CoreModelServiceHolder;

@Component
public class GenericTypeOriginalAdjuster implements IBilledAdjuster {

@Reference
private IBillingService billingService;

@Override
public void adjust(IBilled billed) {
if (ConfigServiceHolder.get().get(PreferenceConstants.PREF_SHOW_WARN_ORIGINAL_ARTICLES, false)) {
Expand All @@ -45,7 +41,7 @@ public void adjust(IBilled billed) {
billed.setExtInfo(Constants.FLD_EXT_ORIGINALNOSUBSTITUTE, "true"); //$NON-NLS-1$
CoreModelServiceHolder.get().save(billed);
} else if (answer == 2) {
billingService.removeBilled(billed, billed.getEncounter());
BillingServiceHolder.get().removeBilled(billed, billed.getEncounter());
}
});
}
Expand Down

0 comments on commit 5da50d2

Please sign in to comment.