From scm-commit at wald.intevation.org Wed Feb 11 12:04:42 2009 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 11 Feb 2009 12:04:42 +0100 (CET) Subject: [Lohnrechner-commits] r81 - trunk Message-ID: <20090211110442.E1F8A4073A@pyrosoma.intevation.org> Author: frank Date: 2009-02-11 12:04:42 +0100 (Wed, 11 Feb 2009) New Revision: 81 Modified: trunk/LST2008.py trunk/lohnrechner.py Log: Sonstige Bezuege grundsaetzlich eingebunden, aber in der Eingabe deaktiviert. Modified: trunk/LST2008.py =================================================================== --- trunk/LST2008.py 2008-07-07 10:17:48 UTC (rev 80) +++ trunk/LST2008.py 2009-02-11 11:04:42 UTC (rev 81) @@ -856,6 +856,18 @@ """Liefert Lohn in Euro.Cent""" return self.RE4 / 100.0 + def GetLohnGesamt(self): + """Liefert Summe Arbeitslohn und sonstige Bezüge.""" + return (self.RE4 + self.SONSTB) / 100.0 + + def SetSonstigeBezuege(self, sonstbez): + """Setzt Sonstige Bezüge in Euro.Cent""" + self.Set_SONSTB(round(sonstbez * 100.0)) + + def GetSonstigeBezuege(self): + """Setzt Sonstige Bezüge in Euro.Cent""" + return self.SONSTB / 100.0 + def SetZeitraum(self, lzz): """Setzt Berechnungszeitraum (JAHR, MONAT, WOCHE, TAG)""" self.Set_LZZ(lzz) @@ -891,13 +903,26 @@ return self.ZFK def GetLohnsteuer(self): - """Liefert Lohnsteuer in Euro.Cent""" + """Liefert Lohnsteuer für Lohnzahlungszeitraum in Euro.Cent""" return round(self.LSTLZZ / 100, 2) + def GetLohnsteuerGesamt(self): + """Gesamte Lohnsteuer auf Basis des Zahlungszeitraumes in Euro.Cent""" + return round((self.LSTLZZ + self.STS + self.STV) / 100, 2) + def GetSoli(self): - """Liefert Solidaritätszuschlag in Euro.Cent""" + """Liefert Solidaritätszuschlag für Lohnzahlungszeitraum in Euro.Cent""" return FixedPointFloor(self.SOLZLZZ / 100, 2) + def GetSoliGesamt(self): + """Gesamten Solidaritätszuschlag auf Basis des ZZ in Euro.Cent""" + return FixedPointFloor((self.SOLZLZZ + self.SOLZS + self.SOLZV)/ 100, 2) + def GetKirchensteuer(self): - """Liefert Kirchensteuer in Euro.Cent""" + """Liefert Kirchensteuer für Lohnzahlungszeitraum in Euro.Cent""" return FixedPointFloor(self.BK * self.R / 10000, 2) + + def GetKirchensteuerGesamt(self): + """Gesamte Kirchensteuer auf Basis des ZZ in Euro.Cent""" + return FixedPointFloor((self.BK + self.BKS + self.BKV) \ + * self.R / 10000, 2) Modified: trunk/lohnrechner.py =================================================================== --- trunk/lohnrechner.py 2008-07-07 10:17:48 UTC (rev 80) +++ trunk/lohnrechner.py 2009-02-11 11:04:42 UTC (rev 81) @@ -73,10 +73,20 @@ self.lohn.bind("", self.NewInput) self.lohn.grid(row=1, column=1, sticky=W) - Label(frame, text="Steuerklasse:").grid(row=2, sticky=E) + sonstbezlabel = Label(frame, text="Sonstige Bezüge:") + self.sonstbez = Entry(frame) + self.sonstbez.bind("", self.NewInput) + # Sonstige Bezuege bisher nur unter Randbedingungen: + # - Einmalig im Kalenderjahr + # - Keine Berücksichtigung bei der Berechnung Sozialbeiträge + # Daher per Vorgabe "versteckt", bei Bedarf einfuegen: + # sonstbezlabel.grid(row=2, sticky=E) + # self.sonstbez.grid(row=2, column=1, sticky=W) + + Label(frame, text="Steuerklasse:").grid(row=3, sticky=E) self.stkl = IntVar() stklframe = Frame(frame) - stklframe.grid(row=2, column=1, sticky=W) + stklframe.grid(row=3, column=1, sticky=W) for text, val in [("I", 1), ("II", 2), ("III", 3), @@ -90,24 +100,24 @@ stklradio.select() stklradio.pack(side=LEFT) - Label(frame, text="Kirchensteuer:").grid(row=3, sticky=E) + Label(frame, text="Kirchensteuer:").grid(row=4, sticky=E) self.kirche = IntVar() Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput, - variable=self.kirche).grid(row=3, column=1,sticky=W) + variable=self.kirche).grid(row=4, column=1,sticky=W) - Label(frame, text="Kinderfreibetrag:").grid(row=4, sticky=E) + Label(frame, text="Kinderfreibetrag:").grid(row=5, sticky=E) self.kfb = Entry(frame) self.kfb.bind("", self.NewInput) - self.kfb.grid(row=4, column=1, sticky=W) + self.kfb.grid(row=5, column=1, sticky=W) - Label(frame, text="Kinder:").grid(row=5, sticky=E) + Label(frame, text="Kinder:").grid(row=6, sticky=E) self.kinder = IntVar() self.kinderradio = Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput, variable=self.kinder) - self.kinderradio.grid(row=5, column=1, sticky=W) + self.kinderradio.grid(row=6, column=1, sticky=W) - Label(frame, text="Bundesland:").grid(row=6, sticky=NE) + Label(frame, text="Bundesland:").grid(row=7, sticky=NE) landframe = Frame(frame) scrollbar = Scrollbar(landframe, orient=VERTICAL) self.landbox = Listbox(landframe, height=4, selectmode=SINGLE, @@ -119,7 +129,7 @@ self.landbox.pack(side=RIGHT, fill=Y) scrollbar.config(command=self.landbox.yview) scrollbar.pack(side=LEFT, fill=BOTH, expand=1) - landframe.grid(row=6, rowspan=4, column=1, sticky=W) + landframe.grid(row=7, rowspan=4, column=1, sticky=W) Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) self.lst = Entry(frame) @@ -138,24 +148,24 @@ self.netto1.grid(row=3, column=3, sticky=W) # Sozialversicherung Ein/Ausgabe - Label(frame, text="Sozialversicherung:").grid(row=10, sticky=E) + Label(frame, text="Sozialversicherung:").grid(row=11, sticky=E) self.sozv = IntVar() sozvradio = Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput, variable=self.sozv) sozvradio.select() - sozvradio.grid(row=10, column=1, sticky=W) + sozvradio.grid(row=11, column=1, sticky=W) - Label(frame, text="Krankenkassenbeitrag:").grid(row=11, sticky=E) + Label(frame, text="Krankenkassenbeitrag:").grid(row=12, sticky=E) self.kvsatz = Entry(frame) self.kvsatz.bind("", self.NewInput) - self.kvsatz.grid(row=11, column=1, sticky=W) + self.kvsatz.grid(row=12, column=1, sticky=W) - Label(frame, text="Krankenkassenzuschlag (0.9%):").grid(row=12, sticky=E) + Label(frame, text="Krankenkassenzuschlag (0.9%):").grid(row=13, sticky=E) self.kvsoli = IntVar() kvsoliradio = Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput, variable=self.kvsoli) kvsoliradio.select() - kvsoliradio.grid(row=12, column=1, sticky=W) + kvsoliradio.grid(row=13, column=1, sticky=W) Label(frame, text="Rentenversicherung:").grid(row=4, column=2, sticky=E) @@ -207,6 +217,7 @@ def ResetInput(self): self.ResetInputGeb() self.ResetInputLohn() + self.ResetInputSonstBez() self.ResetInputKfb() self.ResetInputKVsatz() self.NewLandSel() @@ -219,6 +230,10 @@ self.lohn.delete(0, END) self.lohn.insert(0, "0") + def ResetInputSonstBez(self): + self.sonstbez.delete(0, END) + self.sonstbez.insert(0, "0") + def ResetInputKfb(self): self.kfb.delete(0, END) self.kfb.insert(0, "0") @@ -234,6 +249,24 @@ self.ResetInputLohn() try: + self.SetSonstigeBezuege(float(self.sonstbez.get())) + except: + self.ResetInputSonstBez() + + # JRE4: Nötig für Sonstige Bezüge. + # Voraussichtlicher Jahresarbeitslohn ohne sonstige Bezüge und ohne + # Vergütung für mehrjährige Tätigkeit in Cent (ggf. 0) + # lohnrechner berechnet diesen aus dem monatlichen Lohn. + try: + self.Set_JRE4(round(float(self.lohn.get())*100.0,2)*12) + except: + pass + + # JVBEZ: Nötig für Sonstige Bezüge. + # lohnrechner berücksichtigt keine Versorgungsbezüge, daher 0. + self.Set_JVBEZ(0) + + try: self.SetGeb(int(self.geb.get())) except: self.ResetInputGeb() @@ -256,13 +289,14 @@ self.InitCalc() self.Calc() self.lst.delete(0, END) - self.lst.insert(0, "%.2f" % self.GetLohnsteuer()) + self.lst.insert(0, "%.2f" % self.GetLohnsteuerGesamt()) self.soli.delete(0, END) - self.soli.insert(0, "%.2f" % self.GetSoli()) + self.soli.insert(0, "%.2f" % self.GetSoliGesamt()) self.kist.delete(0, END) - self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) - netto1 = self.GetLohn() - self.GetLohnsteuer() \ - - self.GetSoli() - self.GetKirchensteuer() + self.kist.insert(0, "%.2f" % self.GetKirchensteuerGesamt()) + netto1 = self.GetLohn() + self.GetSonstigeBezuege() \ + - self.GetLohnsteuerGesamt() \ + - self.GetSoliGesamt() - self.GetKirchensteuerGesamt() self.netto1.delete(0, END) self.netto1.insert(0, "%.2f" % netto1) self.rv.delete(0, END) @@ -312,20 +346,20 @@ self.KVsatz = (value / 100.0) def GetAV(self): - lohn = self.GetLohn() + lohn = self.GetLohnGesamt() BMG2 = self.laender[self.land][3] if lohn > BMG2 : lohn = BMG2 return round(self.sozv.get() * self.AVsatz * lohn, 2) def GetRV(self): - lohn = self.GetLohn() + lohn = self.GetLohnGesamt() BMG2 = self.laender[self.land][3] if lohn > BMG2 : lohn = BMG2 return round(self.sozv.get() * self.RVsatz * lohn, 2) def GetPV(self): self.PVsatz = self.laender[self.land][2] - lohn = self.GetLohn() + lohn = self.GetLohnGesamt() if lohn > self.BMG1 : lohn = self.BMG1 PV = self.PVsatz * lohn if self.kinder.get() == 0 : @@ -334,7 +368,7 @@ def GetKV(self): self.KVsoli = self.kvsoli.get() - lohn = self.GetLohn() + lohn = self.GetLohnGesamt() if lohn > self.BMG1 : lohn = self.BMG1 if self.KVsoli : return round(self.sozv.get() * ((self.KVsatz / 2) + 0.009) * lohn, 2)