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

Annotation of /trunk/lohnrechner2007.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (hide annotations)
Fri Jan 14 11:50:38 2005 UTC (20 years, 3 months ago) by wilde
Original Path: trunk/RCS/lohnrechner.py
File MIME type: text/x-python
File size: 5271 byte(s)
Versions Status auf beta gesetzt
Variablen Typ f�r STKL Widget auf tk.VarInt umgestellt

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

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