1 |
wilde |
6 |
#! /usr/bin/python |
2 |
|
|
# -------------------------------------------------------------------- |
3 |
|
|
# Lohnsteuer und Sozialabgaben Rechner |
4 |
|
|
# $Id$ |
5 |
|
|
# -------------------------------------------------------------------- |
6 |
|
|
# |
7 |
|
|
# Copyright (c) 2005 by Intevation GmbH |
8 |
|
|
# Authors: |
9 |
|
|
# Sascha Wilde <[email protected]> |
10 |
|
|
# |
11 |
|
|
# This program is free software under the GPL (>=v2) |
12 |
|
|
# Read the file COPYING coming with this package for details. |
13 |
|
|
|
14 |
|
|
"""Lohn/Gehaltsrechner für das Jahr 2005""" |
15 |
|
|
|
16 |
wilde |
7 |
__version__ = "$Revision$" |
17 |
|
|
# $Source$ |
18 |
|
|
|
19 |
wilde |
18 |
_release_version = "0.%s alpha" % __version__[11:-2] |
20 |
wilde |
7 |
|
21 |
wilde |
6 |
import LST2005 |
22 |
|
|
from Tkinter import * |
23 |
|
|
|
24 |
|
|
class Lohnrechner(LST2005.LStRechner2005): |
25 |
|
|
|
26 |
|
|
def __init__(self, root): |
27 |
|
|
LST2005.LStRechner2005.__init__(self) |
28 |
|
|
|
29 |
wilde |
7 |
root.title("Lohnrechner 2005 - v%s" % _release_version) |
30 |
wilde |
17 |
root.resizable(NO, NO) |
31 |
|
|
self.root = root |
32 |
wilde |
7 |
|
33 |
wilde |
6 |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
34 |
|
|
self.lohn = Entry(root) |
35 |
wilde |
9 |
self.lohn.bind("<Return>", self.NewInput) |
36 |
wilde |
6 |
self.lohn.grid(row=0, column=1, sticky=W) |
37 |
|
|
|
38 |
|
|
Label(root, text="Steuerklasse:").grid(row=1, sticky=E) |
39 |
|
|
self.stkl = StringVar() |
40 |
|
|
stklframe = Frame(root) |
41 |
|
|
stklframe.grid(row=1, column=1, sticky=W) |
42 |
|
|
for text, val in [("I", "1"), |
43 |
|
|
("II", "2"), |
44 |
|
|
("III", "3"), |
45 |
|
|
("IV", "4"), |
46 |
|
|
("V", "5"), |
47 |
|
|
("VI", "6")]: |
48 |
|
|
stklradio = Radiobutton(stklframe, text=text, value=val, |
49 |
wilde |
9 |
indicatoron=0, command=self.CalcOutput, |
50 |
wilde |
6 |
variable=self.stkl) |
51 |
|
|
if text == "I": |
52 |
|
|
stklradio.select() |
53 |
|
|
stklradio.pack(side=LEFT) |
54 |
|
|
|
55 |
wilde |
10 |
Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E) |
56 |
wilde |
16 |
self.kirche = StringVar() |
57 |
|
|
kircheframe = Frame(root) |
58 |
|
|
kircheframe.grid(row=2, column=1, sticky=W) |
59 |
|
|
for text, val in [("keine", "0"), |
60 |
|
|
("8 %", "8"), |
61 |
|
|
("9 %", "9")]: |
62 |
|
|
kircheradio = Radiobutton(kircheframe, text=text, value=val, |
63 |
|
|
indicatoron=0, command=self.CalcOutput, |
64 |
|
|
variable=self.kirche) |
65 |
|
|
if val == "0": |
66 |
|
|
kircheradio.select() |
67 |
|
|
kircheradio.pack(side=LEFT) |
68 |
wilde |
10 |
|
69 |
wilde |
6 |
self.ResetInput() |
70 |
|
|
|
71 |
|
|
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
72 |
|
|
self.lst = Entry(root) |
73 |
|
|
self.lst.grid(row=0, column=3, sticky=W) |
74 |
|
|
|
75 |
wilde |
12 |
Label(root, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E) |
76 |
wilde |
6 |
self.soli = Entry(root) |
77 |
|
|
self.soli.grid(row=1, column=3, sticky=W) |
78 |
|
|
|
79 |
wilde |
10 |
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
80 |
wilde |
16 |
self.kist = Entry(root) |
81 |
|
|
self.kist.grid(row=2, column=3, sticky=W) |
82 |
wilde |
10 |
|
83 |
wilde |
17 |
buttons = Frame() |
84 |
|
|
buttons.grid(row=3, columnspan=4) |
85 |
|
|
Button(buttons, text="Quit", command=root.quit).pack(side=LEFT) |
86 |
|
|
Button(buttons, text="Info", command=self.Info).pack(side=LEFT) |
87 |
|
|
Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) |
88 |
wilde |
6 |
|
89 |
|
|
self.CalcOutput() |
90 |
wilde |
9 |
|
91 |
|
|
def NewInput(self, event): |
92 |
|
|
self.CalcOutput() |
93 |
|
|
|
94 |
wilde |
6 |
def ResetInput(self): |
95 |
wilde |
9 |
self.ResetInputLohn() |
96 |
|
|
|
97 |
|
|
def ResetInputLohn(self): |
98 |
|
|
self.lohn.delete(0, END) |
99 |
wilde |
6 |
self.lohn.insert(0, "0") |
100 |
wilde |
10 |
|
101 |
wilde |
6 |
def InitCalc(self): |
102 |
wilde |
9 |
try: |
103 |
|
|
self.SetLohn(float(self.lohn.get())) |
104 |
|
|
except: |
105 |
|
|
self.ResetInputLohn() |
106 |
wilde |
10 |
|
107 |
wilde |
6 |
self.SetSteuerklasse(int(self.stkl.get())) |
108 |
wilde |
16 |
self.SetKirchensteuer(int(self.kirche.get())) |
109 |
wilde |
6 |
|
110 |
|
|
def CalcOutput(self): |
111 |
|
|
self.InitCalc() |
112 |
|
|
self.Calc() |
113 |
|
|
self.lst.delete(0, END) |
114 |
|
|
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
115 |
|
|
self.soli.delete(0, END) |
116 |
|
|
self.soli.insert(0, "%.2f" % self.GetSoli()) |
117 |
wilde |
16 |
self.kist.delete(0, END) |
118 |
|
|
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
119 |
wilde |
6 |
|
120 |
wilde |
17 |
def Info(self): |
121 |
|
|
infowin = Toplevel(self.root) |
122 |
|
|
infowin.title("Info") |
123 |
wilde |
18 |
Label(infowin, text="Lohnrechner 2005 v%s" % _release_version, |
124 |
wilde |
17 |
font=("Times", 14, "bold italic")).grid(row=0, pady=20) |
125 |
|
|
Label(infowin, text= |
126 |
|
|
"Copyright (C) 2005 Intevation GmbH \n\n\ |
127 |
|
|
Lohnrechner 2005 comes with ABSOLUTELY NO WARRANTY.\n\ |
128 |
|
|
This is free software, and you are welcome to redistribute it\n\ |
129 |
|
|
under the terms of the GNU General Public License.\n\ |
130 |
|
|
For more information about these matters, see the file named COPYING.\n\n\ |
131 |
|
|
Dieses Programm verwendet LST2005 %s" % LST2005._ModulVersion()).grid(row=1, padx=10) |
132 |
|
|
Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10) |
133 |
wilde |
6 |
|
134 |
wilde |
17 |
|
135 |
wilde |
6 |
if __name__ == "__main__": |
136 |
|
|
root = Tk() |
137 |
|
|
lr = Lohnrechner(root) |
138 |
|
|
root.mainloop() |
139 |
|
|
|