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

Contents of /trunk/RCS/lohnrechner.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Thu Jan 13 09:42:47 2005 UTC (20 years, 3 months ago) by wilde
File MIME type: text/x-python
File size: 2508 byte(s)
Initial revision

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 import LST2005
17 from Tkinter import *
18
19 class Lohnrechner(LST2005.LStRechner2005):
20
21 def __init__(self, root):
22 LST2005.LStRechner2005.__init__(self)
23
24 Label(root, text="Lohn:").grid(row=0, sticky=E)
25 self.lohn = Entry(root)
26 self.lohn.grid(row=0, column=1, sticky=W)
27
28 Label(root, text="Steuerklasse:").grid(row=1, sticky=E)
29 self.stkl = StringVar()
30 stklframe = Frame(root)
31 stklframe.grid(row=1, column=1, sticky=W)
32 for text, val in [("I", "1"),
33 ("II", "2"),
34 ("III", "3"),
35 ("IV", "4"),
36 ("V", "5"),
37 ("VI", "6")]:
38 stklradio = Radiobutton(stklframe, text=text, value=val,
39 indicatoron=0,
40 variable=self.stkl)
41 if text == "I":
42 stklradio.select()
43 stklradio.pack(side=LEFT)
44
45 self.ResetInput()
46
47 Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
48 self.lst = Entry(root)
49 self.lst.grid(row=0, column=3, sticky=W)
50
51 Label(root, text="Lolidaritätszuschlag:").grid(row=1, column=2, sticky=E)
52 self.soli = Entry(root)
53 self.soli.grid(row=1, column=3, sticky=W)
54
55 self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)
56 self.calcbutton.grid(row=3, columnspan=4)
57
58 self.CalcOutput()
59
60
61 def ResetInput(self):
62 self.lohn.insert(0, "0")
63
64 def InitCalc(self):
65 self.SetLohn(float(self.lohn.get()))
66 self.SetSteuerklasse(int(self.stkl.get()))
67
68 def CalcOutput(self):
69 self.InitCalc()
70 self.Calc()
71 self.lst.delete(0, END)
72 self.lst.insert(0, "%.2f" % self.GetLohnsteuer())
73 self.soli.delete(0, END)
74 self.soli.insert(0, "%.2f" % self.GetSoli())
75
76
77
78 if __name__ == "__main__":
79 root = Tk()
80 lr = Lohnrechner(root)
81 root.mainloop()
82

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