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 |
self.ResetInput() |
54 |
|
55 |
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
56 |
self.lst = Entry(root) |
57 |
self.lst.grid(row=0, column=3, sticky=W) |
58 |
|
59 |
Label(root, text="Lolidaritätszuschlag:").grid(row=1, column=2, sticky=E) |
60 |
self.soli = Entry(root) |
61 |
self.soli.grid(row=1, column=3, sticky=W) |
62 |
|
63 |
self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) |
64 |
self.calcbutton.grid(row=3, columnspan=4) |
65 |
|
66 |
self.CalcOutput() |
67 |
|
68 |
def NewInput(self, event): |
69 |
self.CalcOutput() |
70 |
|
71 |
def ResetInput(self): |
72 |
self.ResetInputLohn() |
73 |
|
74 |
def ResetInputLohn(self): |
75 |
self.lohn.delete(0, END) |
76 |
self.lohn.insert(0, "0") |
77 |
|
78 |
def InitCalc(self): |
79 |
try: |
80 |
self.SetLohn(float(self.lohn.get())) |
81 |
except: |
82 |
self.ResetInputLohn() |
83 |
|
84 |
self.SetSteuerklasse(int(self.stkl.get())) |
85 |
|
86 |
def CalcOutput(self): |
87 |
self.InitCalc() |
88 |
self.Calc() |
89 |
self.lst.delete(0, END) |
90 |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
91 |
self.soli.delete(0, END) |
92 |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
93 |
|
94 |
|
95 |
if __name__ == "__main__": |
96 |
root = Tk() |
97 |
lr = Lohnrechner(root) |
98 |
root.mainloop() |
99 |
|