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

Diff of /trunk/lohnrechner2006.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by wilde, Thu Jan 13 10:51:19 2005 UTC revision 21 by wilde, Fri Jan 14 11:50:38 2005 UTC
# Line 1  Line 1 
1  #! /usr/bin/python  #! /usr/bin/python
2    # -*- coding: iso-8859-1 -*-
3  # --------------------------------------------------------------------  # --------------------------------------------------------------------
4  # Lohnsteuer und Sozialabgaben Rechner  # Lohnsteuer und Sozialabgaben Rechner
5  # $Id$  # $Id$
# Line 16  Line 17 
17  __version__ = "$Revision$"  __version__ = "$Revision$"
18  # $Source$  # $Source$
19                    
20  _release_version = "0.1alpha"  _release_version = "0.%s beta" % __version__[11:-2]
21    
22  import LST2005  import LST2005
23  from Tkinter import *  from Tkinter import *
# Line 27  class Lohnrechner(LST2005.LStRechner2005 Line 28  class Lohnrechner(LST2005.LStRechner2005
28          LST2005.LStRechner2005.__init__(self)          LST2005.LStRechner2005.__init__(self)
29    
30          root.title("Lohnrechner 2005 - v%s" % _release_version)          root.title("Lohnrechner 2005 - v%s" % _release_version)
31            root.resizable(NO, NO)
32            self.root = root
33    
34          Label(root, text="Lohn:").grid(row=0, sticky=E)          Label(root, text="Lohn:").grid(row=0, sticky=E)
35          self.lohn = Entry(root)          self.lohn = Entry(root)
# Line 34  class Lohnrechner(LST2005.LStRechner2005 Line 37  class Lohnrechner(LST2005.LStRechner2005
37          self.lohn.grid(row=0, column=1, sticky=W)          self.lohn.grid(row=0, column=1, sticky=W)
38    
39          Label(root, text="Steuerklasse:").grid(row=1, sticky=E)          Label(root, text="Steuerklasse:").grid(row=1, sticky=E)
40          self.stkl = StringVar()          self.stkl = IntVar()
41          stklframe = Frame(root)          stklframe = Frame(root)
42          stklframe.grid(row=1, column=1, sticky=W)          stklframe.grid(row=1, column=1, sticky=W)
43          for text, val in [("I", "1"),          for text, val in [("I", 1),
44                            ("II", "2"),                            ("II", 2),
45                            ("III", "3"),                            ("III", 3),
46                            ("IV", "4"),                            ("IV", 4),
47                            ("V", "5"),                            ("V", 5),
48                            ("VI", "6")]:                            ("VI", 6)]:
49              stklradio = Radiobutton(stklframe, text=text, value=val,              stklradio = Radiobutton(stklframe, text=text, value=val,
50                                      indicatoron=0, command=self.CalcOutput,                                      indicatoron=0, command=self.CalcOutput,
51                                      variable=self.stkl)                                      variable=self.stkl)
# Line 51  class Lohnrechner(LST2005.LStRechner2005 Line 54  class Lohnrechner(LST2005.LStRechner2005
54              stklradio.pack(side=LEFT)              stklradio.pack(side=LEFT)
55    
56          Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)          Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)
57          self.kirche = Entry(root)          self.kirche = StringVar()
58          self.kirche.bind("<Return>", self.NewInput)          kircheframe = Frame(root)
59          self.kirche.grid(row=2, column=1, sticky=W)          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    
70            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          self.ResetInput()          self.ResetInput()
76    
# Line 61  class Lohnrechner(LST2005.LStRechner2005 Line 78  class Lohnrechner(LST2005.LStRechner2005
78          self.lst = Entry(root)          self.lst = Entry(root)
79          self.lst.grid(row=0, column=3, sticky=W)          self.lst.grid(row=0, column=3, sticky=W)
80    
81          Label(root, text="Lolidarit�tszuschlag:").grid(row=1, column=2, sticky=E)          Label(root, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E)
82          self.soli = Entry(root)          self.soli = Entry(root)
83          self.soli.grid(row=1, column=3, sticky=W)          self.soli.grid(row=1, column=3, sticky=W)
84    
85          Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)          Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
86          self.kirchest = Entry(root)          self.kist = Entry(root)
87          self.kirchest.grid(row=2, column=3, sticky=W)          self.kist.grid(row=2, column=3, sticky=W)
88    
89          self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)          buttons = Frame()
90          self.calcbutton.grid(row=3, columnspan=4)          buttons.grid(row=4, columnspan=4)
91            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                    
95          self.CalcOutput()          self.CalcOutput()
96    
# Line 79  class Lohnrechner(LST2005.LStRechner2005 Line 99  class Lohnrechner(LST2005.LStRechner2005
99    
100      def ResetInput(self):      def ResetInput(self):
101          self.ResetInputLohn()          self.ResetInputLohn()
         self.ResetInputKirche()  
102    
103      def ResetInputLohn(self):      def ResetInputLohn(self):
104          self.lohn.delete(0, END)          self.lohn.delete(0, END)
105          self.lohn.insert(0, "0")          self.lohn.insert(0, "0")
106    
107      def ResetInputKirche(self):      def ResetInputKfb(self):
108          self.kirche.delete(0, END)          self.kfb.delete(0, END)
109          self.kirche.insert(0, "0")          self.kfb.insert(0, "0")
110    
111      def InitCalc(self):      def InitCalc(self):
112          try:          try:
# Line 96  class Lohnrechner(LST2005.LStRechner2005 Line 115  class Lohnrechner(LST2005.LStRechner2005
115              self.ResetInputLohn()              self.ResetInputLohn()
116    
117          try:          try:
118              self.SetKirchensteuer(float(self.kirche.get()))              self.SetKinderfreibetrag(float(self.kfb.get()))
119          except:          except:
120              self.ResetInputKirche()              self.ResetInputKfb()
121                
122          self.SetSteuerklasse(int(self.stkl.get()))          self.SetSteuerklasse(self.stkl.get())
123            self.SetKirchensteuer(int(self.kirche.get()))
124    
125      def CalcOutput(self):      def CalcOutput(self):
126          self.InitCalc()          self.InitCalc()
# Line 109  class Lohnrechner(LST2005.LStRechner2005 Line 129  class Lohnrechner(LST2005.LStRechner2005
129          self.lst.insert(0, "%.2f" % self.GetLohnsteuer())                  self.lst.insert(0, "%.2f" % self.GetLohnsteuer())        
130          self.soli.delete(0, END)          self.soli.delete(0, END)
131          self.soli.insert(0, "%.2f" % self.GetSoli())                  self.soli.insert(0, "%.2f" % self.GetSoli())        
132          self.kirchest.delete(0, END)          self.kist.delete(0, END)
133          self.kirchest.insert(0, "%.2f" % self.GetKirchensteuer())                  self.kist.insert(0, "%.2f" % self.GetKirchensteuer())        
134    
135        def Info(self):
136            infowin = Toplevel(self.root)
137            infowin.title("Info")
138            Label(infowin, text="Lohnrechner 2005 v%s" % _release_version,
139                  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    
149    
150  if __name__ == "__main__":  if __name__ == "__main__":

Legend:
Removed from v.10  
changed lines
  Added in v.21

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26