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 |
|
|
self.kirche = Entry(root) |
55 |
|
|
self.kirche.bind("<Return>", self.NewInput) |
56 |
|
|
self.kirche.grid(row=2, column=1, sticky=W) |
57 |
|
|
|
58 |
wilde |
6 |
self.ResetInput() |
59 |
|
|
|
60 |
|
|
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
61 |
|
|
self.lst = Entry(root) |
62 |
|
|
self.lst.grid(row=0, column=3, sticky=W) |
63 |
|
|
|
64 |
wilde |
12 |
Label(root, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E) |
65 |
wilde |
6 |
self.soli = Entry(root) |
66 |
|
|
self.soli.grid(row=1, column=3, sticky=W) |
67 |
|
|
|
68 |
wilde |
10 |
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
69 |
|
|
self.kirchest = Entry(root) |
70 |
|
|
self.kirchest.grid(row=2, column=3, sticky=W) |
71 |
|
|
|
72 |
wilde |
6 |
self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) |
73 |
|
|
self.calcbutton.grid(row=3, columnspan=4) |
74 |
|
|
|
75 |
|
|
self.CalcOutput() |
76 |
wilde |
9 |
|
77 |
|
|
def NewInput(self, event): |
78 |
|
|
self.CalcOutput() |
79 |
|
|
|
80 |
wilde |
6 |
def ResetInput(self): |
81 |
wilde |
9 |
self.ResetInputLohn() |
82 |
wilde |
10 |
self.ResetInputKirche() |
83 |
wilde |
9 |
|
84 |
|
|
def ResetInputLohn(self): |
85 |
|
|
self.lohn.delete(0, END) |
86 |
wilde |
6 |
self.lohn.insert(0, "0") |
87 |
wilde |
10 |
|
88 |
|
|
def ResetInputKirche(self): |
89 |
|
|
self.kirche.delete(0, END) |
90 |
|
|
self.kirche.insert(0, "0") |
91 |
|
|
|
92 |
wilde |
6 |
def InitCalc(self): |
93 |
wilde |
9 |
try: |
94 |
|
|
self.SetLohn(float(self.lohn.get())) |
95 |
|
|
except: |
96 |
|
|
self.ResetInputLohn() |
97 |
wilde |
10 |
|
98 |
|
|
try: |
99 |
|
|
self.SetKirchensteuer(float(self.kirche.get())) |
100 |
|
|
except: |
101 |
|
|
self.ResetInputKirche() |
102 |
wilde |
9 |
|
103 |
wilde |
6 |
self.SetSteuerklasse(int(self.stkl.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 |
wilde |
10 |
self.kirchest.delete(0, END) |
113 |
|
|
self.kirchest.insert(0, "%.2f" % self.GetKirchensteuer()) |
114 |
wilde |
6 |
|
115 |
|
|
|
116 |
|
|
if __name__ == "__main__": |
117 |
|
|
root = Tk() |
118 |
|
|
lr = Lohnrechner(root) |
119 |
|
|
root.mainloop() |
120 |
|
|
|