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

Diff of /trunk/lohnrechner2007.py

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

lohnrechner.py revision 41 by wilde, Wed Nov 2 08:56:13 2005 UTC trunk/lohnrechner.py revision 72 by wilde, Fri Jan 26 11:23:49 2007 UTC
# Line 5  Line 5 
5  # $Id$  # $Id$
6  # --------------------------------------------------------------------  # --------------------------------------------------------------------
7  #  #
8  # Copyright (c) 2005 by Intevation GmbH  # Copyright (c) 2005,2006,2007 by Intevation GmbH
9  # Authors:  # Authors:
10  # Sascha Wilde <[email protected]>  # Sascha Wilde <[email protected]>
11  #  #
12  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
13  # Read the file COPYING coming with this package for details.  # Read the file COPYING coming with this package for details.
14    
15  """Lohn/Gehaltsrechner f�r das Jahr 2005"""  """Lohn/Gehaltsrechner f�r das Jahr 2007"""
16    
17  __version__ = "$Revision$"  __version__ = "$Revision$"
18  # $Source$  # $Source$
19                    
20  _release_version = "0.%s beta" % __version__[11:-2]  _release_version = "0.%s" % __version__[11:-2]
21    
22  import LST2005  import LST2007
23  from Tkinter import *  from Tkinter import *
24    
25  class Lohnrechner(LST2005.LStRechner2005):  class Lohnrechner(LST2007.LStRechner2007):
26    
27      def __init__(self, root):      def __init__(self, root):
28          LST2005.LStRechner2005.__init__(self)          LST2007.LStRechner2007.__init__(self)
29    
30          # Land, Kirchensteuersatz, Pflegeversicherung AG-Anteil          # Land, Kirchensteuersatz, Pflegeversicherung AG-Anteil
31          self.laender = [("Baden-W�rttemberg", 8, 0.0085),          self.laender = [("Baden-W�rttemberg", 8, 0.0085, 5250),
32                          ("Bayern", 8, 0.0085),                          ("Bayern", 8, 0.0085, 5250),
33                          ("Berlin", 9, 0.0085),                          ("Berlin (ost)", 9, 0.0085, 4550),
34                          ("Brandenburg", 9, 0.0085),                          ("Berlin (west)", 9, 0.0085, 5250),
35                          ("Bremen", 9, 0.0085),                          ("Brandenburg", 9, 0.0085, 4550),
36                          ("Bremerhaven", 9, 0.0085),                          ("Bremen", 9, 0.0085, 5250),
37                          ("Hamburg", 9, 0.0085),                          ("Bremerhaven", 9, 0.0085, 5250),
38                          ("Hessen", 9, 0.0085),                          ("Hamburg", 9, 0.0085, 5250),
39                          ("Mecklenburg-Vorpommern", 9, 0.0085),                          ("Hessen", 9, 0.0085, 5250),
40                          ("Niedersachsen" ,9, 0.0085),                          ("Mecklenburg-Vorpommern", 9, 0.0085, 4550),
41                          ("Nordrhein-Westfalen", 9, 0.0085),                          ("Niedersachsen" ,9, 0.0085, 5250),
42                          ("Rheinland-Pfalz", 9, 0.0085),                          ("Nordrhein-Westfalen", 9, 0.0085, 5250),
43                          ("Saarland", 9, 0.0085),                          ("Rheinland-Pfalz", 9, 0.0085, 5250),
44                          ("Sachsen", 9, 0.0135),                          ("Saarland", 9, 0.0085, 5250),
45                          ("Sachsen-Anhalt", 9, 0.0085),                          ("Sachsen", 9, 0.0135, 4550),
46                          ("Schleswig-Holstein", 9, 0.0085),                          ("Sachsen-Anhalt", 9, 0.0085, 4550),
47                          ("Th�ringen", 9, 0.0085)]                          ("Schleswig-Holstein", 9, 0.0085, 5250),
48                            ("Th�ringen", 9, 0.0085, 4550)]
49                    
50          self.root = root          self.root = root
51    
52          self.root.title("Lohnrechner 2005 - v%s" % _release_version)          self.root.title("Lohnrechner 2007 - v%s" % _release_version)
53    
54          self.SetupUI()          self.SetupUI()
55          self.UpdateLand()          self.UpdateLand()
# Line 62  class Lohnrechner(LST2005.LStRechner2005 Line 63  class Lohnrechner(LST2005.LStRechner2005
63          frame.grid(padx=10, pady=10)          frame.grid(padx=10, pady=10)
64    
65          # Steuern Ein/Ausgabe          # Steuern Ein/Ausgabe
66          Label(frame, text="Lohn (monatlich):").grid(row=0, sticky=E)          Label(frame, text="Geburtsjahr:").grid(row=0, sticky=E)
67            self.geb = Entry(frame)
68            self.geb.bind("<Return>", self.NewInput)
69            self.geb.grid(row=0, column=1, sticky=W)
70    
71            Label(frame, text="Lohn (monatlich):").grid(row=1, sticky=E)
72          self.lohn = Entry(frame)          self.lohn = Entry(frame)
73          self.lohn.bind("<Return>", self.NewInput)          self.lohn.bind("<Return>", self.NewInput)
74          self.lohn.grid(row=0, column=1, sticky=W)          self.lohn.grid(row=1, column=1, sticky=W)
75    
76          Label(frame, text="Steuerklasse:").grid(row=1, sticky=E)          Label(frame, text="Steuerklasse:").grid(row=2, sticky=E)
77          self.stkl = IntVar()          self.stkl = IntVar()
78          stklframe = Frame(frame)          stklframe = Frame(frame)
79          stklframe.grid(row=1, column=1, sticky=W)          stklframe.grid(row=2, column=1, sticky=W)
80          for text, val in [("I", 1),          for text, val in [("I", 1),
81                            ("II", 2),                            ("II", 2),
82                            ("III", 3),                            ("III", 3),
# Line 84  class Lohnrechner(LST2005.LStRechner2005 Line 90  class Lohnrechner(LST2005.LStRechner2005
90                  stklradio.select()                  stklradio.select()
91              stklradio.pack(side=LEFT)              stklradio.pack(side=LEFT)
92    
93          Label(frame, text="Kirchensteuer:").grid(row=2, sticky=E)          Label(frame, text="Kirchensteuer:").grid(row=3, sticky=E)
94          self.kirche = IntVar()          self.kirche = IntVar()
95          Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput,          Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput,
96                      variable=self.kirche).grid(row=2, column=1,sticky=W)                      variable=self.kirche).grid(row=3, column=1,sticky=W)
97    
98          Label(frame, text="Kinderfreibetrag:").grid(row=3, sticky=E)          Label(frame, text="Kinderfreibetrag:").grid(row=4, sticky=E)
99          self.kfb = Entry(frame)          self.kfb = Entry(frame)
100          self.kfb.bind("<Return>", self.NewInput)          self.kfb.bind("<Return>", self.NewInput)
101          self.kfb.grid(row=3, column=1, sticky=W)          self.kfb.grid(row=4, column=1, sticky=W)
102    
103          Label(frame, text="Bundesland:").grid(row=4, sticky=NE)          Label(frame, text="Kinder:").grid(row=5, sticky=E)
104            self.kinder = IntVar()
105            self.kinderradio = Checkbutton(frame, onvalue=1, offvalue=0,
106                                           command=self.NewInput,
107                                           variable=self.kinder)
108            self.kinderradio.grid(row=5, column=1, sticky=W)
109            
110            Label(frame, text="Bundesland:").grid(row=6, sticky=NE)
111          landframe = Frame(frame)          landframe = Frame(frame)
112          scrollbar = Scrollbar(landframe, orient=VERTICAL)          scrollbar = Scrollbar(landframe, orient=VERTICAL)
113          self.landbox = Listbox(landframe, height=4, selectmode=SINGLE,          self.landbox = Listbox(landframe, height=4, selectmode=SINGLE,
# Line 106  class Lohnrechner(LST2005.LStRechner2005 Line 119  class Lohnrechner(LST2005.LStRechner2005
119          self.landbox.pack(side=RIGHT, fill=Y)          self.landbox.pack(side=RIGHT, fill=Y)
120          scrollbar.config(command=self.landbox.yview)          scrollbar.config(command=self.landbox.yview)
121          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)
122          landframe.grid(row=4, rowspan=4, column=1, sticky=W)          landframe.grid(row=6, rowspan=4, column=1, sticky=W)
123                    
124          Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)          Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
125          self.lst = Entry(frame)          self.lst = Entry(frame)
# Line 125  class Lohnrechner(LST2005.LStRechner2005 Line 138  class Lohnrechner(LST2005.LStRechner2005
138          self.netto1.grid(row=3, column=3, sticky=W)          self.netto1.grid(row=3, column=3, sticky=W)
139    
140          # Sozialversicherung Ein/Ausgabe          # Sozialversicherung Ein/Ausgabe
141          Label(frame, text="Sozialversicherung:").grid(row=8, sticky=E)          Label(frame, text="Sozialversicherung:").grid(row=10, sticky=E)
142          self.sozv = IntVar()          self.sozv = IntVar()
143          sozvradio = Checkbutton(frame, onvalue=1, offvalue=0,          sozvradio = Checkbutton(frame, onvalue=1, offvalue=0,
144                                  command=self.NewInput, variable=self.sozv)                                  command=self.NewInput, variable=self.sozv)
145          sozvradio.select()          sozvradio.select()
146          sozvradio.grid(row=8, column=1, sticky=W)          sozvradio.grid(row=10, column=1, sticky=W)
147    
148          Label(frame, text="Krankenkassenbeitrag:").grid(row=9, sticky=E)          Label(frame, text="Krankenkassenbeitrag:").grid(row=11, sticky=E)
149          self.kvsatz = Entry(frame)          self.kvsatz = Entry(frame)
150          self.kvsatz.bind("<Return>", self.NewInput)          self.kvsatz.bind("<Return>", self.NewInput)
151          self.kvsatz.grid(row=9, column=1, sticky=W)          self.kvsatz.grid(row=11, column=1, sticky=W)
152    
153            Label(frame, text="Krankenkassenzuschlag (0.9%):").grid(row=12, sticky=E)
154            self.kvsoli = IntVar()
155            kvsoliradio = Checkbutton(frame, onvalue=1, offvalue=0,
156                                      command=self.NewInput, variable=self.kvsoli)
157            kvsoliradio.select()
158            kvsoliradio.grid(row=12, column=1, sticky=W)
159    
160    
161          Label(frame, text="Rentenversicherung:").grid(row=4, column=2, sticky=E)          Label(frame, text="Rentenversicherung:").grid(row=4, column=2, sticky=E)
162          self.rv = Entry(frame)          self.rv = Entry(frame)
# Line 160  class Lohnrechner(LST2005.LStRechner2005 Line 181  class Lohnrechner(LST2005.LStRechner2005
181    
182          # Allgemeine UI Elemente          # Allgemeine UI Elemente
183          buttons = Frame(frame)          buttons = Frame(frame)
184          buttons.grid(row=9, column=2, columnspan=2)          buttons.grid(row=10, column=2, rowspan=3, columnspan=2)
185          Button(buttons, text="Quit", command=self.root.quit).pack(side=LEFT)          Button(buttons, text="Quit", command=self.root.quit).pack(side=LEFT)
186          Button(buttons, text="Info", command=self.Info).pack(side=LEFT)          Button(buttons, text="Info", command=self.Info).pack(side=LEFT)
187          Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)          Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)
# Line 171  class Lohnrechner(LST2005.LStRechner2005 Line 192  class Lohnrechner(LST2005.LStRechner2005
192          # zwangsselektiert:          # zwangsselektiert:
193          # FIX ME: eigendlich w�re das ein Fall f�r ein custom widget!          # FIX ME: eigendlich w�re das ein Fall f�r ein custom widget!
194          if len(self.landbox.curselection()) == 0:          if len(self.landbox.curselection()) == 0:
195              self.landbox.select_set(self.land)                          self.landbox.select_set(self.land)
196            if float(self.kfb.get()) > 0.0:
197                self.kinderradio.select()
198          self.CalcOutput()          self.CalcOutput()
199    
200      def UpdateLand(self):      def UpdateLand(self):
# Line 182  class Lohnrechner(LST2005.LStRechner2005 Line 205  class Lohnrechner(LST2005.LStRechner2005
205          self.CalcOutput()          self.CalcOutput()
206    
207      def ResetInput(self):      def ResetInput(self):
208            self.ResetInputGeb()
209          self.ResetInputLohn()          self.ResetInputLohn()
210          self.ResetInputKfb()          self.ResetInputKfb()
211          self.ResetInputKVsatz()          self.ResetInputKVsatz()
212          self.NewLandSel()          self.NewLandSel()
213    
214        def ResetInputGeb(self):
215            self.geb.delete(0, END)
216            self.geb.insert(0, "1964")
217    
218      def ResetInputLohn(self):      def ResetInputLohn(self):
219          self.lohn.delete(0, END)          self.lohn.delete(0, END)
220          self.lohn.insert(0, "0")          self.lohn.insert(0, "0")
# Line 197  class Lohnrechner(LST2005.LStRechner2005 Line 225  class Lohnrechner(LST2005.LStRechner2005
225    
226      def ResetInputKVsatz(self):      def ResetInputKVsatz(self):
227          self.kvsatz.delete(0, END)          self.kvsatz.delete(0, END)
228          self.kvsatz.insert(0, "14.7")          self.kvsatz.insert(0, "13.8")
229    
230      def InitCalc(self):      def InitCalc(self):
231          try:          try:
# Line 206  class Lohnrechner(LST2005.LStRechner2005 Line 234  class Lohnrechner(LST2005.LStRechner2005
234              self.ResetInputLohn()              self.ResetInputLohn()
235    
236          try:          try:
237                self.SetGeb(int(self.geb.get()))
238            except:
239                self.ResetInputGeb()
240    
241            try:
242              self.SetKinderfreibetrag(float(self.kfb.get()))              self.SetKinderfreibetrag(float(self.kfb.get()))
243          except:          except:
244              self.ResetInputKfb()              self.ResetInputKfb()
# Line 248  class Lohnrechner(LST2005.LStRechner2005 Line 281  class Lohnrechner(LST2005.LStRechner2005
281      def Info(self):      def Info(self):
282          infowin = Toplevel(self.root)          infowin = Toplevel(self.root)
283          infowin.title("Info")          infowin.title("Info")
284          Label(infowin, text="Lohnrechner 2005 v%s" % _release_version,          Label(infowin, text="Lohnrechner 2007 v%s" % _release_version,
285                font=("Times", 14, "bold italic")).grid(row=0, pady=20)                font=("Times", 14, "bold italic")).grid(row=0, pady=20)
286          Label(infowin, text=          Label(infowin, text=
287                "Copyright (C) 2005 Intevation GmbH \n\n\                "Copyright (C) 2005,2006,2007 Intevation GmbH \n\n\
288  Lohnrechner 2005 comes with ABSOLUTELY NO WARRANTY.\n\  Lohnrechner 2007 comes with ABSOLUTELY NO WARRANTY.\n\
289  This is free software, and you are welcome to redistribute it\n\  This is free software, and you are welcome to redistribute it\n\
290  under the terms of the GNU General Public License.\n\  under the terms of the GNU General Public License.\n\
291  For more information about these matters, see the file named COPYING.\n\n\  For more information about these matters, see the file named COPYING.\n\n\
292  Dieses Programm verwendet LST2005 %s" % LST2005._ModulVersion()).grid(row=1, padx=10)  Dieses Programm verwendet LST2007 %s" % LST2007._ModulVersion()).grid(row=1, padx=10)
293          Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10)          Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10)
294    
295      #      #
# Line 266  Dieses Programm verwendet LST2005 %s" % Line 299  Dieses Programm verwendet LST2005 %s" %
299      #      #
300    
301      def InitSozv(self):      def InitSozv(self):
302          self.AVsatz = 0.065 / 2          self.AVsatz = 0.042 / 2
303          self.RVsatz = 0.195 / 2          self.RVsatz = 0.199 / 2
304          # PVsatz ist in self.laender definiert!          # PVsatz ist in self.laender definiert!
305          self.PVkinderlose = 0.0025          self.PVkinderlose = 0.0025
306          self.BMG1 = 3525          self.BMG1 = 3562.5
307          self.BMG2 = 5200          # BMG2 f�r RV und ALV ist in self.laender definiert!
308    
309      def SetKV(self, value):      def SetKV(self, value):
310          assert value >= 0.0 and value <= 100.0, \          assert value >= 0.0 and value <= 100.0, \
# Line 280  Dieses Programm verwendet LST2005 %s" % Line 313  Dieses Programm verwendet LST2005 %s" %
313    
314      def GetAV(self):      def GetAV(self):
315          lohn = self.GetLohn()          lohn = self.GetLohn()
316          if lohn > self.BMG2 : lohn = self.BMG2          BMG2 = self.laender[self.land][3]
317            if lohn > BMG2 : lohn = BMG2
318          return round(self.sozv.get() * self.AVsatz * lohn, 2)          return round(self.sozv.get() * self.AVsatz * lohn, 2)
319    
320      def GetRV(self):      def GetRV(self):
321          lohn = self.GetLohn()          lohn = self.GetLohn()
322          if lohn > self.BMG2 : lohn = self.BMG2          BMG2 = self.laender[self.land][3]
323            if lohn > BMG2 : lohn = BMG2
324          return round(self.sozv.get() * self.RVsatz * lohn, 2)          return round(self.sozv.get() * self.RVsatz * lohn, 2)
325    
326      def GetPV(self):      def GetPV(self):
# Line 293  Dieses Programm verwendet LST2005 %s" % Line 328  Dieses Programm verwendet LST2005 %s" %
328          lohn = self.GetLohn()          lohn = self.GetLohn()
329          if lohn > self.BMG1 : lohn = self.BMG1          if lohn > self.BMG1 : lohn = self.BMG1
330          PV =  self.PVsatz * lohn          PV =  self.PVsatz * lohn
331          if float(self.kfb.get()) == 0.0 :          if self.kinder.get() == 0 :
332              PV += lohn * self.PVkinderlose              PV += lohn * self.PVkinderlose
333          return round(self.sozv.get() * PV, 2)          return round(self.sozv.get() * PV, 2)
334    
335      def GetKV(self):      def GetKV(self):
336          # KVsoli should be setable by the UI          self.KVsoli = self.kvsoli.get()
         self.KVsoli = 1  
337          lohn = self.GetLohn()          lohn = self.GetLohn()
338          if lohn > self.BMG1 : lohn = self.BMG1          if lohn > self.BMG1 : lohn = self.BMG1
339          if self.KVsoli :          if self.KVsoli :

Legend:
Removed from v.41  
changed lines
  Added in v.72

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26