1 |
wilde |
6 |
#! /usr/bin/python |
2 |
wilde |
19 |
# -*- coding: iso-8859-1 -*- |
3 |
wilde |
6 |
# -------------------------------------------------------------------- |
4 |
|
|
# Lohnsteuer und Sozialabgaben Rechner |
5 |
|
|
# $Id$ |
6 |
|
|
# -------------------------------------------------------------------- |
7 |
|
|
# |
8 |
wilde |
51 |
# Copyright (c) 2005,2006 by Intevation GmbH |
9 |
wilde |
6 |
# Authors: |
10 |
|
|
# Sascha Wilde <[email protected]> |
11 |
|
|
# |
12 |
|
|
# This program is free software under the GPL (>=v2) |
13 |
|
|
# Read the file COPYING coming with this package for details. |
14 |
|
|
|
15 |
wilde |
51 |
"""Lohn/Gehaltsrechner für das Jahr 2006""" |
16 |
wilde |
6 |
|
17 |
wilde |
7 |
__version__ = "$Revision$" |
18 |
|
|
# $Source$ |
19 |
|
|
|
20 |
wilde |
55 |
_release_version = "0.%s" % __version__[11:-2] |
21 |
wilde |
7 |
|
22 |
wilde |
51 |
import LST2006 |
23 |
wilde |
6 |
from Tkinter import * |
24 |
|
|
|
25 |
wilde |
51 |
class Lohnrechner(LST2006.LStRechner2006): |
26 |
wilde |
6 |
|
27 |
|
|
def __init__(self, root): |
28 |
wilde |
51 |
LST2006.LStRechner2006.__init__(self) |
29 |
wilde |
6 |
|
30 |
wilde |
34 |
# Land, Kirchensteuersatz, Pflegeversicherung AG-Anteil |
31 |
|
|
self.laender = [("Baden-Württemberg", 8, 0.0085), |
32 |
|
|
("Bayern", 8, 0.0085), |
33 |
|
|
("Berlin", 9, 0.0085), |
34 |
|
|
("Brandenburg", 9, 0.0085), |
35 |
|
|
("Bremen", 9, 0.0085), |
36 |
|
|
("Bremerhaven", 9, 0.0085), |
37 |
|
|
("Hamburg", 9, 0.0085), |
38 |
|
|
("Hessen", 9, 0.0085), |
39 |
|
|
("Mecklenburg-Vorpommern", 9, 0.0085), |
40 |
|
|
("Niedersachsen" ,9, 0.0085), |
41 |
|
|
("Nordrhein-Westfalen", 9, 0.0085), |
42 |
|
|
("Rheinland-Pfalz", 9, 0.0085), |
43 |
|
|
("Saarland", 9, 0.0085), |
44 |
|
|
("Sachsen", 9, 0.0135), |
45 |
|
|
("Sachsen-Anhalt", 9, 0.0085), |
46 |
|
|
("Schleswig-Holstein", 9, 0.0085), |
47 |
|
|
("Thüringen", 9, 0.0085)] |
48 |
wilde |
30 |
|
49 |
wilde |
17 |
self.root = root |
50 |
wilde |
7 |
|
51 |
wilde |
51 |
self.root.title("Lohnrechner 2006 - v%s" % _release_version) |
52 |
wilde |
29 |
|
53 |
|
|
self.SetupUI() |
54 |
wilde |
34 |
self.UpdateLand() |
55 |
|
|
self.InitSozv() |
56 |
wilde |
29 |
self.ResetInput() |
57 |
|
|
|
58 |
|
|
def SetupUI(self): |
59 |
|
|
self.root.resizable(NO, NO) |
60 |
|
|
|
61 |
wilde |
33 |
frame = Frame(self.root) |
62 |
wilde |
22 |
frame.grid(padx=10, pady=10) |
63 |
|
|
|
64 |
wilde |
29 |
# Steuern Ein/Ausgabe |
65 |
wilde |
54 |
Label(frame, text="Geburtsjahr:").grid(row=0, sticky=E) |
66 |
|
|
self.geb = Entry(frame) |
67 |
|
|
self.geb.bind("<Return>", self.NewInput) |
68 |
|
|
self.geb.grid(row=0, column=1, sticky=W) |
69 |
|
|
|
70 |
|
|
Label(frame, text="Lohn (monatlich):").grid(row=1, sticky=E) |
71 |
wilde |
22 |
self.lohn = Entry(frame) |
72 |
wilde |
9 |
self.lohn.bind("<Return>", self.NewInput) |
73 |
wilde |
54 |
self.lohn.grid(row=1, column=1, sticky=W) |
74 |
wilde |
6 |
|
75 |
wilde |
54 |
Label(frame, text="Steuerklasse:").grid(row=2, sticky=E) |
76 |
wilde |
21 |
self.stkl = IntVar() |
77 |
wilde |
22 |
stklframe = Frame(frame) |
78 |
wilde |
54 |
stklframe.grid(row=2, column=1, sticky=W) |
79 |
wilde |
21 |
for text, val in [("I", 1), |
80 |
|
|
("II", 2), |
81 |
|
|
("III", 3), |
82 |
|
|
("IV", 4), |
83 |
|
|
("V", 5), |
84 |
|
|
("VI", 6)]: |
85 |
wilde |
6 |
stklradio = Radiobutton(stklframe, text=text, value=val, |
86 |
wilde |
25 |
indicatoron=0, command=self.NewInput, |
87 |
wilde |
6 |
variable=self.stkl) |
88 |
|
|
if text == "I": |
89 |
|
|
stklradio.select() |
90 |
|
|
stklradio.pack(side=LEFT) |
91 |
|
|
|
92 |
wilde |
54 |
Label(frame, text="Kirchensteuer:").grid(row=3, sticky=E) |
93 |
wilde |
22 |
self.kirche = IntVar() |
94 |
wilde |
30 |
Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput, |
95 |
wilde |
54 |
variable=self.kirche).grid(row=3, column=1,sticky=W) |
96 |
wilde |
10 |
|
97 |
wilde |
54 |
Label(frame, text="Kinderfreibetrag:").grid(row=4, sticky=E) |
98 |
wilde |
22 |
self.kfb = Entry(frame) |
99 |
wilde |
19 |
self.kfb.bind("<Return>", self.NewInput) |
100 |
wilde |
54 |
self.kfb.grid(row=4, column=1, sticky=W) |
101 |
wilde |
19 |
|
102 |
wilde |
54 |
Label(frame, text="Bundesland:").grid(row=5, sticky=NE) |
103 |
wilde |
22 |
landframe = Frame(frame) |
104 |
|
|
scrollbar = Scrollbar(landframe, orient=VERTICAL) |
105 |
wilde |
24 |
self.landbox = Listbox(landframe, height=4, selectmode=SINGLE, |
106 |
|
|
yscrollcommand=scrollbar.set) |
107 |
wilde |
22 |
for land in self.laender: |
108 |
wilde |
24 |
self.landbox.insert(END, land[0]) |
109 |
wilde |
25 |
self.landbox.select_set(0) |
110 |
wilde |
24 |
self.landbox.bind("<<ListboxSelect>>", self.NewLandSel) |
111 |
|
|
self.landbox.pack(side=RIGHT, fill=Y) |
112 |
|
|
scrollbar.config(command=self.landbox.yview) |
113 |
wilde |
22 |
scrollbar.pack(side=LEFT, fill=BOTH, expand=1) |
114 |
wilde |
54 |
landframe.grid(row=5, rowspan=4, column=1, sticky=W) |
115 |
wilde |
22 |
|
116 |
|
|
Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
117 |
|
|
self.lst = Entry(frame) |
118 |
wilde |
6 |
self.lst.grid(row=0, column=3, sticky=W) |
119 |
|
|
|
120 |
wilde |
22 |
Label(frame, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E) |
121 |
|
|
self.soli = Entry(frame) |
122 |
wilde |
6 |
self.soli.grid(row=1, column=3, sticky=W) |
123 |
|
|
|
124 |
wilde |
22 |
Label(frame, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
125 |
|
|
self.kist = Entry(frame) |
126 |
wilde |
16 |
self.kist.grid(row=2, column=3, sticky=W) |
127 |
wilde |
10 |
|
128 |
wilde |
25 |
Label(frame, text="Lohn nach Steuern:").grid(row=3, column=2, sticky=E) |
129 |
wilde |
30 |
self.netto1 = Entry(frame) |
130 |
|
|
self.netto1.grid(row=3, column=3, sticky=W) |
131 |
wilde |
25 |
|
132 |
wilde |
30 |
# Sozialversicherung Ein/Ausgabe |
133 |
wilde |
54 |
Label(frame, text="Sozialversicherung:").grid(row=9, sticky=E) |
134 |
wilde |
30 |
self.sozv = IntVar() |
135 |
|
|
sozvradio = Checkbutton(frame, onvalue=1, offvalue=0, |
136 |
|
|
command=self.NewInput, variable=self.sozv) |
137 |
|
|
sozvradio.select() |
138 |
wilde |
54 |
sozvradio.grid(row=9, column=1, sticky=W) |
139 |
wilde |
30 |
|
140 |
wilde |
54 |
Label(frame, text="Krankenkassenbeitrag:").grid(row=10, sticky=E) |
141 |
wilde |
30 |
self.kvsatz = Entry(frame) |
142 |
|
|
self.kvsatz.bind("<Return>", self.NewInput) |
143 |
wilde |
54 |
self.kvsatz.grid(row=10, column=1, sticky=W) |
144 |
wilde |
30 |
|
145 |
wilde |
54 |
Label(frame, text="Krankenkassenzuschlag (0.9%):").grid(row=11, sticky=E) |
146 |
wilde |
42 |
self.kvsoli = IntVar() |
147 |
|
|
kvsoliradio = Checkbutton(frame, onvalue=1, offvalue=0, |
148 |
|
|
command=self.NewInput, variable=self.kvsoli) |
149 |
|
|
kvsoliradio.select() |
150 |
wilde |
54 |
kvsoliradio.grid(row=11, column=1, sticky=W) |
151 |
wilde |
42 |
|
152 |
|
|
|
153 |
wilde |
30 |
Label(frame, text="Rentenversicherung:").grid(row=4, column=2, sticky=E) |
154 |
|
|
self.rv = Entry(frame) |
155 |
|
|
self.rv.grid(row=4, column=3, sticky=W) |
156 |
|
|
|
157 |
|
|
Label(frame, text="Krankenversicherung:").grid(row=5, column=2, sticky=E) |
158 |
|
|
self.kv = Entry(frame) |
159 |
|
|
self.kv.grid(row=5, column=3, sticky=W) |
160 |
|
|
|
161 |
|
|
Label(frame, text="Arbeitslosenversicherung:").grid(row=6, column=2, |
162 |
|
|
sticky=E) |
163 |
|
|
self.av = Entry(frame) |
164 |
|
|
self.av.grid(row=6, column=3, sticky=W) |
165 |
|
|
|
166 |
|
|
Label(frame, text="Pflegeversicherung:").grid(row=7, column=2, sticky=E) |
167 |
|
|
self.pv = Entry(frame) |
168 |
|
|
self.pv.grid(row=7, column=3, sticky=W) |
169 |
|
|
|
170 |
|
|
Label(frame, text="Netto Lohn:").grid(row=8, column=2, sticky=E) |
171 |
|
|
self.netto2 = Entry(frame) |
172 |
|
|
self.netto2.grid(row=8, column=3, sticky=W) |
173 |
|
|
|
174 |
wilde |
29 |
# Allgemeine UI Elemente |
175 |
wilde |
22 |
buttons = Frame(frame) |
176 |
wilde |
54 |
buttons.grid(row=10, column=2, rowspan=2, columnspan=2) |
177 |
wilde |
33 |
Button(buttons, text="Quit", command=self.root.quit).pack(side=LEFT) |
178 |
wilde |
17 |
Button(buttons, text="Info", command=self.Info).pack(side=LEFT) |
179 |
|
|
Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) |
180 |
wilde |
9 |
|
181 |
wilde |
25 |
def NewInput(self, event=0): |
182 |
wilde |
24 |
# Es ist möglich alle Einträge in der Listbox zu deselektieren, |
183 |
|
|
# es ist aber immer genau ein Eintrag aktuell, darum wird er ggf. |
184 |
|
|
# zwangsselektiert: |
185 |
|
|
# FIX ME: eigendlich wäre das ein Fall für ein custom widget! |
186 |
|
|
if len(self.landbox.curselection()) == 0: |
187 |
|
|
self.landbox.select_set(self.land) |
188 |
wilde |
9 |
self.CalcOutput() |
189 |
|
|
|
190 |
wilde |
25 |
def UpdateLand(self): |
191 |
wilde |
24 |
self.land = int(self.landbox.curselection()[0]) |
192 |
|
|
|
193 |
wilde |
25 |
def NewLandSel(self, event=0): |
194 |
|
|
self.UpdateLand() |
195 |
|
|
self.CalcOutput() |
196 |
|
|
|
197 |
wilde |
6 |
def ResetInput(self): |
198 |
wilde |
54 |
self.ResetInputGeb() |
199 |
wilde |
9 |
self.ResetInputLohn() |
200 |
wilde |
23 |
self.ResetInputKfb() |
201 |
wilde |
30 |
self.ResetInputKVsatz() |
202 |
wilde |
29 |
self.NewLandSel() |
203 |
wilde |
9 |
|
204 |
wilde |
54 |
def ResetInputGeb(self): |
205 |
|
|
self.geb.delete(0, END) |
206 |
|
|
self.geb.insert(0, "1964") |
207 |
|
|
|
208 |
wilde |
9 |
def ResetInputLohn(self): |
209 |
|
|
self.lohn.delete(0, END) |
210 |
wilde |
6 |
self.lohn.insert(0, "0") |
211 |
wilde |
10 |
|
212 |
wilde |
19 |
def ResetInputKfb(self): |
213 |
|
|
self.kfb.delete(0, END) |
214 |
|
|
self.kfb.insert(0, "0") |
215 |
|
|
|
216 |
wilde |
30 |
def ResetInputKVsatz(self): |
217 |
|
|
self.kvsatz.delete(0, END) |
218 |
wilde |
42 |
self.kvsatz.insert(0, "13.8") |
219 |
wilde |
30 |
|
220 |
wilde |
6 |
def InitCalc(self): |
221 |
wilde |
9 |
try: |
222 |
|
|
self.SetLohn(float(self.lohn.get())) |
223 |
|
|
except: |
224 |
|
|
self.ResetInputLohn() |
225 |
wilde |
10 |
|
226 |
wilde |
19 |
try: |
227 |
wilde |
54 |
self.SetGeb(int(self.geb.get())) |
228 |
|
|
except: |
229 |
|
|
self.ResetInputGeb() |
230 |
|
|
|
231 |
|
|
try: |
232 |
wilde |
19 |
self.SetKinderfreibetrag(float(self.kfb.get())) |
233 |
|
|
except: |
234 |
|
|
self.ResetInputKfb() |
235 |
|
|
|
236 |
wilde |
30 |
try: |
237 |
|
|
self.SetKV(float(self.kvsatz.get())) |
238 |
|
|
except: |
239 |
|
|
self.ResetInputKVsatz() |
240 |
|
|
|
241 |
wilde |
21 |
self.SetSteuerklasse(self.stkl.get()) |
242 |
wilde |
25 |
self.SetKirchensteuerProzent(self.kirche.get() * |
243 |
|
|
self.laender[self.land][1]) |
244 |
wilde |
6 |
|
245 |
|
|
def CalcOutput(self): |
246 |
|
|
self.InitCalc() |
247 |
|
|
self.Calc() |
248 |
|
|
self.lst.delete(0, END) |
249 |
wilde |
25 |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
250 |
wilde |
6 |
self.soli.delete(0, END) |
251 |
wilde |
25 |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
252 |
wilde |
16 |
self.kist.delete(0, END) |
253 |
wilde |
25 |
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
254 |
wilde |
30 |
netto1 = self.GetLohn() - self.GetLohnsteuer() \ |
255 |
|
|
- self.GetSoli() - self.GetKirchensteuer() |
256 |
|
|
self.netto1.delete(0, END) |
257 |
|
|
self.netto1.insert(0, "%.2f" % netto1) |
258 |
|
|
self.rv.delete(0, END) |
259 |
|
|
self.rv.insert(0, "%.2f" % self.GetRV()) |
260 |
|
|
self.pv.delete(0, END) |
261 |
|
|
self.pv.insert(0, "%.2f" % self.GetPV()) |
262 |
|
|
self.av.delete(0, END) |
263 |
|
|
self.av.insert(0, "%.2f" % self.GetAV()) |
264 |
|
|
self.kv.delete(0, END) |
265 |
|
|
self.kv.insert(0, "%.2f" % self.GetKV()) |
266 |
|
|
netto2 = netto1 - self.GetRV() - self.GetAV() \ |
267 |
|
|
- self.GetPV() - self.GetKV() |
268 |
|
|
self.netto2.delete(0, END) |
269 |
|
|
self.netto2.insert(0, "%.2f" % netto2) |
270 |
wilde |
6 |
|
271 |
wilde |
17 |
def Info(self): |
272 |
|
|
infowin = Toplevel(self.root) |
273 |
|
|
infowin.title("Info") |
274 |
wilde |
51 |
Label(infowin, text="Lohnrechner 2006 v%s" % _release_version, |
275 |
wilde |
17 |
font=("Times", 14, "bold italic")).grid(row=0, pady=20) |
276 |
|
|
Label(infowin, text= |
277 |
wilde |
51 |
"Copyright (C) 2005,2006 Intevation GmbH \n\n\ |
278 |
|
|
Lohnrechner 2006 comes with ABSOLUTELY NO WARRANTY.\n\ |
279 |
wilde |
17 |
This is free software, and you are welcome to redistribute it\n\ |
280 |
|
|
under the terms of the GNU General Public License.\n\ |
281 |
|
|
For more information about these matters, see the file named COPYING.\n\n\ |
282 |
wilde |
51 |
Dieses Programm verwendet LST2006 %s" % LST2006._ModulVersion()).grid(row=1, padx=10) |
283 |
wilde |
17 |
Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10) |
284 |
wilde |
6 |
|
285 |
wilde |
30 |
# |
286 |
|
|
# Funktionen zur Berechnung der Sozialversicherungsbeiträge. |
287 |
|
|
# |
288 |
|
|
# FIX ME: Dieser Teil könnte evl. in ein eigenes Modul ausgelagert werden. |
289 |
|
|
# |
290 |
wilde |
17 |
|
291 |
wilde |
30 |
def InitSozv(self): |
292 |
wilde |
34 |
self.AVsatz = 0.065 / 2 |
293 |
|
|
self.RVsatz = 0.195 / 2 |
294 |
|
|
# PVsatz ist in self.laender definiert! |
295 |
wilde |
30 |
self.PVkinderlose = 0.0025 |
296 |
wilde |
62 |
self.BMG1 = 3562.5 |
297 |
|
|
self.BMG2 = 5250 |
298 |
wilde |
30 |
|
299 |
|
|
def SetKV(self, value): |
300 |
|
|
assert value >= 0.0 and value <= 100.0, \ |
301 |
|
|
"must be in range 0.0-100.0 (Percent)" |
302 |
|
|
self.KVsatz = (value / 100.0) |
303 |
|
|
|
304 |
|
|
def GetAV(self): |
305 |
|
|
lohn = self.GetLohn() |
306 |
|
|
if lohn > self.BMG2 : lohn = self.BMG2 |
307 |
wilde |
34 |
return round(self.sozv.get() * self.AVsatz * lohn, 2) |
308 |
wilde |
30 |
|
309 |
|
|
def GetRV(self): |
310 |
|
|
lohn = self.GetLohn() |
311 |
|
|
if lohn > self.BMG2 : lohn = self.BMG2 |
312 |
wilde |
34 |
return round(self.sozv.get() * self.RVsatz * lohn, 2) |
313 |
wilde |
30 |
|
314 |
|
|
def GetPV(self): |
315 |
wilde |
34 |
self.PVsatz = self.laender[self.land][2] |
316 |
wilde |
30 |
lohn = self.GetLohn() |
317 |
|
|
if lohn > self.BMG1 : lohn = self.BMG1 |
318 |
wilde |
34 |
PV = self.PVsatz * lohn |
319 |
wilde |
30 |
if float(self.kfb.get()) == 0.0 : |
320 |
|
|
PV += lohn * self.PVkinderlose |
321 |
|
|
return round(self.sozv.get() * PV, 2) |
322 |
|
|
|
323 |
|
|
def GetKV(self): |
324 |
wilde |
42 |
self.KVsoli = self.kvsoli.get() |
325 |
wilde |
30 |
lohn = self.GetLohn() |
326 |
|
|
if lohn > self.BMG1 : lohn = self.BMG1 |
327 |
wilde |
41 |
if self.KVsoli : |
328 |
wilde |
38 |
return round(self.sozv.get() * ((self.KVsatz / 2) + 0.009) * lohn, 2) |
329 |
|
|
else : |
330 |
|
|
return round(self.sozv.get() * self.KVsatz * lohn / 2, 2) |
331 |
wilde |
30 |
|
332 |
|
|
|
333 |
wilde |
6 |
if __name__ == "__main__": |
334 |
|
|
root = Tk() |
335 |
|
|
lr = Lohnrechner(root) |
336 |
|
|
root.mainloop() |