/[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 22 by wilde, Fri Jan 14 13:04:09 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 26  class Lohnrechner(LST2005.LStRechner2005 Line 27  class Lohnrechner(LST2005.LStRechner2005
27      def __init__(self, root):      def __init__(self, root):
28          LST2005.LStRechner2005.__init__(self)          LST2005.LStRechner2005.__init__(self)
29    
30            # Land, Kirchensteuersatz
31            self.laender = [("Baden-W�rttemberg", 8),
32                            ("Bayern", 8),
33                            ("Berlin", 9),
34                            ("Brandenburg", 9),
35                            ("Bremen", 9),
36                            ("Bremerhaven", 9),
37                            ("Hamburg", 9),
38                            ("Hessen", 9),
39                            ("Mecklenburg-Vorpommern", 9),
40                            ("Niedersachsen" ,9),
41                            ("Nordrhein-Westfalen", 9),
42                            ("Rheinland-Pfalz", 9),
43                            ("Saarland", 9),
44                            ("Sachsen", 9),
45                            ("Sachsen-Anhalt", 9),
46                            ("Schleswig-Holstein", 9),
47                            ("Th�ringen", 9)]
48    
49          root.title("Lohnrechner 2005 - v%s" % _release_version)          root.title("Lohnrechner 2005 - v%s" % _release_version)
50            root.resizable(NO, NO)
51            self.root = root
52    
53            frame = Frame(root)
54            frame.grid(padx=10, pady=10)
55    
56          Label(root, text="Lohn:").grid(row=0, sticky=E)          Label(frame, text="Lohn:").grid(row=0, sticky=E)
57          self.lohn = Entry(root)          self.lohn = Entry(frame)
58          self.lohn.bind("<Return>", self.NewInput)          self.lohn.bind("<Return>", self.NewInput)
59          self.lohn.grid(row=0, column=1, sticky=W)          self.lohn.grid(row=0, column=1, sticky=W)
60    
61          Label(root, text="Steuerklasse:").grid(row=1, sticky=E)          Label(frame, text="Steuerklasse:").grid(row=1, sticky=E)
62          self.stkl = StringVar()          self.stkl = IntVar()
63          stklframe = Frame(root)          stklframe = Frame(frame)
64          stklframe.grid(row=1, column=1, sticky=W)          stklframe.grid(row=1, column=1, sticky=W)
65          for text, val in [("I", "1"),          for text, val in [("I", 1),
66                            ("II", "2"),                            ("II", 2),
67                            ("III", "3"),                            ("III", 3),
68                            ("IV", "4"),                            ("IV", 4),
69                            ("V", "5"),                            ("V", 5),
70                            ("VI", "6")]:                            ("VI", 6)]:
71              stklradio = Radiobutton(stklframe, text=text, value=val,              stklradio = Radiobutton(stklframe, text=text, value=val,
72                                      indicatoron=0, command=self.CalcOutput,                                      indicatoron=0, command=self.CalcOutput,
73                                      variable=self.stkl)                                      variable=self.stkl)
# Line 50  class Lohnrechner(LST2005.LStRechner2005 Line 75  class Lohnrechner(LST2005.LStRechner2005
75                  stklradio.select()                  stklradio.select()
76              stklradio.pack(side=LEFT)              stklradio.pack(side=LEFT)
77    
78          Label(root, text="Kirchensteuer (%):").grid(row=2, sticky=E)          Label(frame, text="Kirchensteuer:").grid(row=2, sticky=E)
79          self.kirche = Entry(root)          self.kirche = IntVar()
80          self.kirche.bind("<Return>", self.NewInput)          kircheradio = Checkbutton(frame, onvalue=1, offvalue=0,
81          self.kirche.grid(row=2, column=1, sticky=W)                                    command=self.CalcOutput,
82                                      variable=self.kirche).grid(row=2, column=1, sticky=W)
83    
84            Label(frame, text="Kinderfreibetrag:").grid(row=3, sticky=E)
85            self.kfb = Entry(frame)
86            self.kfb.bind("<Return>", self.NewInput)
87            self.kfb.grid(row=3, column=1, sticky=W)
88    
89            Label(frame, text="Bundesland:").grid(row=4, sticky=E)
90            landframe = Frame(frame)
91            scrollbar = Scrollbar(landframe, orient=VERTICAL)
92            self.land = Listbox(landframe, height=4, selectmode=SINGLE,
93                                yscrollcommand=scrollbar.set)
94            for land in self.laender:
95                self.land.insert(END, land[0])
96            self.land.select_set(0)
97            self.land.bind("<ButtonRelease-1>", self.NewInput)
98            self.land.pack(side=RIGHT, fill=Y)
99            scrollbar.config(command=self.land.yview)
100            scrollbar.pack(side=LEFT, fill=BOTH, expand=1)
101            landframe.grid(row=4, column=1, sticky=W)
102            
103          self.ResetInput()          self.ResetInput()
104    
105          Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)          Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
106          self.lst = Entry(root)          self.lst = Entry(frame)
107          self.lst.grid(row=0, column=3, sticky=W)          self.lst.grid(row=0, column=3, sticky=W)
108    
109          Label(root, text="Lolidarit�tszuschlag:").grid(row=1, column=2, sticky=E)          Label(frame, text="Solidarit�tszuschlag:").grid(row=1, column=2, sticky=E)
110          self.soli = Entry(root)          self.soli = Entry(frame)
111          self.soli.grid(row=1, column=3, sticky=W)          self.soli.grid(row=1, column=3, sticky=W)
112    
113          Label(root, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)          Label(frame, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
114          self.kirchest = Entry(root)          self.kist = Entry(frame)
115          self.kirchest.grid(row=2, column=3, sticky=W)          self.kist.grid(row=2, column=3, sticky=W)
116    
117          self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput)          buttons = Frame(frame)
118          self.calcbutton.grid(row=3, columnspan=4)          buttons.grid(row=4, column=2, columnspan=2)
119            Button(buttons, text="Quit", command=root.quit).pack(side=LEFT)
120            Button(buttons, text="Info", command=self.Info).pack(side=LEFT)
121            Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)
122                    
123          self.CalcOutput()          self.CalcOutput()
124    
# Line 79  class Lohnrechner(LST2005.LStRechner2005 Line 127  class Lohnrechner(LST2005.LStRechner2005
127    
128      def ResetInput(self):      def ResetInput(self):
129          self.ResetInputLohn()          self.ResetInputLohn()
         self.ResetInputKirche()  
130    
131      def ResetInputLohn(self):      def ResetInputLohn(self):
132          self.lohn.delete(0, END)          self.lohn.delete(0, END)
133          self.lohn.insert(0, "0")          self.lohn.insert(0, "0")
134    
135      def ResetInputKirche(self):      def ResetInputKfb(self):
136          self.kirche.delete(0, END)          self.kfb.delete(0, END)
137          self.kirche.insert(0, "0")          self.kfb.insert(0, "0")
138    
139      def InitCalc(self):      def InitCalc(self):
140          try:          try:
# Line 96  class Lohnrechner(LST2005.LStRechner2005 Line 143  class Lohnrechner(LST2005.LStRechner2005
143              self.ResetInputLohn()              self.ResetInputLohn()
144    
145          try:          try:
146              self.SetKirchensteuer(float(self.kirche.get()))              self.SetKinderfreibetrag(float(self.kfb.get()))
147          except:          except:
148              self.ResetInputKirche()              self.ResetInputKfb()
149                
150          self.SetSteuerklasse(int(self.stkl.get()))          self.SetSteuerklasse(self.stkl.get())
151            self.SetKirchensteuer(self.kirche.get() *
152                                  self.laender[int(self.land.curselection()[0])][1])
153    
154      def CalcOutput(self):      def CalcOutput(self):
155          self.InitCalc()          self.InitCalc()
# Line 109  class Lohnrechner(LST2005.LStRechner2005 Line 158  class Lohnrechner(LST2005.LStRechner2005
158          self.lst.insert(0, "%.2f" % self.GetLohnsteuer())                  self.lst.insert(0, "%.2f" % self.GetLohnsteuer())        
159          self.soli.delete(0, END)          self.soli.delete(0, END)
160          self.soli.insert(0, "%.2f" % self.GetSoli())                  self.soli.insert(0, "%.2f" % self.GetSoli())        
161          self.kirchest.delete(0, END)          self.kist.delete(0, END)
162          self.kirchest.insert(0, "%.2f" % self.GetKirchensteuer())                  self.kist.insert(0, "%.2f" % self.GetKirchensteuer())        
163    
164        def Info(self):
165            infowin = Toplevel(self.root)
166            infowin.title("Info")
167            Label(infowin, text="Lohnrechner 2005 v%s" % _release_version,
168                  font=("Times", 14, "bold italic")).grid(row=0, pady=20)
169            Label(infowin, text=
170                  "Copyright (C) 2005 Intevation GmbH \n\n\
171    Lohnrechner 2005 comes with ABSOLUTELY NO WARRANTY.\n\
172    This is free software, and you are welcome to redistribute it\n\
173    under the terms of the GNU General Public License.\n\
174    For more information about these matters, see the file named COPYING.\n\n\
175    Dieses Programm verwendet LST2005 %s" % LST2005._ModulVersion()).grid(row=1, padx=10)
176            Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10)
177    
178    
179  if __name__ == "__main__":  if __name__ == "__main__":

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26