Added Schulden Support and everything else
parent
21e30978ce
commit
e2cd80c677
|
@ -123,7 +123,7 @@ public class framecreater implements ActionListener {
|
|||
vorlage.setBounds(10+(80*(counter%4)),100+(100*(counter/4)),80,100 );
|
||||
vorlage.addActionListener(e -> {
|
||||
frame.dispose();
|
||||
profilframe();
|
||||
onmedienclick(m);
|
||||
});
|
||||
return vorlage;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ public class framecreater implements ActionListener {
|
|||
panel.add(nummer);
|
||||
|
||||
//text feld
|
||||
JLabel schulden=new JLabel("Schulden: "+k.getSchulden());
|
||||
JLabel schulden=new JLabel("Schulden: "+k.getSchulden()+"€");
|
||||
schulden.setBounds( 10,30,200,25);
|
||||
panel.add(schulden);
|
||||
|
||||
|
@ -306,7 +306,6 @@ public class framecreater implements ActionListener {
|
|||
schuldenzuruck.setBounds(170,30,80,25);
|
||||
schuldenzuruck.addActionListener( e -> {
|
||||
if(!schuldenabezahlen.contains(k))schuldenabezahlen.add(k);
|
||||
profilframe();
|
||||
});
|
||||
panel.add(schuldenzuruck);
|
||||
|
||||
|
@ -350,6 +349,15 @@ public class framecreater implements ActionListener {
|
|||
Startframe();
|
||||
});
|
||||
panel.add(abmelden);
|
||||
|
||||
//admin schulden erlass knopf
|
||||
JButton admin=new JButton("Gebüren Verbuchen");
|
||||
admin.setBounds(170,725,200,25);
|
||||
admin.addActionListener(e -> {
|
||||
frame.dispose();
|
||||
adminclick();
|
||||
});
|
||||
if(getAngemeldeterbenuter()==0)panel.add(admin);
|
||||
}
|
||||
|
||||
public static void onmedienclick(Medien m){
|
||||
|
@ -413,13 +421,50 @@ public class framecreater implements ActionListener {
|
|||
m.setAusgeliehen(-1);
|
||||
schuldenberechnung(m,kundenliste.get(getAngemeldeterbenuter()));
|
||||
kundenliste.get(getAngemeldeterbenuter()).getAusgeliehen().remove(m);
|
||||
Startframe();
|
||||
profilframe();
|
||||
});
|
||||
if(m.getAusgeliehen()<0 && getAngemeldeterbenuter()>=0)panel.add(ausleiehen);
|
||||
if(m.getAusgeliehen()>=0 && m.getAusgeliehen()==getAngemeldeterbenuter())panel.add(zuruckgeben);
|
||||
|
||||
}
|
||||
|
||||
public static void adminclick(){
|
||||
//frame
|
||||
JFrame frame=new JFrame("Gebüren Verbuchen");
|
||||
JPanel panel=new JPanel();
|
||||
frame.setSize(300,100+(schuldenabezahlen.size()*30));
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
frame.add(panel);
|
||||
panel.setLayout(null);
|
||||
|
||||
schuldenabezahlen.forEach(k -> {
|
||||
//info feld
|
||||
JLabel kunde=new JLabel("Nr: "+k.getnummer()+" Schulden: "+k.getSchulden()+"€");
|
||||
kunde.setBounds(10,schuldenabezahlen.indexOf(k)*25,200,25);
|
||||
panel.add(kunde);
|
||||
|
||||
//admin schulden erlass knopf
|
||||
JButton admin=new JButton("Bezahlt");
|
||||
admin.setBounds(200,schuldenabezahlen.indexOf(k)*25,80,25);
|
||||
admin.addActionListener(e -> {
|
||||
frame.dispose();
|
||||
k.setSchulden(0.0);
|
||||
schuldenabezahlen.remove(k);
|
||||
adminclick();
|
||||
});
|
||||
panel.add(admin);
|
||||
});
|
||||
//back
|
||||
JButton back=new JButton("Zurück");
|
||||
back.setBounds(10,schuldenabezahlen.size()*25,80,25);
|
||||
back.addActionListener(e -> {
|
||||
frame.dispose();
|
||||
profilframe();
|
||||
});
|
||||
panel.add(back);
|
||||
}
|
||||
|
||||
public static void schuldenberechnung(Medien m, kunden k){
|
||||
LocalDate datenow=getDatum();
|
||||
LocalDate datethen=k.getAusgeliehen().get(m);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue