30 |
|
|
31 |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
32 |
self.lohn = Entry(root) |
self.lohn = Entry(root) |
33 |
|
self.lohn.bind("<Return>", self.NewInput) |
34 |
self.lohn.grid(row=0, column=1, sticky=W) |
self.lohn.grid(row=0, column=1, sticky=W) |
35 |
|
|
36 |
Label(root, text="Steuerklasse:").grid(row=1, sticky=E) |
Label(root, text="Steuerklasse:").grid(row=1, sticky=E) |
44 |
("V", "5"), |
("V", "5"), |
45 |
("VI", "6")]: |
("VI", "6")]: |
46 |
stklradio = Radiobutton(stklframe, text=text, value=val, |
stklradio = Radiobutton(stklframe, text=text, value=val, |
47 |
indicatoron=0, |
indicatoron=0, command=self.CalcOutput, |
48 |
variable=self.stkl) |
variable=self.stkl) |
49 |
if text == "I": |
if text == "I": |
50 |
stklradio.select() |
stklradio.select() |
51 |
stklradio.pack(side=LEFT) |
stklradio.pack(side=LEFT) |
52 |
|
|
53 |
|
Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E) |
54 |
|
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 |
|
|
67 |
self.ResetInput() |
self.ResetInput() |
68 |
|
|
69 |
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) |
70 |
self.lst = Entry(root) |
self.lst = Entry(root) |
71 |
self.lst.grid(row=0, column=3, sticky=W) |
self.lst.grid(row=0, column=3, sticky=W) |
72 |
|
|
73 |
Label(root, text="Lolidarit�tszuschlag:").grid(row=1, column=2, sticky=E) |
Label(root, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E) |
74 |
self.soli = Entry(root) |
self.soli = Entry(root) |
75 |
self.soli.grid(row=1, column=3, sticky=W) |
self.soli.grid(row=1, column=3, sticky=W) |
76 |
|
|
77 |
|
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
78 |
|
self.kist = Entry(root) |
79 |
|
self.kist.grid(row=2, column=3, sticky=W) |
80 |
|
|
81 |
self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) |
self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) |
82 |
self.calcbutton.grid(row=3, columnspan=4) |
self.calcbutton.grid(row=3, columnspan=4) |
83 |
|
|
84 |
self.CalcOutput() |
self.CalcOutput() |
85 |
|
|
86 |
|
def NewInput(self, event): |
87 |
|
self.CalcOutput() |
88 |
|
|
89 |
def ResetInput(self): |
def ResetInput(self): |
90 |
|
self.ResetInputLohn() |
91 |
|
|
92 |
|
def ResetInputLohn(self): |
93 |
|
self.lohn.delete(0, END) |
94 |
self.lohn.insert(0, "0") |
self.lohn.insert(0, "0") |
95 |
|
|
96 |
def InitCalc(self): |
def InitCalc(self): |
97 |
self.SetLohn(float(self.lohn.get())) |
try: |
98 |
|
self.SetLohn(float(self.lohn.get())) |
99 |
|
except: |
100 |
|
self.ResetInputLohn() |
101 |
|
|
102 |
self.SetSteuerklasse(int(self.stkl.get())) |
self.SetSteuerklasse(int(self.stkl.get())) |
103 |
|
self.SetKirchensteuer(int(self.kirche.get())) |
104 |
|
|
105 |
def CalcOutput(self): |
def CalcOutput(self): |
106 |
self.InitCalc() |
self.InitCalc() |
109 |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
110 |
self.soli.delete(0, END) |
self.soli.delete(0, END) |
111 |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
112 |
|
self.kist.delete(0, END) |
113 |
|
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
114 |
|
|
115 |
|
|
116 |
if __name__ == "__main__": |
if __name__ == "__main__": |