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

Annotation of /trunk/lohnrechner2006.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide 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 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     _release_version = "0.1alpha"
20    
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    
31 wilde 6 Label(root, text="Lohn:").grid(row=0, sticky=E)
32     self.lohn = Entry(root)
33 wilde 9 self.lohn.bind("<Return>", self.NewInput)
34 wilde 6 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 wilde 9 indicatoron=0, command=self.CalcOutput,
48 wilde 6 variable=self.stkl)
49     if text == "I":
50     stklradio.select()
51     stklradio.pack(side=LEFT)
52    
53 wilde 10 Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)
54 wilde 16 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 wilde 10
67 wilde 6 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 wilde 12 Label(root, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E)
74 wilde 6 self.soli = Entry(root)
75     self.soli.grid(row=1, column=3, sticky=W)
76    
77 wilde 10 Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
78 wilde 16 self.kist = Entry(root)
79     self.kist.grid(row=2, column=3, sticky=W)
80 wilde 10
81 wilde 6 self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)
82     self.calcbutton.grid(row=3, columnspan=4)
83    
84     self.CalcOutput()
85 wilde 9
86     def NewInput(self, event):
87     self.CalcOutput()
88    
89 wilde 6 def ResetInput(self):
90 wilde 9 self.ResetInputLohn()
91    
92     def ResetInputLohn(self):
93     self.lohn.delete(0, END)
94 wilde 6 self.lohn.insert(0, "0")
95 wilde 10
96 wilde 6 def InitCalc(self):
97 wilde 9 try:
98     self.SetLohn(float(self.lohn.get()))
99     except:
100     self.ResetInputLohn()
101 wilde 10
102 wilde 6 self.SetSteuerklasse(int(self.stkl.get()))
103 wilde 16 self.SetKirchensteuer(int(self.kirche.get()))
104 wilde 6
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 wilde 16 self.kist.delete(0, END)
113     self.kist.insert(0, "%.2f" % self.GetKirchensteuer())
114 wilde 6
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