/[lohnrechner]/trunk/lohnrechner2007.py
ViewVC logotype

Contents of /trunk/lohnrechner2007.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (show annotations)
Thu Jan 13 13:01:58 2005 UTC (20 years, 3 months ago) by wilde
Original Path: trunk/RCS/lohnrechner.py
File MIME type: text/x-python
File size: 3875 byte(s)
Kirchensteuer zu Radiobuttons gemacht

1 #! /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 __version__ = "$Revision$"
17 # $Source$
18
19 _release_version = "0.1alpha"
20
21 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 root.title("Lohnrechner 2005 - v%s" % _release_version)
30
31 Label(root, text="Lohn:").grid(row=0, sticky=E)
32 self.lohn = Entry(root)
33 self.lohn.bind("<Return>", self.NewInput)
34 self.lohn.grid(row=0, column=1, sticky=W)
35
36 Label(root, text="Steuerklasse:").grid(row=1, sticky=E)
37 self.stkl = StringVar()
38 stklframe = Frame(root)
39 stklframe.grid(row=1, column=1, sticky=W)
40 for text, val in [("I", "1"),
41 ("II", "2"),
42 ("III", "3"),
43 ("IV", "4"),
44 ("V", "5"),
45 ("VI", "6")]:
46 stklradio = Radiobutton(stklframe, text=text, value=val,
47 indicatoron=0, command=self.CalcOutput,
48 variable=self.stkl)
49 if text == "I":
50 stklradio.select()
51 stklradio.pack(side=LEFT)
52
53 Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)
54 self.kirche = StringVar()
55 kircheframe = Frame(root)
56 kircheframe.grid(row=2, column=1, sticky=W)
57 for text, val in [("keine", "0"),
58 ("8 %", "8"),
59 ("9 %", "9")]:
60 kircheradio = Radiobutton(kircheframe, text=text, value=val,
61 indicatoron=0, command=self.CalcOutput,
62 variable=self.kirche)
63 if val == "0":
64 kircheradio.select()
65 kircheradio.pack(side=LEFT)
66
67 self.ResetInput()
68
69 Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
70 self.lst = Entry(root)
71 self.lst.grid(row=0, column=3, sticky=W)
72
73 Label(root, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E)
74 self.soli = Entry(root)
75 self.soli.grid(row=1, column=3, sticky=W)
76
77 Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
78 self.kist = Entry(root)
79 self.kist.grid(row=2, column=3, sticky=W)
80
81 self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)
82 self.calcbutton.grid(row=3, columnspan=4)
83
84 self.CalcOutput()
85
86 def NewInput(self, event):
87 self.CalcOutput()
88
89 def ResetInput(self):
90 self.ResetInputLohn()
91
92 def ResetInputLohn(self):
93 self.lohn.delete(0, END)
94 self.lohn.insert(0, "0")
95
96 def InitCalc(self):
97 try:
98 self.SetLohn(float(self.lohn.get()))
99 except:
100 self.ResetInputLohn()
101
102 self.SetSteuerklasse(int(self.stkl.get()))
103 self.SetKirchensteuer(int(self.kirche.get()))
104
105 def CalcOutput(self):
106 self.InitCalc()
107 self.Calc()
108 self.lst.delete(0, END)
109 self.lst.insert(0, "%.2f" % self.GetLohnsteuer())
110 self.soli.delete(0, END)
111 self.soli.insert(0, "%.2f" % self.GetSoli())
112 self.kist.delete(0, END)
113 self.kist.insert(0, "%.2f" % self.GetKirchensteuer())
114
115
116 if __name__ == "__main__":
117 root = Tk()
118 lr = Lohnrechner(root)
119 root.mainloop()
120

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26