27 |
def __init__(self, root): |
def __init__(self, root): |
28 |
LST2005.LStRechner2005.__init__(self) |
LST2005.LStRechner2005.__init__(self) |
29 |
|
|
30 |
|
# Land, Kirchensteuersatz |
31 |
|
self.laender = [("Baden-W�rttemberg", 8), |
32 |
|
("Bayern", 8), |
33 |
|
("Berlin", 9), |
34 |
|
("Brandenburg", 9), |
35 |
|
("Bremen", 9), |
36 |
|
("Bremerhaven", 9), |
37 |
|
("Hamburg", 9), |
38 |
|
("Hessen", 9), |
39 |
|
("Mecklenburg-Vorpommern", 9), |
40 |
|
("Niedersachsen" ,9), |
41 |
|
("Nordrhein-Westfalen", 9), |
42 |
|
("Rheinland-Pfalz", 9), |
43 |
|
("Saarland", 9), |
44 |
|
("Sachsen", 9), |
45 |
|
("Sachsen-Anhalt", 9), |
46 |
|
("Schleswig-Holstein", 9), |
47 |
|
("Th�ringen", 9)] |
48 |
|
|
49 |
root.title("Lohnrechner 2005 - v%s" % _release_version) |
root.title("Lohnrechner 2005 - v%s" % _release_version) |
50 |
root.resizable(NO, NO) |
root.resizable(NO, NO) |
51 |
self.root = root |
self.root = root |
52 |
|
|
53 |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
frame = Frame(root) |
54 |
self.lohn = Entry(root) |
frame.grid(padx=10, pady=10) |
55 |
|
|
56 |
|
Label(frame, text="Lohn:").grid(row=0, sticky=E) |
57 |
|
self.lohn = Entry(frame) |
58 |
self.lohn.bind("<Return>", self.NewInput) |
self.lohn.bind("<Return>", self.NewInput) |
59 |
self.lohn.grid(row=0, column=1, sticky=W) |
self.lohn.grid(row=0, column=1, sticky=W) |
60 |
|
|
61 |
Label(root, text="Steuerklasse:").grid(row=1, sticky=E) |
Label(frame, text="Steuerklasse:").grid(row=1, sticky=E) |
62 |
self.stkl = IntVar() |
self.stkl = IntVar() |
63 |
stklframe = Frame(root) |
stklframe = Frame(frame) |
64 |
stklframe.grid(row=1, column=1, sticky=W) |
stklframe.grid(row=1, column=1, sticky=W) |
65 |
for text, val in [("I", 1), |
for text, val in [("I", 1), |
66 |
("II", 2), |
("II", 2), |
69 |
("V", 5), |
("V", 5), |
70 |
("VI", 6)]: |
("VI", 6)]: |
71 |
stklradio = Radiobutton(stklframe, text=text, value=val, |
stklradio = Radiobutton(stklframe, text=text, value=val, |
72 |
indicatoron=0, command=self.CalcOutput, |
indicatoron=0, command=self.NewInput, |
73 |
variable=self.stkl) |
variable=self.stkl) |
74 |
if text == "I": |
if text == "I": |
75 |
stklradio.select() |
stklradio.select() |
76 |
stklradio.pack(side=LEFT) |
stklradio.pack(side=LEFT) |
77 |
|
|
78 |
Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E) |
Label(frame, text="Kirchensteuer:").grid(row=2, sticky=E) |
79 |
self.kirche = StringVar() |
self.kirche = IntVar() |
80 |
kircheframe = Frame(root) |
kircheradio = Checkbutton(frame, onvalue=1, offvalue=0, |
81 |
kircheframe.grid(row=2, column=1, sticky=W) |
command=self.NewInput, |
82 |
for text, val in [("keine", "0"), |
variable=self.kirche).grid(row=2, column=1, sticky=W) |
|
("8 %", "8"), |
|
|
("9 %", "9")]: |
|
|
kircheradio = Radiobutton(kircheframe, text=text, value=val, |
|
|
indicatoron=0, command=self.CalcOutput, |
|
|
variable=self.kirche) |
|
|
if val == "0": |
|
|
kircheradio.select() |
|
|
kircheradio.pack(side=LEFT) |
|
83 |
|
|
84 |
Label(root, text="Kinderfreibetrag:").grid(row=3, sticky=E) |
Label(frame, text="Kinderfreibetrag:").grid(row=3, sticky=E) |
85 |
self.kfb = Entry(root) |
self.kfb = Entry(frame) |
86 |
self.kfb.bind("<Return>", self.NewInput) |
self.kfb.bind("<Return>", self.NewInput) |
87 |
self.kfb.grid(row=3, column=1, sticky=W) |
self.kfb.grid(row=3, column=1, sticky=W) |
88 |
|
|
89 |
|
Label(frame, text="Bundesland:").grid(row=4, sticky=E) |
90 |
|
landframe = Frame(frame) |
91 |
|
scrollbar = Scrollbar(landframe, orient=VERTICAL) |
92 |
|
self.landbox = Listbox(landframe, height=4, selectmode=SINGLE, |
93 |
|
yscrollcommand=scrollbar.set) |
94 |
|
for land in self.laender: |
95 |
|
self.landbox.insert(END, land[0]) |
96 |
|
self.landbox.select_set(0) |
97 |
|
self.landbox.bind("<<ListboxSelect>>", self.NewLandSel) |
98 |
|
self.landbox.pack(side=RIGHT, fill=Y) |
99 |
|
scrollbar.config(command=self.landbox.yview) |
100 |
|
scrollbar.pack(side=LEFT, fill=BOTH, expand=1) |
101 |
|
landframe.grid(row=4, column=1, sticky=W) |
102 |
|
self.UpdateLand() |
103 |
|
|
104 |
self.ResetInput() |
self.ResetInput() |
105 |
|
|
106 |
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
107 |
self.lst = Entry(root) |
self.lst = Entry(frame) |
108 |
self.lst.grid(row=0, column=3, sticky=W) |
self.lst.grid(row=0, column=3, sticky=W) |
109 |
|
|
110 |
Label(root, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E) |
Label(frame, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E) |
111 |
self.soli = Entry(root) |
self.soli = Entry(frame) |
112 |
self.soli.grid(row=1, column=3, sticky=W) |
self.soli.grid(row=1, column=3, sticky=W) |
113 |
|
|
114 |
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
Label(frame, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
115 |
self.kist = Entry(root) |
self.kist = Entry(frame) |
116 |
self.kist.grid(row=2, column=3, sticky=W) |
self.kist.grid(row=2, column=3, sticky=W) |
117 |
|
|
118 |
buttons = Frame() |
Label(frame, text="Lohn nach Steuern:").grid(row=3, column=2, sticky=E) |
119 |
buttons.grid(row=4, columnspan=4) |
self.netto = Entry(frame) |
120 |
|
self.netto.grid(row=3, column=3, sticky=W) |
121 |
|
|
122 |
|
buttons = Frame(frame) |
123 |
|
buttons.grid(row=4, column=2, columnspan=2) |
124 |
Button(buttons, text="Quit", command=root.quit).pack(side=LEFT) |
Button(buttons, text="Quit", command=root.quit).pack(side=LEFT) |
125 |
Button(buttons, text="Info", command=self.Info).pack(side=LEFT) |
Button(buttons, text="Info", command=self.Info).pack(side=LEFT) |
126 |
Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) |
Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) |
127 |
|
|
128 |
|
self.NewInput() |
129 |
|
|
130 |
|
def NewInput(self, event=0): |
131 |
|
# Es ist m�glich alle Eintr�ge in der Listbox zu deselektieren, |
132 |
|
# es ist aber immer genau ein Eintrag aktuell, darum wird er ggf. |
133 |
|
# zwangsselektiert: |
134 |
|
# FIX ME: eigendlich w�re das ein Fall f�r ein custom widget! |
135 |
|
if len(self.landbox.curselection()) == 0: |
136 |
|
self.landbox.select_set(self.land) |
137 |
self.CalcOutput() |
self.CalcOutput() |
138 |
|
|
139 |
def NewInput(self, event): |
def UpdateLand(self): |
140 |
|
self.land = int(self.landbox.curselection()[0]) |
141 |
|
|
142 |
|
def NewLandSel(self, event=0): |
143 |
|
self.UpdateLand() |
144 |
self.CalcOutput() |
self.CalcOutput() |
145 |
|
|
146 |
def ResetInput(self): |
def ResetInput(self): |
147 |
self.ResetInputLohn() |
self.ResetInputLohn() |
148 |
|
self.ResetInputKfb() |
149 |
|
|
150 |
def ResetInputLohn(self): |
def ResetInputLohn(self): |
151 |
self.lohn.delete(0, END) |
self.lohn.delete(0, END) |
167 |
self.ResetInputKfb() |
self.ResetInputKfb() |
168 |
|
|
169 |
self.SetSteuerklasse(self.stkl.get()) |
self.SetSteuerklasse(self.stkl.get()) |
170 |
self.SetKirchensteuer(int(self.kirche.get())) |
self.SetKirchensteuerProzent(self.kirche.get() * |
171 |
|
self.laender[self.land][1]) |
172 |
|
|
173 |
def CalcOutput(self): |
def CalcOutput(self): |
174 |
self.InitCalc() |
self.InitCalc() |
175 |
self.Calc() |
self.Calc() |
176 |
self.lst.delete(0, END) |
self.lst.delete(0, END) |
177 |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
178 |
self.soli.delete(0, END) |
self.soli.delete(0, END) |
179 |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
180 |
self.kist.delete(0, END) |
self.kist.delete(0, END) |
181 |
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
182 |
|
self.netto.delete(0, END) |
183 |
|
self.netto.insert(0, "%.2f" % |
184 |
|
(self.GetLohn() - self.GetLohnsteuer() |
185 |
|
- self.GetSoli() - self.GetKirchensteuer())) |
186 |
|
|
187 |
def Info(self): |
def Info(self): |
188 |
infowin = Toplevel(self.root) |
infowin = Toplevel(self.root) |