Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mittelverwendung #566

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
67 changes: 51 additions & 16 deletions src/de/jost_net/JVerein/gui/control/KontoControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import de.jost_net.JVerein.keys.Kontoart;
import de.jost_net.JVerein.keys.StatusBuchungsart;
import de.jost_net.JVerein.keys.AfaMode;
import de.jost_net.JVerein.keys.Anlagenzweck;
import de.jost_net.JVerein.keys.ArtBuchungsart;
import de.jost_net.JVerein.rmi.Buchung;
import de.jost_net.JVerein.rmi.Buchungsart;
Expand Down Expand Up @@ -94,37 +95,39 @@ public class KontoControl extends AbstractControl
private SelectInput hibiscusid;

private Konto konto;

private SelectInput buchungsart;

private SelectInput kontoart;

private int unterdrueckunglaenge = 0;

private AbstractInput anlagenart;

private SelectInput anlagenklasse;

private AbstractInput afaart;

private DecimalInput betrag;

private IntegerNullInput nutzungsdauer;

private TextAreaInput kommentar;

private DateInput anschaffung;

private DecimalInput afastart;

private DecimalInput afadauer;

private DecimalInput afarestwert;

private SelectInput afamode;


private SelectInput anlagenzweck;

Button autobutton;

Button afabutton;


Expand Down Expand Up @@ -278,6 +281,10 @@ public void handleStore()
{
k.setAfaMode(Integer.valueOf(((AfaMode) getAfaMode().getValue()).getKey()));
}
if (anlagenzweck != null)
{
k.setAnlagenzweck((Anlagenzweck) getAnlagenzweck().getValue());
}
DBService service = Einstellungen.getDBService();
String sql = "SELECT DISTINCT konto.id from konto "
+ "WHERE (kontoart = ?) ";
Expand Down Expand Up @@ -893,6 +900,24 @@ public void handleEvent (Event e) {
}
return afamode;
}

public SelectInput getAnlagenzweck() throws RemoteException
{
if (anlagenzweck != null)
{
return anlagenzweck;
}
Anlagenzweck zweck = getKonto().getAnlagenzweck();
ArrayList<Anlagenzweck> values = new ArrayList<Anlagenzweck>(
Arrays.asList(Anlagenzweck.values()));
anlagenzweck = new SelectInput(values, zweck);
if (getKontoArt().getValue() != Kontoart.ANLAGE)
{
anlagenzweck.setValue(Anlagenzweck.NUTZUNGSGEBUNDEN);
anlagenzweck.disable();
}
return anlagenzweck;
}

public String getBuchungartSortOrder()
{
Expand Down Expand Up @@ -994,6 +1019,11 @@ public void refreshGui()
getAfaMode().setValue(new AfaMode(AfaMode.AUTO));
getAfaMode().setMandatory(true);
getAfaMode().setEnabled(true);
if (anlagenzweck != null)
{
anlagenzweck.enable();
anlagenzweck.setValue(getKonto().getAnlagenzweck());
}
}
else
{
Expand Down Expand Up @@ -1025,6 +1055,11 @@ public void refreshGui()
getAfaMode().setMandatory(false);
getAfaMode().setValue(null);
getAfaMode().disable();
if (anlagenzweck != null)
{
anlagenzweck.setValue(Anlagenzweck.NUTZUNGSGEBUNDEN);
anlagenzweck.disable();
}
}
}
catch (RemoteException e)
Expand Down
Loading
Loading