27 |
LST2005.LStRechner2005.__init__(self) |
LST2005.LStRechner2005.__init__(self) |
28 |
|
|
29 |
root.title("Lohnrechner 2005 - v%s" % _release_version) |
root.title("Lohnrechner 2005 - v%s" % _release_version) |
30 |
|
root.resizable(NO, NO) |
31 |
|
self.root = root |
32 |
|
|
33 |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
Label(root, text="Lohn:").grid(row=0, sticky=E) |
34 |
self.lohn = Entry(root) |
self.lohn = Entry(root) |
53 |
stklradio.pack(side=LEFT) |
stklradio.pack(side=LEFT) |
54 |
|
|
55 |
Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E) |
Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E) |
56 |
self.kirche = Entry(root) |
self.kirche = StringVar() |
57 |
self.kirche.bind("<Return>", self.NewInput) |
kircheframe = Frame(root) |
58 |
self.kirche.grid(row=2, column=1, sticky=W) |
kircheframe.grid(row=2, column=1, sticky=W) |
59 |
|
for text, val in [("keine", "0"), |
60 |
|
("8 %", "8"), |
61 |
|
("9 %", "9")]: |
62 |
|
kircheradio = Radiobutton(kircheframe, text=text, value=val, |
63 |
|
indicatoron=0, command=self.CalcOutput, |
64 |
|
variable=self.kirche) |
65 |
|
if val == "0": |
66 |
|
kircheradio.select() |
67 |
|
kircheradio.pack(side=LEFT) |
68 |
|
|
69 |
self.ResetInput() |
self.ResetInput() |
70 |
|
|
77 |
self.soli.grid(row=1, column=3, sticky=W) |
self.soli.grid(row=1, column=3, sticky=W) |
78 |
|
|
79 |
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E) |
80 |
self.kirchest = Entry(root) |
self.kist = Entry(root) |
81 |
self.kirchest.grid(row=2, column=3, sticky=W) |
self.kist.grid(row=2, column=3, sticky=W) |
82 |
|
|
83 |
self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) |
buttons = Frame() |
84 |
self.calcbutton.grid(row=3, columnspan=4) |
buttons.grid(row=3, columnspan=4) |
85 |
|
Button(buttons, text="Quit", command=root.quit).pack(side=LEFT) |
86 |
|
Button(buttons, text="Info", command=self.Info).pack(side=LEFT) |
87 |
|
Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) |
88 |
|
|
89 |
self.CalcOutput() |
self.CalcOutput() |
90 |
|
|
93 |
|
|
94 |
def ResetInput(self): |
def ResetInput(self): |
95 |
self.ResetInputLohn() |
self.ResetInputLohn() |
|
self.ResetInputKirche() |
|
96 |
|
|
97 |
def ResetInputLohn(self): |
def ResetInputLohn(self): |
98 |
self.lohn.delete(0, END) |
self.lohn.delete(0, END) |
99 |
self.lohn.insert(0, "0") |
self.lohn.insert(0, "0") |
100 |
|
|
|
def ResetInputKirche(self): |
|
|
self.kirche.delete(0, END) |
|
|
self.kirche.insert(0, "0") |
|
|
|
|
101 |
def InitCalc(self): |
def InitCalc(self): |
102 |
try: |
try: |
103 |
self.SetLohn(float(self.lohn.get())) |
self.SetLohn(float(self.lohn.get())) |
104 |
except: |
except: |
105 |
self.ResetInputLohn() |
self.ResetInputLohn() |
106 |
|
|
|
try: |
|
|
self.SetKirchensteuer(float(self.kirche.get())) |
|
|
except: |
|
|
self.ResetInputKirche() |
|
|
|
|
107 |
self.SetSteuerklasse(int(self.stkl.get())) |
self.SetSteuerklasse(int(self.stkl.get())) |
108 |
|
self.SetKirchensteuer(int(self.kirche.get())) |
109 |
|
|
110 |
def CalcOutput(self): |
def CalcOutput(self): |
111 |
self.InitCalc() |
self.InitCalc() |
114 |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) |
115 |
self.soli.delete(0, END) |
self.soli.delete(0, END) |
116 |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
self.soli.insert(0, "%.2f" % self.GetSoli()) |
117 |
self.kirchest.delete(0, END) |
self.kist.delete(0, END) |
118 |
self.kirchest.insert(0, "%.2f" % self.GetKirchensteuer()) |
self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) |
119 |
|
|
120 |
|
def Info(self): |
121 |
|
infowin = Toplevel(self.root) |
122 |
|
infowin.title("Info") |
123 |
|
Label(infowin, text="Lohnrechner 2005 %s" % _release_version, |
124 |
|
font=("Times", 14, "bold italic")).grid(row=0, pady=20) |
125 |
|
Label(infowin, text= |
126 |
|
"Copyright (C) 2005 Intevation GmbH \n\n\ |
127 |
|
Lohnrechner 2005 comes with ABSOLUTELY NO WARRANTY.\n\ |
128 |
|
This is free software, and you are welcome to redistribute it\n\ |
129 |
|
under the terms of the GNU General Public License.\n\ |
130 |
|
For more information about these matters, see the file named COPYING.\n\n\ |
131 |
|
Dieses Programm verwendet LST2005 %s" % LST2005._ModulVersion()).grid(row=1, padx=10) |
132 |
|
Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10) |
133 |
|
|
134 |
|
|
135 |
if __name__ == "__main__": |
if __name__ == "__main__": |