[Lohnrechner-commits] r60 - / trunk
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Mar 24 12:28:43 CET 2006
Author: wilde
Date: 2006-03-24 12:28:43 +0100 (Fri, 24 Mar 2006)
New Revision: 60
Added:
trunk/
trunk/COPYING
trunk/LST2005.py
trunk/LST2006.py
trunk/NEWS
trunk/Programmablaufplan.txt
trunk/README
trunk/lohnrechner.py
trunk/test_Lohnsteuer2005.py
trunk/test_Lohnsteuer2006.py
Removed:
COPYING
LST2005.py
LST2006.py
NEWS
Programmablaufplan.txt
README
lohnrechner.py
test_Lohnsteuer.py
test_Lohnsteuer2005.py
test_Lohnsteuer2006.py
Log:
Moved everything in the new subdirectory "trunk" to conform to
repository standard layout.
Deleted: COPYING
===================================================================
--- COPYING 2006-01-30 08:23:04 UTC (rev 59)
+++ COPYING 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
Deleted: LST2005.py
===================================================================
--- LST2005.py 2006-01-30 08:23:04 UTC (rev 59)
+++ LST2005.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,652 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-# --------------------------------------------------------------------
-# LST2005 -- Python Modul zur Berechnung der Deutschen Lohnsteuer 2005
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Lohnsteuerberechnung nach dem offiziellen Programmablaufplan
- wie im offiziellen Programmablaufplan des Bundesfinanzministerium
- dokumentiert.
- http://www.bundesfinanzministerium.de/Service/Interaktiver-Steuerrechner-.577.htm"""
-
-__version__ = "$Revision$"
-# $Source$
-
-def _ModulVersion():
- return __version__[11:-2]
-
-# Die Variablen Namen sind hässlich, die Algorithmen nicht
-# dokumentiert, der Code grausam -- dafür entspricht alles Zeile für
-# Zeile obigem Dokument. Jedenfalls sollte es so sein...
-
-from math import ceil, floor
-
-# Wir brauchen eigene Rundungsfunktionen mit definierter Präzision
-def FixedPointFloor(value, precision=2):
- i = 10.0 ** precision
- return floor(value * i) / i
-
-def FixedPointCeil(value, precision=2):
- i = 10.0 ** precision
- return ceil(value * i) / i
-
-# Ein paar Konstanten um das ganze etwas Benutzbarer zu machen:
-JAHR = 1
-MONAT = 2
-WOCHE = 3
-TAG = 4
-I = 1
-II = 2
-III = 3
-IV = 4
-V = 5
-VI = 6
-
-class LST:
- def __init__(self,
- RE4=0,
- ALTER1=0,
- HINZUR=0,
- JFREIB=0,
- JHINZU=0,
- JRE4 =0,
- JVBEZ =0,
- KRV =0,
- LZZ =2,
- R =0,
- SONSTB=0,
- STKL =1,
- VBEZ =0,
- VBEZM =0,
- VBEZS =0,
- VBS =0,
- VMT =0,
- WFUNDF=0,
- ZKF =0,
- ZMVB =0):
- self.Set_RE4(RE4)
- self.Set_ALTER1(ALTER1)
- self.Set_HINZUR(HINZUR)
- self.Set_JFREIB(JFREIB)
- self.Set_JHINZU(JHINZU)
- self.Set_JRE4(JRE4)
- self.Set_JVBEZ(JVBEZ)
- self.Set_KRV(KRV)
- self.Set_LZZ(LZZ)
- self.Set_R(R)
- self.Set_SONSTB(SONSTB)
- self.Set_STKL(STKL)
- self.Set_VBEZ(VBEZ)
- self.Set_VBEZM(VBEZM)
- self.Set_VBEZS(VBEZS)
- self.Set_VBS(VBS)
- self.Set_VMT(VMT)
- self.Set_WFUNDF(WFUNDF)
- self.Set_ZKF(ZKF)
- self.Set_ZMVB(ZMVB)
- # Vorgegebene Ausgangsparameter
- self.BK = 0
- self.BKS = 0
- self.BKV = 0
- self.LSTLZZ = 0
- self.SOLZLZZ = 0
- self.SOLZS = 0
- self.SOLZV = 0
- self.STS = 0
- self.STV = 0
-
- def Calc(self):
- """Berechnet die Lohnsteuer,
- setzt BK, BKS, BKV, LSTLZZ, SOLZLZZ, SOLZS, SOLZV, STS und STV"""
- # Interne Felder
- # Laut Dokumentation sollen diese vor der Berechnung gelöscht werden,
- # es ist mir nicht klar, ob das wirklich nötig ist...
- self._ALTE = 0
- self._ANP = 0
- self._ANTEIL1 = 0
- self._ANTEIL2 = 0
- self._BMG = 0
- self._DIFF = 0
- self._EFA = 0
- self._FVB = 0
- self._FVBZ = 0
- self._JBMG = 0
- self._JW = 0
- self._KENNZ = 0
- self._KFB = 0
- self._KZTAB = 1
- self._LSTJAHR = 0
- self._LST1 = 0
- self._LST2 = 0
- self._LST3 = 0
- self._MIST = 0
- self._RE4LZZ = 0
- self._RE4LZZV = 0
- self._RW = 0.0
- self._SAP = 0
- self._SOLZFREI = 0
- self._SOLZJ = 0.0 # 2 Dezimalstellen
- self._SOLZMIN = 0.0 # 2 Dezimalstellen
- self._ST = 0
- self._ST1 = 0
- self._ST2 = 0
- self._VBEZB = 0
- self._VHB = 0
- self._VSP = 0.0 # 2 Dezimalstellen
- self._VSPN = 0
- self._VSP1 = 0.0 # 2 Dezimalstellen
- self._VSP2 = 0.0 # 2 Dezimalstellen
- self._VSPKURZ = 0
- self._VSPMAX1 = 0
- self._VSPMAX2 = 0
- self._VSPO = 0.0 # 2 Dezimalstellen
- self._VSPREST = 0.0 # 2 Dezimalstellen
- self._VSPVOR = 0.0 # 2 Dezimalstellen
- self._X = 0.0 # 2 Dezimalstellen
- self._Y = 0.0 # 6 Dezimalstellen
- self._ZRE4 = 0.0 # 2 Dezimalstellen
- self._ZRE4VP = 0.0 # 2 Dezimalstellen
- self._ZRE4VP1 = 0.0 # 2 Dezimalstellen
- self._ZTABFB = 0
- self._ZVE = 0
- self._ZX = 0
- self._ZZX = 0
- self._HOCH = 0
- self._VERGL = 0
- # ------------------------------------------------------------
- # Anfang der Berechnung
- self._MRE4LZZ()
- self._RE4LZZ = self.RE4 - self._FVB \
- - self._ALTE - self.WFUNDF \
- + self.HINZUR
- self._RE4LZZV = self.RE4 - self._FVB - self._ALTE
- self._MRE4()
- self._MZTABFB()
- self._MLSTJAHR()
- self._LSTJAHR = self._ST
- self._JW = self._LSTJAHR * 100
- self._UPANTEIL()
- self.LSTLZZ = self._ANTEIL1
- if self.ZKF > 0:
- self._ZTABFB += self._KFB
- self._MLSTJAHR()
- self._JBMG = self._ST
- else:
- self._JBMG = self._LSTJAHR
- self._MSOLZ()
- self._MSONST()
- self._MVMT()
-
- # Benutzte Unterprogramme:
- def _MRE4LZZ(self):
- if self.VBEZ == 0:
- self._FVBZ = 0
- self._FVB = 0
- else:
- if self.LZZ == 1:
- self._VBEZB = self.VBEZM * self.ZMVB + self.VBEZS
- self._FVBZ = 75 * self.ZMVB
- else:
- self._VBEZB = self.VBEZM * 12 + self.VBEZS
- self._FVBZ = 900
- self._FVB = ceil(self._VBEZB * 0.4)
- if self._FVB > 300000:
- self._FVB = 300000
- self._JW = self._FVB
- self._UPANTEIL()
- self._FVB = self._ANTEIL2
- if self.ALTER1 == 0:
- self._ALTE = 0
- else:
- self._BMG = self.RE4 - self.VBEZ
- self._ALTE = ceil(self._BMG * 0.4)
- self._JW = 190000
- self._UPANTEIL()
- if self._ALTE > self._ANTEIL2:
- self._ALTE = self._ANTEIL2
-
- def _MRE4(self):
- if self.LZZ == 1:
- self._ZRE4 = FixedPointFloor(self._RE4LZZ / 100.0)
- self._ZRE4VP = FixedPointFloor(self._RE4LZZV / 100.0)
- elif self.LZZ == 2:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.67) * 0.12)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.67) * 0.12)
- elif self.LZZ == 3:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.89) * 3.6 / 7)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.89) * 3.6 / 7)
- else:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.56) * 3.6)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.56) * 3.6)
- if self._ZRE4 < 0:
- self._ZRE4 = 0.0
-
- def _MZTABFB(self):
- self._KZTAB = 1
- if self.STKL < 6:
- if self.VBEZ > 0:
- self._ANP = 102
- if self.RE4 > self.VBEZ:
- self._ANP += 920
- else:
- self._ANP = 0
- if self.STKL == 1:
- self._SAP = 36
- self._KFB = self.ZKF * 5808
- elif self.STKL == 2:
- self._EFA = 1308
- self._SAP = 36
- self._KFB = self.ZKF * 5808
- elif self.STKL == 3:
- self._KZTAB = 2
- self._SAP = 72
- self._KFB = self.ZKF * 5808
- elif self.STKL == 4:
- self._SAP = 36
- self._KFB = self.ZKF * 2904
- else:
- self._KFB = 0
- self._ZTABFB = self._EFA + self._ANP + self._SAP + self._FVBZ
- self._KENNZ = 0
-
- def _MLSTJAHR(self):
- if self.STKL < 5:
- self._UPEVP()
- else:
- self._VSP = 0.0
- self._ZVE = self._ZRE4 - self._ZTABFB - self._VSP
- if self._ZVE < 1:
- self._ZVE = self._X = 0.0
- else:
- self._X = floor(float(self._ZVE) / self._KZTAB)
- if self.STKL < 5:
- self._UPTAB05()
- else:
- self._MST5_6()
-
- def _UPEVP(self):
- if self.KRV == 1:
- self._VSP1 = 1.0
- else:
- if self._ZRE4VP > 62400:
- self._ZRE4VP = 62400
- self._VSP1 = 0.2 * self._ZRE4VP
- self._VSP1 = FixedPointFloor(self._VSP1 * 0.0975)
- self._VSP2 = FixedPointFloor(0.11 * self._ZRE4VP)
- self._VHB = 1500 * self._KZTAB
- if self._VSP2 > self._VHB:
- self._VSP2 = self._VHB
- self._VSPN = ceil(self._VSP1 + self._VSP2)
- self._MVSP()
- if self._VSPN > self._VSP:
- self._VSP = self._VSPN
-
- def _MVSP(self):
- self._VSPO = self._ZRE4VP * 0.2
- self._VSPVOR = 3068 * self._KZTAB
- self._VSPMAX1 = 1334 * self._KZTAB
- self._VSPMAX2 = 667 * self._KZTAB
- self._VSPKURZ = 1134 * self._KZTAB
- if self.KRV == 1:
- if self._VSPO > self._VSPKURZ:
- self._VSP = self._VSPKURZ
- else:
- self._VSP = ceil(self._VSPO)
- else:
- self._UMVSP()
-
- def _UMVSP(self):
- if self._KENNZ == 1:
- self._VSPVOR = self._VSPVOR - self._ZRE4VP1 * 0.16
- else:
- self._VSPVOR = self._VSPVOR - self._ZRE4VP * 0.16
- if self._VSPVOR < 0:
- self._VSPVOR = 0.0
- if self._VSPO > self._VSPVOR:
- self._VSP = self._VSPVOR
- self._VSPREST = self._VSPO - self._VSPVOR
- if self._VSPREST > self._VSPMAX1:
- self._VSP += self._VSPMAX1
- self._VSPREST = FixedPointCeil((self._VSPREST - self._VSPMAX1) / 2.0)
- if self._VSPREST > self._VSPMAX2:
- self._VSP = ceil(self._VSP + self._VSPMAX2)
- else:
- self._VSP = ceil(self._VSP + self._VSPREST)
- else:
- self._VSP = ceil(self._VSP + self._VSPREST)
- else:
- self._VSP = ceil(self._VSPO)
-
- def _MST5_6(self):
- self._ZZX = self._X
- if self._ZZX > 25812:
- self._ZX = 25812
- self._UP5_6()
- self._ST = floor(self._ST + (self._ZZX - 25812) * 0.42)
- else:
- self._ZX = self._ZZX
- self._UP5_6()
- if self._ZZX > 9144:
- self._VERGL = self._ST
- self._ZX = 9144
- self._UP5_6()
- self._HOCH = floor(self._ST + (self._ZZX - 9144) * 0.42)
- if self._HOCH < self._VERGL:
- self._ST = self._HOCH
- else:
- self._ST = self._VERGL
-
- def _UP5_6(self):
- self._X = self._ZX * 1.25
- self._UPTAB05()
- self._ST1 = self._ST
- self._X = self._ZX * 0.75
- self._UPTAB05()
- self._ST2 = self._ST
- self._DIFF = (self._ST1 - self._ST2) * 2
- self._MIST = floor(self._ZX * 0.15)
- if self._MIST > self._DIFF:
- self._ST = self._MIST
- else:
- self._ST = self._DIFF
-
- def _MSOLZ(self):
- self._SOLZFREI = 972 * self._KZTAB
- if self._JBMG > self._SOLZFREI:
- self._SOLZJ = FixedPointFloor(self._JBMG * 5.5 / 100.0)
- self._SOLZMIN = (self._JBMG - self._SOLZFREI) * 20 / 100.0
- if self._SOLZMIN < self._SOLZJ:
- self._SOLZJ = self._SOLZMIN
- self._JW = self._SOLZJ * 100
- self._UPANTEIL()
- self.SOLZLZZ = self._ANTEIL1
- else:
- self.SOLZLZZ = 0
- if self.R > 0:
- self._JW = self._JBMG * 100
- self._UPANTEIL()
- self.BK = self._ANTEIL1
- else:
- self.BK = 0
-
- def _UPANTEIL(self):
- if self.LZZ == 1:
- self._ANTEIL1 = self._JW
- self._ANTEIL2 = self._JW
- elif self.LZZ == 2:
- self._ANTEIL1 = floor(self._JW / 12.0)
- self._ANTEIL2 = ceil(self._JW / 12.0)
- elif self.LZZ == 3:
- self._ANTEIL1 = floor(self._JW * 7 / 360.0)
- self._ANTEIL2 = ceil(self._JW * 7 / 360.0)
- else:
- self._ANTEIL1 = floor(self._JW / 360.0)
- self._ANTEIL2 = ceil(self._JW / 360.0)
-
- def _UPTAB05(self):
- if self._X < 7665:
- self._ST = 0
- elif self._X < 12740:
- self._Y = (self._X - 7664) / 10000.0
- self._RW = self._Y * 883.74
- self._RW += 1500
- self._ST = floor(self._RW * self._Y)
- elif self._X < 52152:
- self._Y = (self._X - 12739) / 10000.0
- self._RW = self._Y * 228.74
- self._RW += 2397
- self._RW *= self._Y
- self._ST = floor(self._RW + 989)
- else:
- self._ST = floor(self._X * 0.42 - 7914)
- self._ST *= self._KZTAB
-
- def _MSONST(self):
- if self.SONSTB > 0:
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute sichern
- old_lzz = self.LZZ
- old_vbez = self.VBEZ
- old_re4 = self.RE4
- # ------------------------------
- self.LZZ = 1
- self.VBEZ = self.JVBEZ
- self.RE4 = self.JRE4
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MRE4()
- self._MZTABFB()
- self._MLSTJAHR()
- self._LST1 = self._ST * 100
- self.VBEZ = self.JVBEZ + self.VBS
- self.RE4 = self.JRE4 + self.SONSTB
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MRE4()
- self._MLSTJAHR()
- self._LST2 = self._ST * 100
- self.STS = self._LST2 - self._LST1
- self.SOLZS = self.STS * 5.5 / 100
- if self.R > 0:
- self.BKS = self.STS
- else:
- self.BKS = 0
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute
- # wiederherstellen
- self.LZZ = old_lzz
- self.VBEZ = old_vbez
- self.RE4 = old_re4
- # ------------------------------
- else:
- self.STS = 0
- self.SOLZS = 0
- self.BKS = 0
-
- def _MRE4LZZ2(self):
- self._RE4LZZ = self.RE4 - self._FVB - self._ALTE \
- - self.JFREIB + self.JHINZU
- self._RE4LZZV = self.RE4 - self._FVB - self._ALTE
-
- def _MVMT(self):
- if self.VMT > 0:
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute sichern
- old_lzz = self.LZZ
- old_vbez = self.VBEZ
- old_re4 = self.RE4
- # ------------------------------
- self.LZZ = 1
- self.VBEZ = self.JVBEZ + self.VBS
- self.RE4 = self.JRE4 + self.SONSTB
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MRE4()
- self._MZTABFB()
- self._MLSTJAHR()
- self._LST1 = self._ST * 100
- self.RE4 = self.JRE4 + self.SONSTB + self.VMT
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MRE4()
- self._KENNZ = 1
- self._ZRE4VP1 = self._ZRE4VP
- self._MLSTJAHR()
- self._LST3 = self._ST * 100
- self.RE4 = self.JRE4 + self.SONSTB
- self._MRE4LZZ()
- self.RE4 = self.JRE4 + self.SONSTB + self.VMT / 5
- self._MRE4LZZ2()
- self._MRE4()
- self._MLSTJAHR()
- self._LST2 = self._ST * 100
- self.STV = (self._LST2 - self._LST1) * 5
- self._LST3 -= self._LST1
- if self._LST3 < self.STV:
- self.STV = self._LST3
- self.SOLZV = floor(self.STV * 5.5 / 100)
- if self.R > 0:
- self.BKV = self.STV
- else:
- self.BKV = 0
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute
- # wiederherstellen
- self.LZZ = old_lzz
- self.VBEZ = old_vbez
- self.RE4 = old_re4
- # ------------------------------
- else:
- self.STV = 0
- self.SOLZV = 0
- self.BKV = 0
-
- # Methoden zum geprüften setzen der Wert
- # FIX ME: Prüfung _sehr_ unvollständig
- def Set_RE4(self, value):
- assert value >= 0, "must not be negative"
- self.RE4 = value
-
- def Set_ALTER1(self, value):
- assert value in (0,1), "must be 0 or 1"
- self.ALTER1 = value
-
- def Set_HINZUR(self, value):
- self.HINZUR = value
-
- def Set_JFREIB(self, value):
- self.JFREIB = value
-
- def Set_JHINZU(self, value):
- self.JHINZU = value
-
- def Set_JRE4(self, value):
- self.JRE4 = value
-
- def Set_JVBEZ(self, value):
- self.JVBEZ = value
-
- def Set_KRV(self, value):
- assert value in (0,1), "must be 0 or 1"
- self.KRV = value
-
- def Set_LZZ(self, value):
- assert value in (1,2,3,4), \
- "must be in range 1-4 (JAHR, MONAT, WOCHE, TAG)"
- self.LZZ = value
-
- def Set_R(self, value):
- assert value >= 0.0 and value <= 100.0, \
- "must be in range 0.0-100.0 (Percent)"
- self.R = value
-
- def Set_SONSTB(self, value):
- self.SONSTB = value
-
- def Set_STKL(self, value):
- assert value in (1,2,3,4,5,6), \
- "must be in range 1-6 (I II III IV V VI)"
- self.STKL = value
-
- def Set_VBEZ(self, value):
- self.VBEZ = value
-
- def Set_VBEZM(self, value):
- self.VBEZM = value
-
- def Set_VBEZS(self, value):
- self.VBEZS = value
-
- def Set_VBS(self, value):
- self.VBS = value
-
- def Set_VMT(self, value):
- self.VMT = value
-
- def Set_WFUNDF(self, value):
- self.WFUNDF = value
-
- def Set_ZKF(self, value):
- assert float(value) == float("%.1f" % value) and \
- value >= 0, \
- "must be positive, and must not have more than one decimal digit"
- self.ZKF = value
-
- def Set_ZMVB(self, value):
- self.ZMVB = value
-
-# --------------------------------------------------------------------
-# Eine etwas schönere API
-#
-# FIX ME: Diese API berücksichtigt nicht alle Möglichen Parameter und
-# Berechnungen, es fehlen insbesondere die Berechnungen zu Mehrjährigen
-# Bezügen und Sonstigen Leistungen.
-
-class LStRechner2005(LST):
- def __init__(self):
- LST.__init__(self)
-
- def SetLohn(self, lohn):
- """Setzt Lohn in Euro.Cent"""
- self.Set_RE4(round (lohn * 100.0))
-
- def GetLohn(self):
- """Liefert Lohn in Euro.Cent"""
- return self.RE4 / 100.0
-
- def SetZeitraum(self, lzz):
- """Setzt Berechnungszeitraum (JAHR, MONAT, WOCHE, TAG)"""
- self.Set_LZZ(lzz)
-
- def GetZeitraum(self):
- """Liefert Berechnungszeitraum (JAHR, MONAT, WOCHE, TAG)"""
- return self.LZZ
-
- def SetSteuerklasse(self, stkl):
- """Setzt Steuerklasse (I, II, III, IV, V, VI)"""
- self.Set_STKL(stkl)
-
- def GetSteuerklasse(self):
- """Liefert Steuerklasse (I, II, III, IV, V, VI)"""
- return self.STKL
-
- def SetKirchensteuerProzent(self, prozent):
- """Setzt Kirchensteuer in Prozent,
- 0 wenn keine Kirchensteuer zu zahlen ist."""
- self.Set_R(prozent)
-
- def GetKirchensteuerProzent(self):
- """Liefert Kirchensteuer in Prozent
- oder 0 wenn keine Kirchensteuer zu zahlen ist."""
- return self.R
-
- def SetKinderfreibetrag(self, kfb):
- """Setzt Kinderfreibetrag lt. Lohnsteuerkarte"""
- self.Set_ZKF(kfb)
-
- def GetKinderfreibetrag(self):
- """Liefert Kinderfreibetrag lt. Lohnsteuerkarte"""
- return self.ZFK
-
- def GetLohnsteuer(self):
- """Liefert Lohnsteuer in Euro.Cent"""
- return round(self.LSTLZZ / 100, 2)
-
- def GetSoli(self):
- """Liefert Solidaritätszuschlag in Euro.Cent"""
- return FixedPointFloor(self.SOLZLZZ / 100, 2)
-
- def GetKirchensteuer(self):
- """Liefert Kirchensteuer in Euro.Cent"""
- return FixedPointFloor(self.BK * self.R / 10000, 2)
Deleted: LST2006.py
===================================================================
--- LST2006.py 2006-01-30 08:23:04 UTC (rev 59)
+++ LST2006.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,880 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-# --------------------------------------------------------------------
-# LST2006 -- Python Modul zur Berechnung der Deutschen Lohnsteuer 2006
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005, 2006 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Lohnsteuerberechnung nach dem offiziellen Programmablaufplan
- wie im offiziellen Programmablaufplan des Bundesfinanzministerium
- dokumentiert.
- http://www.bundesfinanzministerium.de/Service/Interaktiver-Steuerrechner-.577.htm"""
-
-__version__ = "$Revision$"
-# $Source$
-
-def _ModulVersion():
- return __version__[11:-2]
-
-# Die Variablen Namen sind hässlich, die Algorithmen nicht
-# dokumentiert, der Code grausam -- dafür entspricht alles Zeile für
-# Zeile obigem Dokument. Jedenfalls sollte es so sein...
-
-from math import ceil, floor
-
-# Wir brauchen eigene Rundungsfunktionen mit definierter Präzision
-def FixedPointFloor(value, precision=2):
- i = 10.0 ** precision
- return floor(value * i) / i
-
-def FixedPointCeil(value, precision=2):
- i = 10.0 ** precision
- return ceil(value * i) / i
-
-# Ein paar Konstanten um das ganze etwas Benutzbarer zu machen:
-JAHR = 1
-MONAT = 2
-WOCHE = 3
-TAG = 4
-I = 1
-II = 2
-III = 3
-IV = 4
-V = 5
-VI = 6
-
-class LST:
- def __init__(self,
- AJAHR =1964,
- ALTER1=0,
- HINZUR=0,
- JFREIB=0,
- JHINZU=0,
- JRE4 =0,
- JVBEZ =0,
- KRV =0,
- LZZ =2,
- R =0,
- RE4 =0,
- SONSTB=0,
- STERBE=0,
- STKL =1,
- VBEZ =0,
- VBEZM =0,
- VBEZS =0,
- VBS =0,
- VJAHR =0,
- VKAPA =0,
- VMT =0,
- WFUNDF=0,
- ZKF =0,
- ZMVB =0):
- self.Set_AJAHR(AJAHR)
- self.Set_ALTER1(ALTER1)
- self.Set_HINZUR(HINZUR)
- self.Set_JFREIB(JFREIB)
- self.Set_JHINZU(JHINZU)
- self.Set_JRE4(JRE4)
- self.Set_JVBEZ(JVBEZ)
- self.Set_KRV(KRV)
- self.Set_LZZ(LZZ)
- self.Set_R(R)
- self.Set_RE4(RE4)
- self.Set_SONSTB(SONSTB)
- self.Set_STERBE(STERBE)
- self.Set_STKL(STKL)
- self.Set_VBEZ(VBEZ)
- self.Set_VBEZM(VBEZM)
- self.Set_VBEZS(VBEZS)
- self.Set_VBS(VBS)
- self.Set_VJAHR(VJAHR)
- self.Set_VKAPA(VKAPA)
- self.Set_VMT(VMT)
- self.Set_WFUNDF(WFUNDF)
- self.Set_ZKF(ZKF)
- self.Set_ZMVB(ZMVB)
- # Vorgegebene Ausgangsparameter
- self.BK = 0
- self.BKS = 0
- self.BKV = 0
- self.LSTLZZ = 0
- self.SOLZLZZ = 0
- self.SOLZS = 0
- self.SOLZV = 0
- self.STS = 0
- self.STV = 0
-
- def Calc(self):
- """Berechnet die Lohnsteuer,
- setzt BK, BKS, BKV, LSTLZZ, SOLZLZZ, SOLZS, SOLZV, STS und STV"""
- # Interne Felder
- # Laut Dokumentation sollen diese vor der Berechnung gelöscht werden,
- # es ist mir nicht klar, ob das wirklich nötig ist...
- self._ALTE = 0
- self._ANP = 0
- self._ANTEIL1 = 0
- self._ANTEIL2 = 0
- self._BMG = 0
- self._DIFF = 0
- self._EFA = 0
- self._FVB = 0
- self._FVBZ = 0
- self._HFVB = 0
- self._J = 0
- self._JBMG = 0
- self._JW = 0
- self._K = 0
- self._KENNZ = 0
- self._KFB = 0
- self._KZTAB = 1
- self._LSTJAHR = 0
- self._LST1 = 0
- self._LST2 = 0
- self._LST3 = 0
- self._MIST = 0
- self._RE4LZZ = 0
- self._RE4LZZV = 0
- self._RW = 0.0
- self._SAP = 0
- self._SOLZFREI = 0
- self._SOLZJ = 0.0 # 2 Dezimalstellen
- self._SOLZMIN = 0.0 # 2 Dezimalstellen
- self._ST = 0
- self._ST1 = 0
- self._ST2 = 0
- self._TAB1=(None, # 1 als erstes Element, wie im PAP
- 0.400, # bis 2005
- 0.384, # 2006
- 0.368, # 2007
- 0.352, # 2008
- 0.336, # 2009
- 0.320, # 2010
- 0.304, # 2011
- 0.288, # 2012
- 0.272, # 2013
- 0.256, # 2014
- 0.240, # 2015
- 0.224, # 2016
- 0.208, # 2017
- 0.192, # 2018
- 0.176, # 2019
- 0.160, # 2020
- 0.152, # 2021
- 0.144, # 2022
- 0.136, # 2023
- 0.128, # 2024
- 0.120, # 2025
- 0.112, # 2026
- 0.104, # 2027
- 0.096, # 2028
- 0.088, # 2029
- 0.080, # 2030
- 0.072, # 2031
- 0.064, # 2032
- 0.056, # 2033
- 0.048, # 2034
- 0.040, # 2035
- 0.032, # 2036
- 0.024, # 2037
- 0.016, # 2038
- 0.008, # 2039
- 0.000) # 2040
- self._TAB2=(None, # 1 als erstes Element, wie im PAP
- 3000, # bis 2005
- 2880, # 2006
- 2760, # 2007
- 2640, # 2008
- 2520, # 2009
- 2400, # 2010
- 2280, # 2011
- 2160, # 2012
- 2040, # 2013
- 1920, # 2014
- 1800, # 2015
- 1680, # 2016
- 1560, # 2017
- 1440, # 2018
- 1320, # 2019
- 1200, # 2020
- 1140, # 2021
- 1080, # 2022
- 1020, # 2023
- 960, # 2024
- 900, # 2025
- 840, # 2026
- 780, # 2027
- 720, # 2028
- 660, # 2029
- 600, # 2030
- 540, # 2031
- 480, # 2032
- 420, # 2033
- 360, # 2034
- 300, # 2035
- 240, # 2036
- 180, # 2037
- 120, # 2038
- 60, # 2039
- 0) # 2040
- self._TAB3=(None, # 1 als erstes Element, wie im PAP
- 900, # bis 2005
- 864, # 2006
- 828, # 2007
- 792, # 2008
- 756, # 2009
- 720, # 2010
- 684, # 2011
- 648, # 2012
- 612, # 2013
- 576, # 2014
- 540, # 2015
- 504, # 2016
- 468, # 2017
- 432, # 2018
- 396, # 2019
- 360, # 2020
- 342, # 2021
- 324, # 2022
- 306, # 2023
- 288, # 2024
- 270, # 2025
- 252, # 2026
- 234, # 2027
- 216, # 2028
- 198, # 2029
- 180, # 2030
- 162, # 2031
- 144, # 2032
- 126, # 2033
- 108, # 2034
- 90, # 2035
- 72, # 2036
- 54, # 2037
- 36, # 2038
- 18, # 2039
- 0) # 2040
- self._TAB4=self._TAB1
- self._TAB5=(None, # 1 als erstes Element, wie im PAP
- 1900, # bis 2005
- 1824, # 2006
- 1748, # 2007
- 1672, # 2008
- 1596, # 2009
- 1520, # 2010
- 1444, # 2011
- 1368, # 2012
- 1292, # 2013
- 1216, # 2014
- 1140, # 2015
- 1064, # 2016
- 988, # 2017
- 912, # 2018
- 836, # 2019
- 760, # 2020
- 722, # 2021
- 684, # 2022
- 646, # 2023
- 608, # 2024
- 570, # 2025
- 532, # 2026
- 494, # 2027
- 456, # 2028
- 418, # 2029
- 380, # 2030
- 342, # 2031
- 304, # 2032
- 266, # 2033
- 228, # 2034
- 190, # 2035
- 152, # 2036
- 114, # 2037
- 76, # 2038
- 38, # 2039
- 0) # 2040
- self._VBEZB = 0
- self._VHB = 0
- self._VSP = 0.0 # 2 Dezimalstellen
- self._VSPN = 0
- self._VSP1 = 0.0 # 2 Dezimalstellen
- self._VSP2 = 0.0 # 2 Dezimalstellen
- self._VSPKURZ = 0
- self._VSPMAX1 = 0
- self._VSPMAX2 = 0
- self._VSPO = 0.0 # 2 Dezimalstellen
- self._VSPREST = 0.0 # 2 Dezimalstellen
- self._VSPVOR = 0.0 # 2 Dezimalstellen
- self._X = 0.0 # 2 Dezimalstellen
- self._Y = 0.0 # 6 Dezimalstellen
- self._ZRE4 = 0.0 # 2 Dezimalstellen
- self._ZRE4VP = 0.0 # 2 Dezimalstellen
- self._ZRE4VP1 = 0.0 # 2 Dezimalstellen
- self._ZTABFB = 0
- self._ZVBEZ = 0
- self._ZVE = 0
- self._ZX = 0
- self._ZZX = 0
- self._HOCH = 0
- self._VERGL = 0
- # ------------------------------------------------------------
- # Anfang der Berechnung
- self._MRE4LZZ()
- self._KENNZ = 0
- self._RE4LZZ = self.RE4 - self._FVB \
- - self._ALTE - self.WFUNDF \
- + self.HINZUR
- self._RE4LZZV = self.RE4 - self._FVB - self._ALTE
- self._MRE4()
- self._MZTABFB()
- self._MLSTJAHR()
- self._LSTJAHR = self._ST
- self._JW = self._LSTJAHR * 100
- self._UPANTEIL()
- self.LSTLZZ = self._ANTEIL1
- if self.ZKF > 0:
- self._ZTABFB += self._KFB
- self._MLSTJAHR()
- self._JBMG = self._ST
- else:
- self._JBMG = self._LSTJAHR
- self._MSOLZ()
- self._MSONST()
- self._MVMT()
-
- # Benutzte Unterprogramme:
- def _MRE4LZZ(self):
- if self.VBEZ == 0:
- self._FVBZ = 0
- self._FVB = 0
- else:
- if self.VJAHR < 2006:
- self._J = 1
- elif self.VJAHR < 2040:
- self._J = VJAHR - 2004
- else:
- self._J = 36
- if self.LZZ == 1:
- if ( self.STERBE + self.VKAPA ) > 0:
- self._VBEZB = self.VBEZM * self.ZMVB + self.VBEZS
- self._HFVB = self._TAB2[self._J] * 100
- self._FVBZ = self._TAB3[self._J]
- else:
- self._VBEZB = self.VBEZM * self.ZMVB + self.VBEZS
- self._HFVB = self._TAB2[self._J] / 12 * self.ZMVB * 100
- self._FVBZ = ceil(self._TAB3[self._J] / 12 * self.ZMVB)
- else:
- self._VBEZB = self.VBEZM * 12 + self.VBEZS
- self._HFVB = self._TAB2[self._J] * 100
- self._FVBZ = self._TAB3[self._J]
- self._FVB = ceil(self._VBEZB * self._TAB1[self._J])
- if self._FVB > self._HFVB:
- self._FVB = self._HFVB
- self._JW = self._FVB
- self._UPANTEIL()
- self._FVB = self._ANTEIL2
- if self.ALTER1 == 0:
- self._ALTE = 0
- else:
- if self.AJAHR < 2006:
- self._K = 1
- elif self.AJAHR < 2040:
- self._K = self.AJAHR - 2004
- else:
- self._K = 36
- self._BMG = self.RE4 - self.VBEZ
- self._ALTE = ceil(self._BMG * self._TAB4[self._K])
- self._JW = self._TAB5[self._K] * 100
- self._UPANTEIL()
- if self._ALTE > self._ANTEIL2:
- self._ALTE = self._ANTEIL2
-
- def _MRE4(self):
- if self.LZZ == 1:
- self._ZRE4 = FixedPointFloor(self._RE4LZZ / 100.0)
- self._ZRE4VP = FixedPointFloor(self._RE4LZZV / 100.0)
- self._ZVBEZ = FixedPointFloor((self.VBEZ - self._FVB) / 100.0)
- elif self.LZZ == 2:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.67) * 0.12)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.67) * 0.12)
- self._ZVBEZ = FixedPointFloor((self.VBEZ - self._FVB + 0.67) * 0.12)
- elif self.LZZ == 3:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.89) * 3.6 / 7)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.89) * 3.6 / 7)
- self._ZVBEZ = FixedPointFloor((self.VBEZ - self._FVB + 0.89) * 3.6 / 7)
- else:
- self._ZRE4 = FixedPointFloor((self._RE4LZZ + 0.56) * 3.6)
- self._ZRE4VP = FixedPointFloor((self._RE4LZZV + 0.56) * 3.6)
- self._ZVBEZ = FixedPointFloor((self.VBEZ - self._FVB + 0.56) * 3.6)
- if self._ZRE4 < 0:
- self._ZRE4 = 0.0
- if self._ZVBEZ < 0:
- self._ZVBEZ = 0.0
-
- def _MZTABFB(self):
- self._ANP = 0
- if (self._ZVBEZ > 0) and (self._ZVBEZ < self._FVBZ):
- self._FVBZ = self._ZVBEZ
- if (self.STKL < 6) and (self._ZVBEZ > 0):
- if (self._ZVBEZ - self._FVBZ) < 102:
- self._ANP = self._ZVBEZ - self._FVBZ
- else:
- self._ANP = 102
- if (self.STKL < 6) and (self._ZRE4 > self._ZVBEZ):
- if (self._ZRE4 - self._ZVBEZ) < 920:
- self._ANP = self._ANP + self._ZRE4 - self._ZVBEZ
- else:
- self._ANP = self._ANP + 920
- self._KZTAB = 1
- if self.STKL == 1:
- self._SAP = 36
- self._KFB = self.ZKF * 5808
- elif self.STKL == 2:
- self._EFA = 1308
- self._SAP = 36
- self._KFB = self.ZKF * 5808
- elif self.STKL == 3:
- self._KZTAB = 2
- self._SAP = 72
- self._KFB = self.ZKF * 5808
- elif self.STKL == 4:
- self._SAP = 36
- self._KFB = self.ZKF * 2904
- else:
- self._KFB = 0
- self._ZTABFB = self._EFA + self._ANP + self._SAP + self._FVBZ
-
- def _MLSTJAHR(self):
- if self.STKL < 5:
- self._UPEVP()
- else:
- self._VSP = 0.0
- self._ZVE = self._ZRE4 - self._ZTABFB - self._VSP
- if self._ZVE < 1:
- self._ZVE = self._X = 0.0
- else:
- self._X = floor(float(self._ZVE) / self._KZTAB)
- if self.STKL < 5:
- self._UPTAB05()
- else:
- self._MST5_6()
-
- def _UPEVP(self):
- if self.KRV == 1:
- self._VSP1 = 0.0
- else:
- if self._ZRE4VP > 63000:
- self._ZRE4VP = 63000
- self._VSP1 = 0.24 * self._ZRE4VP
- self._VSP1 = FixedPointFloor(self._VSP1 * 0.0975)
- self._VSP2 = FixedPointFloor(0.11 * self._ZRE4VP)
- self._VHB = 1500 * self._KZTAB
- if self._VSP2 > self._VHB:
- self._VSP2 = self._VHB
- self._VSPN = ceil(self._VSP1 + self._VSP2)
- self._MVSP()
- if self._VSPN > self._VSP:
- self._VSP = self._VSPN
-
- def _MVSP(self):
- if self._KENNZ == 1:
- self._VSPO = self._ZRE4VP1 * 0.2
- else:
- self._VSPO = self._ZRE4VP * 0.2
- self._VSPVOR = 3068 * self._KZTAB
- self._VSPMAX1 = 1334 * self._KZTAB
- self._VSPMAX2 = 667 * self._KZTAB
- self._VSPKURZ = 1134 * self._KZTAB
- if self.KRV == 1:
- if self._VSPO > self._VSPKURZ:
- self._VSP = self._VSPKURZ
- else:
- self._VSP = ceil(self._VSPO)
- else:
- self._UMVSP()
-
- def _UMVSP(self):
- if self._KENNZ == 1:
- self._VSPVOR = self._VSPVOR - self._ZRE4VP1 * 0.16
- else:
- self._VSPVOR = self._VSPVOR - self._ZRE4VP * 0.16
- if self._VSPVOR < 0:
- self._VSPVOR = 0.0
- if self._VSPO > self._VSPVOR:
- self._VSP = self._VSPVOR
- self._VSPREST = self._VSPO - self._VSPVOR
- if self._VSPREST > self._VSPMAX1:
- self._VSP += self._VSPMAX1
- self._VSPREST = FixedPointCeil((self._VSPREST - self._VSPMAX1) / 2.0)
- if self._VSPREST > self._VSPMAX2:
- self._VSP = ceil(self._VSP + self._VSPMAX2)
- else:
- self._VSP = ceil(self._VSP + self._VSPREST)
- else:
- self._VSP = ceil(self._VSP + self._VSPREST)
- else:
- self._VSP = ceil(self._VSPO)
-
- def _MST5_6(self):
- self._ZZX = self._X
- if self._ZZX > 25812:
- self._ZX = 25812
- self._UP5_6()
- self._ST = floor(self._ST + (self._ZZX - 25812) * 0.42)
- else:
- self._ZX = self._ZZX
- self._UP5_6()
- if self._ZZX > 9144:
- self._VERGL = self._ST
- self._ZX = 9144
- self._UP5_6()
- self._HOCH = floor(self._ST + (self._ZZX - 9144) * 0.42)
- if self._HOCH < self._VERGL:
- self._ST = self._HOCH
- else:
- self._ST = self._VERGL
-
- def _UP5_6(self):
- self._X = self._ZX * 1.25
- self._UPTAB05()
- self._ST1 = self._ST
- self._X = self._ZX * 0.75
- self._UPTAB05()
- self._ST2 = self._ST
- self._DIFF = (self._ST1 - self._ST2) * 2
- self._MIST = floor(self._ZX * 0.15)
- if self._MIST > self._DIFF:
- self._ST = self._MIST
- else:
- self._ST = self._DIFF
-
- def _MSOLZ(self):
- self._SOLZFREI = 972 * self._KZTAB
- if self._JBMG > self._SOLZFREI:
- self._SOLZJ = FixedPointFloor(self._JBMG * 5.5 / 100.0)
- self._SOLZMIN = (self._JBMG - self._SOLZFREI) * 20 / 100.0
- if self._SOLZMIN < self._SOLZJ:
- self._SOLZJ = self._SOLZMIN
- self._JW = self._SOLZJ * 100
- self._UPANTEIL()
- self.SOLZLZZ = self._ANTEIL1
- else:
- self.SOLZLZZ = 0
- if self.R > 0:
- self._JW = self._JBMG * 100
- self._UPANTEIL()
- self.BK = self._ANTEIL1
- else:
- self.BK = 0
-
- def _UPANTEIL(self):
- if self.LZZ == 1:
- self._ANTEIL1 = self._JW
- self._ANTEIL2 = self._JW
- elif self.LZZ == 2:
- self._ANTEIL1 = floor(self._JW / 12.0)
- self._ANTEIL2 = ceil(self._JW / 12.0)
- elif self.LZZ == 3:
- self._ANTEIL1 = floor(self._JW * 7 / 360.0)
- self._ANTEIL2 = ceil(self._JW * 7 / 360.0)
- else:
- self._ANTEIL1 = floor(self._JW / 360.0)
- self._ANTEIL2 = ceil(self._JW / 360.0)
-
- def _UPTAB05(self):
- if self._X < 7665:
- self._ST = 0
- elif self._X < 12740:
- self._Y = (self._X - 7664) / 10000.0
- self._RW = self._Y * 883.74
- self._RW += 1500
- self._ST = floor(self._RW * self._Y)
- elif self._X < 52152:
- self._Y = (self._X - 12739) / 10000.0
- self._RW = self._Y * 228.74
- self._RW += 2397
- self._RW *= self._Y
- self._ST = floor(self._RW + 989)
- else:
- self._ST = floor(self._X * 0.42 - 7914)
- self._ST *= self._KZTAB
-
- def _MSONST(self):
- if self.SONSTB > 0:
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute sichern
- old_lzz = self.LZZ
- old_vbez = self.VBEZ
- old_re4 = self.RE4
- # ------------------------------
- self.LZZ = 1
- self.VBEZ = self.JVBEZ
- self.RE4 = self.JRE4
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MLSTJAHR()
- self._LST1 = self._ST * 100
- self.VBEZ = self.JVBEZ + self.VBS
- self.RE4 = self.JRE4 + self.SONSTB
- self.VBEZS = self.VBEZS + self.STERBE
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MLSTJAHR()
- self._LST2 = self._ST * 100
- self.STS = self._LST2 - self._LST1
- self.SOLZS = floor(self.STS * 5.5 / 100)
- if self.R > 0:
- self.BKS = self.STS
- else:
- self.BKS = 0
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute
- # wiederherstellen
- self.LZZ = old_lzz
- self.VBEZ = old_vbez
- self.RE4 = old_re4
- # ------------------------------
- else:
- self.STS = 0
- self.SOLZS = 0
- self.BKS = 0
-
- def _MRE4LZZ2(self):
- self._RE4LZZ = self.RE4 - self._FVB - self._ALTE \
- - self.JFREIB + self.JHINZU
- self._RE4LZZV = self.RE4 - self._FVB - self._ALTE
- self._MRE4()
- self._MZTABFB()
-
- def _MVMT(self):
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute sichern
- old_lzz = self.LZZ
- old_vbez = self.VBEZ
- old_re4 = self.RE4
- # ------------------------------
- if (self.VMT + self.VKAPA) > 0:
- self.LZZ = 1
- self.VBEZ = self.JVBEZ + self.VBS
- self.RE4 = self.JRE4 + self.SONSTB
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._MLSTJAHR()
- self._LST1 = self._ST * 100
- self.VMT = self.VMT + self.VKAPA
- self.VBEZS = self.VBEZS + self.VKAPA
- self.VBEZ = self.VBEZ + self.VKAPA
- self.RE4 = self.JRE4 + self.SONSTB + self.VMT
- self._MRE4LZZ()
- self._MRE4LZZ2()
- self._KENNZ = 1
- self._ZRE4VP1 = self._ZRE4VP
- self._MLSTJAHR()
- self._LST3 = self._ST * 100
- self.VBEZ = self.VBEZ - self.VKAPA
- self.RE4 = self.JRE4 + self.SONSTB
- self._MRE4LZZ()
- if (self.RE4 - self.JFREIB + self.JHINZU) < 0:
- self.RE4 = self.RE4 - self.JFREIB + self.JHINZU
- self.JFREIB = 0
- self.JHINZU = 0
- self.RE4 = (self.RE4 + self.VMT) / 5
- self._MRE4LZZ2()
- self._MLSTJAHR()
- self._LST2 = self._ST * 100
- self.STV = self._LST2 * 5
- else:
- self.RE4 = self.RE4 + self.VMT / 5
- self._MRE4LZZ2()
- self._MLSTJAHR()
- self._LST2 = self._ST * 100
- self.STV = (self._LST2 - self._LST1) * 5
- self._LST3 -= self._LST1
- if self._LST3 < self.STV:
- self.STV = self._LST3
- self.SOLZV = floor(self.STV * 5.5 / 100)
- if self.R > 0:
- self.BKV = self.STV
- else:
- self.BKV = 0
- # ------------------------------
- # Nicht im offiziellen Programm-
- # ablaufplan: Attribute
- # wiederherstellen
- self.LZZ = old_lzz
- self.VBEZ = old_vbez
- self.RE4 = old_re4
- # ------------------------------
- else:
- self.STV = 0
- self.SOLZV = 0
- self.BKV = 0
-
- # Methoden zum geprüften setzen der Wert
- # FIX ME: Prüfung _sehr_ unvollständig
-
- def Set_AJAHR(self, value):
- assert type(value) == type(0), "must be integer"
- assert value >= 1900, "must be greater than 1900"
- self.AJAHR = value
-
- def Set_ALTER1(self, value):
- assert value in (0,1), "must be 0 or 1"
- self.ALTER1 = value
-
- def Set_HINZUR(self, value):
- self.HINZUR = value
-
- def Set_JFREIB(self, value):
- self.JFREIB = value
-
- def Set_JHINZU(self, value):
- self.JHINZU = value
-
- def Set_JRE4(self, value):
- self.JRE4 = value
-
- def Set_JVBEZ(self, value):
- self.JVBEZ = value
-
- def Set_KRV(self, value):
- assert value in (0,1), "must be 0 or 1"
- self.KRV = value
-
- def Set_LZZ(self, value):
- assert value in (1,2,3,4), \
- "must be in range 1-4 (JAHR, MONAT, WOCHE, TAG)"
- self.LZZ = value
-
- def Set_R(self, value):
- assert value >= 0.0 and value <= 100.0, \
- "must be in range 0.0-100.0 (Percent)"
- self.R = value
-
- def Set_RE4(self, value):
- assert value >= 0, "must not be negative"
- self.RE4 = value
-
- def Set_SONSTB(self, value):
- self.SONSTB = value
-
- def Set_STERBE(self, value):
- self.STERBE = value
-
- def Set_STKL(self, value):
- assert value in (1,2,3,4,5,6), \
- "must be in range 1-6 (I II III IV V VI)"
- self.STKL = value
-
- def Set_VBEZ(self, value):
- self.VBEZ = value
-
- def Set_VBEZM(self, value):
- self.VBEZM = value
-
- def Set_VBEZS(self, value):
- self.VBEZS = value
-
- def Set_VBS(self, value):
- self.VBS = value
-
- def Set_VJAHR(self, value):
- self.VJAHR = value
-
- def Set_VKAPA(self, value):
- self.VKAPA = value
-
- def Set_VMT(self, value):
- self.VMT = value
-
- def Set_WFUNDF(self, value):
- self.WFUNDF = value
-
- def Set_ZKF(self, value):
- assert float(value) == float("%.1f" % value) and \
- value >= 0, \
- "must be positive, and must not have more than one decimal digit"
- self.ZKF = value
-
- def Set_ZMVB(self, value):
- self.ZMVB = value
-
-# --------------------------------------------------------------------
-# Eine etwas schönere API
-#
-# FIX ME: Diese API berücksichtigt nicht alle Möglichen Parameter und
-# Berechnungen, es fehlen insbesondere die Berechnungen zu Mehrjährigen
-# Bezügen und Sonstigen Leistungen.
-
-class LStRechner2006(LST):
- def __init__(self):
- LST.__init__(self)
-
- def SetGeb(self, geb):
- """Setzt das Geburtsjahr"""
- self.Set_AJAHR(geb + 65)
- if self.AJAHR <= 2006:
- self.Set_ALTER1(1)
- else:
- self.Set_ALTER1(0)
-
- def SetLohn(self, lohn):
- """Setzt Lohn in Euro.Cent"""
- self.Set_RE4(round (lohn * 100.0))
-
- def GetLohn(self):
- """Liefert Lohn in Euro.Cent"""
- return self.RE4 / 100.0
-
- def SetZeitraum(self, lzz):
- """Setzt Berechnungszeitraum (JAHR, MONAT, WOCHE, TAG)"""
- self.Set_LZZ(lzz)
-
- def GetZeitraum(self):
- """Liefert Berechnungszeitraum (JAHR, MONAT, WOCHE, TAG)"""
- return self.LZZ
-
- def SetSteuerklasse(self, stkl):
- """Setzt Steuerklasse (I, II, III, IV, V, VI)"""
- self.Set_STKL(stkl)
-
- def GetSteuerklasse(self):
- """Liefert Steuerklasse (I, II, III, IV, V, VI)"""
- return self.STKL
-
- def SetKirchensteuerProzent(self, prozent):
- """Setzt Kirchensteuer in Prozent,
- 0 wenn keine Kirchensteuer zu zahlen ist."""
- self.Set_R(prozent)
-
- def GetKirchensteuerProzent(self):
- """Liefert Kirchensteuer in Prozent
- oder 0 wenn keine Kirchensteuer zu zahlen ist."""
- return self.R
-
- def SetKinderfreibetrag(self, kfb):
- """Setzt Kinderfreibetrag lt. Lohnsteuerkarte"""
- self.Set_ZKF(kfb)
-
- def GetKinderfreibetrag(self):
- """Liefert Kinderfreibetrag lt. Lohnsteuerkarte"""
- return self.ZFK
-
- def GetLohnsteuer(self):
- """Liefert Lohnsteuer in Euro.Cent"""
- return round(self.LSTLZZ / 100, 2)
-
- def GetSoli(self):
- """Liefert Solidaritätszuschlag in Euro.Cent"""
- return FixedPointFloor(self.SOLZLZZ / 100, 2)
-
- def GetKirchensteuer(self):
- """Liefert Kirchensteuer in Euro.Cent"""
- return FixedPointFloor(self.BK * self.R / 10000, 2)
Deleted: NEWS
===================================================================
--- NEWS 2006-01-30 08:23:04 UTC (rev 59)
+++ NEWS 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,29 +0,0 @@
--*-text-*-
-
-lohnrechner-20060125:
-
- lohnrechner.py benutzt jetzt das neue Modul LST2006 und
- berechnet die Steuern nunmehr nach den für 2006 geltenden
- Vorgaben.
-
- Neu hinzugekommen ist das Feld "Geburtsdatum", das für die
- vollständige Berechnung nach den für 2006 geltenden
- Vorschriften notwendig ist.
-
-lohnrechner-20051102:
-
- Ein neuer Schalter "Krankenkassenzuschlag (0.9%)" ist
- hinzugekommen und standardmäßig eingeschaltet.
-
- Seit dem 1. Juni 2005 wurde die
- Krankenkassen-Beitragsberechnung geändert: Die Beitragssetze
- (die paritätisch von Arbeitnehmer und Arbeitgeber zu
- entrichten sind) aller Kassen wurden um 0.9% gesenkt, dafür
- wird ein zusätzlicher Beitrag in Höhe von 0.9% erhoben, der
- ausschließlich durch die Arbeitnehmer zu entrichten ist.
-
- Mit dem neuen Schalter "Krankenkassenzuschlag (0.9%)" kann
- dieser neue Beitrag in die Berechnung einbezogen werden.
-
- WICHTIG: der neue Beitragssatz ist weiterhin manuell unter
- "Krankenkassenbeitrag" einzutragen.
Deleted: Programmablaufplan.txt
===================================================================
--- Programmablaufplan.txt 2006-01-30 08:23:04 UTC (rev 59)
+++ Programmablaufplan.txt 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,6 +0,0 @@
-Der offizielle Programmablaufplan des Bundesfinanzministerium
-kann unter
-
-http://www.bundesfinanzministerium.de/cln_04/nn_3792/DE/Service/Abgabenrechner/10820.html
-
-kostenfrei als PDF-Datei geladen werden.
Deleted: README
===================================================================
--- README 2006-01-30 08:23:04 UTC (rev 59)
+++ README 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,52 +0,0 @@
-$Id$
-
-Es wird ausdrücklich darauf hingewiesen, dass die Intevation GmbH keine
-Garantie für die korrekte Berechnung der ausgegebenen Werte übernimmt!
-Die Software dient der Information und implementiert dazu den
-Programmablaufplan des Bundesfinanzministeriums. Über die dort angegeben
-simplen Testfälle hinaus wurden jedoch keine weiteren Tests auf Korrektheit
-durchgeführt!
-
-
-lohnrechner.py
---------------
-
-Ist ein Python Modul zur Berechnung der Steuern und Sozialabgaben und des
-daraus resultierenden Nettolohns. Es bietet eine einfache grafische
-Oberfläche auf Basis von Tkinter.
-
-Zur Berechnung von Lohnsteuer, Solidaritätszuschlag und Kirchensteuer
-wird LST2006.py verwendet.
-
-
-LST2006.py
-----------
-
-Ist ein Python Modul zur Berechnung von Einkommens- und Lohnsteuer
-2006. Es handelt sich um eine vollständige Implementation des
-Programmablaufplans des Bundesfinanzministerium. Das Modul berechnet
-alle Werte und Modelle aus dem Programmablaufplan, kann also auch
-Informationen liefern, die von dem grafischen Frontend lohnrechner.py
-nicht zur Verfügung gestellt werden.
-
-
-Download
---------
-
-Die jeweils aktuelle Version des Lohnrechners ist unter
-http://wald.intevation.org/projects/lohnrechner/
-verfügbar.
-
-
-Lizenz
-------
-
-Copyright (C) 2005,2006 Intevation GmbH <intevation at intevation.de>
- Georgstraße 4, D-49074 Osnabrueck,
- Germany
-
-Autor: Sascha Wilde <wilde at intevation.de>
-
-lohnrechner.py und LST2006.py sind Freie Software unter der
-GNU General Public License. Bitte lesen Sie die Datei COPYING.
-
Deleted: lohnrechner.py
===================================================================
--- lohnrechner.py 2006-01-30 08:23:04 UTC (rev 59)
+++ lohnrechner.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,336 +0,0 @@
-#! /usr/bin/python
-# -*- coding: iso-8859-1 -*-
-# --------------------------------------------------------------------
-# Lohnsteuer und Sozialabgaben Rechner
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005,2006 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Lohn/Gehaltsrechner für das Jahr 2006"""
-
-__version__ = "$Revision$"
-# $Source$
-
-_release_version = "0.%s" % __version__[11:-2]
-
-import LST2006
-from Tkinter import *
-
-class Lohnrechner(LST2006.LStRechner2006):
-
- def __init__(self, root):
- LST2006.LStRechner2006.__init__(self)
-
- # Land, Kirchensteuersatz, Pflegeversicherung AG-Anteil
- self.laender = [("Baden-Württemberg", 8, 0.0085),
- ("Bayern", 8, 0.0085),
- ("Berlin", 9, 0.0085),
- ("Brandenburg", 9, 0.0085),
- ("Bremen", 9, 0.0085),
- ("Bremerhaven", 9, 0.0085),
- ("Hamburg", 9, 0.0085),
- ("Hessen", 9, 0.0085),
- ("Mecklenburg-Vorpommern", 9, 0.0085),
- ("Niedersachsen" ,9, 0.0085),
- ("Nordrhein-Westfalen", 9, 0.0085),
- ("Rheinland-Pfalz", 9, 0.0085),
- ("Saarland", 9, 0.0085),
- ("Sachsen", 9, 0.0135),
- ("Sachsen-Anhalt", 9, 0.0085),
- ("Schleswig-Holstein", 9, 0.0085),
- ("Thüringen", 9, 0.0085)]
-
- self.root = root
-
- self.root.title("Lohnrechner 2006 - v%s" % _release_version)
-
- self.SetupUI()
- self.UpdateLand()
- self.InitSozv()
- self.ResetInput()
-
- def SetupUI(self):
- self.root.resizable(NO, NO)
-
- frame = Frame(self.root)
- frame.grid(padx=10, pady=10)
-
- # Steuern Ein/Ausgabe
- Label(frame, text="Geburtsjahr:").grid(row=0, sticky=E)
- self.geb = Entry(frame)
- self.geb.bind("<Return>", self.NewInput)
- self.geb.grid(row=0, column=1, sticky=W)
-
- Label(frame, text="Lohn (monatlich):").grid(row=1, sticky=E)
- self.lohn = Entry(frame)
- self.lohn.bind("<Return>", self.NewInput)
- self.lohn.grid(row=1, column=1, sticky=W)
-
- Label(frame, text="Steuerklasse:").grid(row=2, sticky=E)
- self.stkl = IntVar()
- stklframe = Frame(frame)
- stklframe.grid(row=2, column=1, sticky=W)
- for text, val in [("I", 1),
- ("II", 2),
- ("III", 3),
- ("IV", 4),
- ("V", 5),
- ("VI", 6)]:
- stklradio = Radiobutton(stklframe, text=text, value=val,
- indicatoron=0, command=self.NewInput,
- variable=self.stkl)
- if text == "I":
- stklradio.select()
- stklradio.pack(side=LEFT)
-
- Label(frame, text="Kirchensteuer:").grid(row=3, sticky=E)
- self.kirche = IntVar()
- Checkbutton(frame, onvalue=1, offvalue=0, command=self.NewInput,
- variable=self.kirche).grid(row=3, column=1,sticky=W)
-
- Label(frame, text="Kinderfreibetrag:").grid(row=4, sticky=E)
- self.kfb = Entry(frame)
- self.kfb.bind("<Return>", self.NewInput)
- self.kfb.grid(row=4, column=1, sticky=W)
-
- Label(frame, text="Bundesland:").grid(row=5, sticky=NE)
- landframe = Frame(frame)
- scrollbar = Scrollbar(landframe, orient=VERTICAL)
- self.landbox = Listbox(landframe, height=4, selectmode=SINGLE,
- yscrollcommand=scrollbar.set)
- for land in self.laender:
- self.landbox.insert(END, land[0])
- self.landbox.select_set(0)
- self.landbox.bind("<<ListboxSelect>>", self.NewLandSel)
- self.landbox.pack(side=RIGHT, fill=Y)
- scrollbar.config(command=self.landbox.yview)
- scrollbar.pack(side=LEFT, fill=BOTH, expand=1)
- landframe.grid(row=5, rowspan=4, column=1, sticky=W)
-
- Label(frame, text="Lohnsteuer:").grid(row=0, column=2, sticky=E)
- self.lst = Entry(frame)
- self.lst.grid(row=0, column=3, sticky=W)
-
- Label(frame, text="Solidaritätszuschlag:").grid(row=1, column=2, sticky=E)
- self.soli = Entry(frame)
- self.soli.grid(row=1, column=3, sticky=W)
-
- Label(frame, text="Kirchensteuer:").grid(row=2, column=2, sticky=E)
- self.kist = Entry(frame)
- self.kist.grid(row=2, column=3, sticky=W)
-
- Label(frame, text="Lohn nach Steuern:").grid(row=3, column=2, sticky=E)
- self.netto1 = Entry(frame)
- self.netto1.grid(row=3, column=3, sticky=W)
-
- # Sozialversicherung Ein/Ausgabe
- Label(frame, text="Sozialversicherung:").grid(row=9, sticky=E)
- self.sozv = IntVar()
- sozvradio = Checkbutton(frame, onvalue=1, offvalue=0,
- command=self.NewInput, variable=self.sozv)
- sozvradio.select()
- sozvradio.grid(row=9, column=1, sticky=W)
-
- Label(frame, text="Krankenkassenbeitrag:").grid(row=10, sticky=E)
- self.kvsatz = Entry(frame)
- self.kvsatz.bind("<Return>", self.NewInput)
- self.kvsatz.grid(row=10, column=1, sticky=W)
-
- Label(frame, text="Krankenkassenzuschlag (0.9%):").grid(row=11, sticky=E)
- self.kvsoli = IntVar()
- kvsoliradio = Checkbutton(frame, onvalue=1, offvalue=0,
- command=self.NewInput, variable=self.kvsoli)
- kvsoliradio.select()
- kvsoliradio.grid(row=11, column=1, sticky=W)
-
-
- Label(frame, text="Rentenversicherung:").grid(row=4, column=2, sticky=E)
- self.rv = Entry(frame)
- self.rv.grid(row=4, column=3, sticky=W)
-
- Label(frame, text="Krankenversicherung:").grid(row=5, column=2, sticky=E)
- self.kv = Entry(frame)
- self.kv.grid(row=5, column=3, sticky=W)
-
- Label(frame, text="Arbeitslosenversicherung:").grid(row=6, column=2,
- sticky=E)
- self.av = Entry(frame)
- self.av.grid(row=6, column=3, sticky=W)
-
- Label(frame, text="Pflegeversicherung:").grid(row=7, column=2, sticky=E)
- self.pv = Entry(frame)
- self.pv.grid(row=7, column=3, sticky=W)
-
- Label(frame, text="Netto Lohn:").grid(row=8, column=2, sticky=E)
- self.netto2 = Entry(frame)
- self.netto2.grid(row=8, column=3, sticky=W)
-
- # Allgemeine UI Elemente
- buttons = Frame(frame)
- buttons.grid(row=10, column=2, rowspan=2, columnspan=2)
- Button(buttons, text="Quit", command=self.root.quit).pack(side=LEFT)
- Button(buttons, text="Info", command=self.Info).pack(side=LEFT)
- Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT)
-
- def NewInput(self, event=0):
- # Es ist möglich alle Einträge in der Listbox zu deselektieren,
- # es ist aber immer genau ein Eintrag aktuell, darum wird er ggf.
- # zwangsselektiert:
- # FIX ME: eigendlich wäre das ein Fall für ein custom widget!
- if len(self.landbox.curselection()) == 0:
- self.landbox.select_set(self.land)
- self.CalcOutput()
-
- def UpdateLand(self):
- self.land = int(self.landbox.curselection()[0])
-
- def NewLandSel(self, event=0):
- self.UpdateLand()
- self.CalcOutput()
-
- def ResetInput(self):
- self.ResetInputGeb()
- self.ResetInputLohn()
- self.ResetInputKfb()
- self.ResetInputKVsatz()
- self.NewLandSel()
-
- def ResetInputGeb(self):
- self.geb.delete(0, END)
- self.geb.insert(0, "1964")
-
- def ResetInputLohn(self):
- self.lohn.delete(0, END)
- self.lohn.insert(0, "0")
-
- def ResetInputKfb(self):
- self.kfb.delete(0, END)
- self.kfb.insert(0, "0")
-
- def ResetInputKVsatz(self):
- self.kvsatz.delete(0, END)
- self.kvsatz.insert(0, "13.8")
-
- def InitCalc(self):
- try:
- self.SetLohn(float(self.lohn.get()))
- except:
- self.ResetInputLohn()
-
- try:
- self.SetGeb(int(self.geb.get()))
- except:
- self.ResetInputGeb()
-
- try:
- self.SetKinderfreibetrag(float(self.kfb.get()))
- except:
- self.ResetInputKfb()
-
- try:
- self.SetKV(float(self.kvsatz.get()))
- except:
- self.ResetInputKVsatz()
-
- self.SetSteuerklasse(self.stkl.get())
- self.SetKirchensteuerProzent(self.kirche.get() *
- self.laender[self.land][1])
-
- def CalcOutput(self):
- self.InitCalc()
- self.Calc()
- self.lst.delete(0, END)
- self.lst.insert(0, "%.2f" % self.GetLohnsteuer())
- self.soli.delete(0, END)
- self.soli.insert(0, "%.2f" % self.GetSoli())
- self.kist.delete(0, END)
- self.kist.insert(0, "%.2f" % self.GetKirchensteuer())
- netto1 = self.GetLohn() - self.GetLohnsteuer() \
- - self.GetSoli() - self.GetKirchensteuer()
- self.netto1.delete(0, END)
- self.netto1.insert(0, "%.2f" % netto1)
- self.rv.delete(0, END)
- self.rv.insert(0, "%.2f" % self.GetRV())
- self.pv.delete(0, END)
- self.pv.insert(0, "%.2f" % self.GetPV())
- self.av.delete(0, END)
- self.av.insert(0, "%.2f" % self.GetAV())
- self.kv.delete(0, END)
- self.kv.insert(0, "%.2f" % self.GetKV())
- netto2 = netto1 - self.GetRV() - self.GetAV() \
- - self.GetPV() - self.GetKV()
- self.netto2.delete(0, END)
- self.netto2.insert(0, "%.2f" % netto2)
-
- def Info(self):
- infowin = Toplevel(self.root)
- infowin.title("Info")
- Label(infowin, text="Lohnrechner 2006 v%s" % _release_version,
- font=("Times", 14, "bold italic")).grid(row=0, pady=20)
- Label(infowin, text=
- "Copyright (C) 2005,2006 Intevation GmbH \n\n\
-Lohnrechner 2006 comes with ABSOLUTELY NO WARRANTY.\n\
-This is free software, and you are welcome to redistribute it\n\
-under the terms of the GNU General Public License.\n\
-For more information about these matters, see the file named COPYING.\n\n\
-Dieses Programm verwendet LST2006 %s" % LST2006._ModulVersion()).grid(row=1, padx=10)
- Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10)
-
- #
- # Funktionen zur Berechnung der Sozialversicherungsbeiträge.
- #
- # FIX ME: Dieser Teil könnte evl. in ein eigenes Modul ausgelagert werden.
- #
-
- def InitSozv(self):
- self.AVsatz = 0.065 / 2
- self.RVsatz = 0.195 / 2
- # PVsatz ist in self.laender definiert!
- self.PVkinderlose = 0.0025
- self.BMG1 = 3525
- self.BMG2 = 5200
-
- def SetKV(self, value):
- assert value >= 0.0 and value <= 100.0, \
- "must be in range 0.0-100.0 (Percent)"
- self.KVsatz = (value / 100.0)
-
- def GetAV(self):
- lohn = self.GetLohn()
- if lohn > self.BMG2 : lohn = self.BMG2
- return round(self.sozv.get() * self.AVsatz * lohn, 2)
-
- def GetRV(self):
- lohn = self.GetLohn()
- if lohn > self.BMG2 : lohn = self.BMG2
- return round(self.sozv.get() * self.RVsatz * lohn, 2)
-
- def GetPV(self):
- self.PVsatz = self.laender[self.land][2]
- lohn = self.GetLohn()
- if lohn > self.BMG1 : lohn = self.BMG1
- PV = self.PVsatz * lohn
- if float(self.kfb.get()) == 0.0 :
- PV += lohn * self.PVkinderlose
- return round(self.sozv.get() * PV, 2)
-
- def GetKV(self):
- self.KVsoli = self.kvsoli.get()
- lohn = self.GetLohn()
- if lohn > self.BMG1 : lohn = self.BMG1
- if self.KVsoli :
- return round(self.sozv.get() * ((self.KVsatz / 2) + 0.009) * lohn, 2)
- else :
- return round(self.sozv.get() * self.KVsatz * lohn / 2, 2)
-
-
-if __name__ == "__main__":
- root = Tk()
- lr = Lohnrechner(root)
- root.mainloop()
Deleted: test_Lohnsteuer.py
===================================================================
--- test_Lohnsteuer.py 2006-01-30 08:23:04 UTC (rev 59)
+++ test_Lohnsteuer.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,98 +0,0 @@
-# --------------------------------------------------------------------
-# UnitTest für die Lohnsteuerberechnung in LST2005
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Unit Test für die Lohnsteuerberechnung in LST2005. Benutzt die
-Daten aus der Prüftabelle zum offiziellen Programmablaufplan zur
-maschinellen Jahreslohnsteürberechnung 2005."""
-
-# ACHTUNG: die Prüftabelle liefert nur Referenzwerte für die
-# Berechnung der Lohnsteuer auf ein Jahr, andere Berechnungßeiträume
-# werden nicht berücksichtigt.
-
-import unittest
-from LST2005 import *
-
-class TestGetLohnsteuer(unittest.TestCase):
-
- def SetUp(self):
- """Offizielle Prüftabelle und LStRechner2005 einrichten"""
- self.prueftabelle = {
- 5000 : [ 0.0, 0.0, 0.0, 0.0, 612.0, 750.0 ],
- 7500 : [ 0.0, 0.0, 0.0, 0.0, 987.0, 1125.0 ],
- 10000: [ 0.0, 0.0, 0.0, 0.0, 1362.0, 1739.0 ],
- 12500: [ 232.0, 18.0, 0.0, 232.0, 2403.0, 2789.0 ],
- 15000: [ 714.0, 444.0, 0.0, 714.0, 3400.0, 3722.0 ],
- 17500: [ 1362.0, 1043.0, 0.0, 1362.0, 4266.0, 4576.0 ],
- 20000: [ 2063.0, 1727.0, 0.0, 2063.0, 5126.0, 5458.0 ],
- 22500: [ 2725.0, 2375.0, 264.0, 2725.0, 6044.0, 6398.0 ],
- 25000: [ 3417.0, 3051.0, 628.0, 3417.0, 7020.0, 7394.0 ],
- 27500: [ 4126.0, 3746.0, 1104.0, 4126.0, 8052.0, 8438.0 ],
- 30000: [ 4860.0, 4465.0, 1634.0, 4860.0, 9102.0, 9488.0 ],
- 32500: [ 5620.0, 5211.0, 2240.0, 5620.0, 10152.0, 10538.0 ],
- 35000: [ 6408.0, 5984.0, 2952.0, 6408.0, 11202.0, 11588.0 ],
- 37500: [ 7224.0, 6785.0, 3684.0, 7224.0, 12252.0, 12638.0 ],
- 40000: [ 8068.0, 7614.0, 4364.0, 8068.0, 13302.0, 13688.0 ],
- 42500: [ 8938.0, 8470.0, 5026.0, 8938.0, 14352.0, 14738.0 ],
- 45000: [ 9836.0, 9354.0, 5700.0, 9836.0, 15402.0, 15788.0 ],
- 47500: [ 10762.0, 10265.0, 6390.0, 10762.0, 16452.0, 16838.0 ],
- 50000: [ 11715.0, 11203.0, 7094.0, 11715.0, 17502.0, 17888.0 ],
- 52500: [ 12696.0, 12169.0, 7806.0, 12696.0, 18552.0, 18938.0 ],
- 55000: [ 13704.0, 13163.0, 8524.0, 13704.0, 19602.0, 19988.0 ],
- 57500: [ 14733.0, 14183.0, 9254.0, 14733.0, 20652.0, 21038.0 ],
- 60000: [ 15763.0, 15213.0, 10000.0, 15763.0, 21702.0, 22088.0 ]
- }
- self.t = LStRechner2005()
- self.t.SetZeitraum(JAHR)
-
- def test_lohnsteuer(self):
- """Testet GetLohnsteuer gegen die offizielle Prüftabelle"""
- self.SetUp()
- for lohn in self.prueftabelle.keys():
- for stkl in range(1, 7):
- self.t.SetLohn(lohn)
- self.t.SetSteuerklasse(stkl)
- self.t.Calc()
- self.assertEquals(self.t.GetLohnsteuer(),
- self.prueftabelle[lohn][stkl - 1])
-
- def test_api_lohnaequi(self):
- """Testet SetLohn GetLohn Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 1234.56, 2000.01, 2000.10, 2000.30, 2000.50, 3000,
- 3000.01, 50000, 70000, 90000, 1000000.01, 100000000000.01):
- self.t.SetLohn(val)
- self.assertEquals(self.t.GetLohn(), val)
-
- def test_api_zeitraumaequi(self):
- """Testet SetZeitraum GetZeitraum Äquivalenz"""
- self.SetUp()
- for val in (JAHR, MONAT, WOCHE, TAG):
- self.t.SetZeitraum(val)
- self.assertEquals(self.t.GetZeitraum(), val)
-
- def test_api_steuerklasseaequi(self):
- """Testet SetSteuerklasse GetSteuerklasse Äquivalenz"""
- self.SetUp()
- for val in (I, II, III, IV, V, VI):
- self.t.SetSteuerklasse(val)
- self.assertEquals(self.t.GetSteuerklasse(), val)
-
- def test_api_kirchensteueraequi(self):
- """Testet SetKirchensteuer GetKirchensteuer Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 5.5, 14.32, 8, 9, 50.50, 87.65, 100):
- self.t.SetKirchensteuerProzent(val)
- self.assertEquals(self.t.GetKirchensteuerProzent(), val)
-
-
-if __name__ == "__main__":
- unittest.main()
Deleted: test_Lohnsteuer2005.py
===================================================================
--- test_Lohnsteuer2005.py 2006-01-30 08:23:04 UTC (rev 59)
+++ test_Lohnsteuer2005.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,98 +0,0 @@
-# --------------------------------------------------------------------
-# UnitTest für die Lohnsteuerberechnung in LST2005
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Unit Test für die Lohnsteuerberechnung in LST2005. Benutzt die
-Daten aus der Prüftabelle zum offiziellen Programmablaufplan zur
-maschinellen Jahreslohnsteürberechnung 2005."""
-
-# ACHTUNG: die Prüftabelle liefert nur Referenzwerte für die
-# Berechnung der Lohnsteuer auf ein Jahr, andere Berechnungßeiträume
-# werden nicht berücksichtigt.
-
-import unittest
-from LST2005 import *
-
-class TestGetLohnsteuer(unittest.TestCase):
-
- def SetUp(self):
- """Offizielle Prüftabelle und LStRechner2005 einrichten"""
- self.prueftabelle = {
- 5000 : [ 0.0, 0.0, 0.0, 0.0, 612.0, 750.0 ],
- 7500 : [ 0.0, 0.0, 0.0, 0.0, 987.0, 1125.0 ],
- 10000: [ 0.0, 0.0, 0.0, 0.0, 1362.0, 1739.0 ],
- 12500: [ 232.0, 18.0, 0.0, 232.0, 2403.0, 2789.0 ],
- 15000: [ 714.0, 444.0, 0.0, 714.0, 3400.0, 3722.0 ],
- 17500: [ 1362.0, 1043.0, 0.0, 1362.0, 4266.0, 4576.0 ],
- 20000: [ 2063.0, 1727.0, 0.0, 2063.0, 5126.0, 5458.0 ],
- 22500: [ 2725.0, 2375.0, 264.0, 2725.0, 6044.0, 6398.0 ],
- 25000: [ 3417.0, 3051.0, 628.0, 3417.0, 7020.0, 7394.0 ],
- 27500: [ 4126.0, 3746.0, 1104.0, 4126.0, 8052.0, 8438.0 ],
- 30000: [ 4860.0, 4465.0, 1634.0, 4860.0, 9102.0, 9488.0 ],
- 32500: [ 5620.0, 5211.0, 2240.0, 5620.0, 10152.0, 10538.0 ],
- 35000: [ 6408.0, 5984.0, 2952.0, 6408.0, 11202.0, 11588.0 ],
- 37500: [ 7224.0, 6785.0, 3684.0, 7224.0, 12252.0, 12638.0 ],
- 40000: [ 8068.0, 7614.0, 4364.0, 8068.0, 13302.0, 13688.0 ],
- 42500: [ 8938.0, 8470.0, 5026.0, 8938.0, 14352.0, 14738.0 ],
- 45000: [ 9836.0, 9354.0, 5700.0, 9836.0, 15402.0, 15788.0 ],
- 47500: [ 10762.0, 10265.0, 6390.0, 10762.0, 16452.0, 16838.0 ],
- 50000: [ 11715.0, 11203.0, 7094.0, 11715.0, 17502.0, 17888.0 ],
- 52500: [ 12696.0, 12169.0, 7806.0, 12696.0, 18552.0, 18938.0 ],
- 55000: [ 13704.0, 13163.0, 8524.0, 13704.0, 19602.0, 19988.0 ],
- 57500: [ 14733.0, 14183.0, 9254.0, 14733.0, 20652.0, 21038.0 ],
- 60000: [ 15763.0, 15213.0, 10000.0, 15763.0, 21702.0, 22088.0 ]
- }
- self.t = LStRechner2005()
- self.t.SetZeitraum(JAHR)
-
- def test_lohnsteuer(self):
- """Testet GetLohnsteuer gegen die offizielle Prüftabelle"""
- self.SetUp()
- for lohn in self.prueftabelle.keys():
- for stkl in range(1, 7):
- self.t.SetLohn(lohn)
- self.t.SetSteuerklasse(stkl)
- self.t.Calc()
- self.assertEquals(self.t.GetLohnsteuer(),
- self.prueftabelle[lohn][stkl - 1])
-
- def test_api_lohnaequi(self):
- """Testet SetLohn GetLohn Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 1234.56, 2000.01, 2000.10, 2000.30, 2000.50, 3000,
- 3000.01, 50000, 70000, 90000, 1000000.01, 100000000000.01):
- self.t.SetLohn(val)
- self.assertEquals(self.t.GetLohn(), val)
-
- def test_api_zeitraumaequi(self):
- """Testet SetZeitraum GetZeitraum Äquivalenz"""
- self.SetUp()
- for val in (JAHR, MONAT, WOCHE, TAG):
- self.t.SetZeitraum(val)
- self.assertEquals(self.t.GetZeitraum(), val)
-
- def test_api_steuerklasseaequi(self):
- """Testet SetSteuerklasse GetSteuerklasse Äquivalenz"""
- self.SetUp()
- for val in (I, II, III, IV, V, VI):
- self.t.SetSteuerklasse(val)
- self.assertEquals(self.t.GetSteuerklasse(), val)
-
- def test_api_kirchensteueraequi(self):
- """Testet SetKirchensteuer GetKirchensteuer Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 5.5, 14.32, 8, 9, 50.50, 87.65, 100):
- self.t.SetKirchensteuerProzent(val)
- self.assertEquals(self.t.GetKirchensteuerProzent(), val)
-
-
-if __name__ == "__main__":
- unittest.main()
Deleted: test_Lohnsteuer2006.py
===================================================================
--- test_Lohnsteuer2006.py 2006-01-30 08:23:04 UTC (rev 59)
+++ test_Lohnsteuer2006.py 2006-03-24 11:28:43 UTC (rev 60)
@@ -1,98 +0,0 @@
-# --------------------------------------------------------------------
-# UnitTest für die Lohnsteuerberechnung in LST2005
-# $Id$
-# --------------------------------------------------------------------
-#
-# Copyright (c) 2005,2006 by Intevation GmbH
-# Authors:
-# Sascha Wilde <wilde at intevation.de>
-#
-# This program is free software under the GPL (>=v2)
-# Read the file COPYING coming with this package for details.
-
-"""Unit Test für die Lohnsteuerberechnung in LST2006. Benutzt die
-Daten aus der Prüftabelle zum offiziellen Programmablaufplan zur
-maschinellen Jahreslohnsteuerberechnung 2006."""
-
-# ACHTUNG: die Prüftabelle liefert nur Referenzwerte für die
-# Berechnung der Lohnsteuer auf ein Jahr, andere Berechnungßeiträume
-# werden nicht berücksichtigt.
-
-import unittest
-from LST2006 import *
-
-class TestGetLohnsteuer(unittest.TestCase):
-
- def SetUp(self):
- """Offizielle Prüftabelle und LStRechner2006 einrichten"""
- self.prueftabelle = {
- 5000 : [ 0.0, 0.0, 0.0, 0.0, 612.0, 750.0 ],
- 7500 : [ 0.0, 0.0, 0.0, 0.0, 987.0, 1125.0 ],
- 10000: [ 0.0, 0.0, 0.0, 0.0, 1362.0, 1739.0 ],
- 12500: [ 232.0, 18.0, 0.0, 232.0, 2403.0, 2789.0 ],
- 15000: [ 714.0, 444.0, 0.0, 714.0, 3400.0, 3722.0 ],
- 17500: [ 1362.0, 1043.0, 0.0, 1362.0, 4266.0, 4576.0 ],
- 20000: [ 2063.0, 1727.0, 0.0, 2063.0, 5126.0, 5458.0 ],
- 22500: [ 2718.0, 2368.0, 264.0, 2718.0, 6044.0, 6398.0 ],
- 25000: [ 3393.0, 3028.0, 628.0, 3393.0, 7020.0, 7394.0 ],
- 27500: [ 4095.0, 3715.0, 1104.0, 4095.0, 8052.0, 8438.0 ],
- 30000: [ 4824.0, 4430.0, 1634.0, 4824.0, 9102.0, 9488.0 ],
- 32500: [ 5580.0, 5172.0, 2240.0, 5580.0, 10152.0, 10538.0 ],
- 35000: [ 6364.0, 5941.0, 2952.0, 6364.0, 11202.0, 11588.0 ],
- 37500: [ 7175.0, 6737.0, 3684.0, 7175.0, 12252.0, 12638.0 ],
- 40000: [ 8013.0, 7561.0, 4364.0, 8013.0, 13302.0, 13688.0 ],
- 42500: [ 8878.0, 8411.0, 5026.0, 8878.0, 14352.0, 14738.0 ],
- 45000: [ 9771.0, 9290.0, 5686.0, 9771.0, 15402.0, 15788.0 ],
- 47500: [ 10691.0, 10195.0, 6360.0, 10691.0, 16452.0, 16838.0 ],
- 50000: [ 11639.0, 11128.0, 7046.0, 11639.0, 17502.0, 17888.0 ],
- 52500: [ 12613.0, 12087.0, 7746.0, 12613.0, 18552.0, 18938.0 ],
- 55000: [ 13615.0, 13075.0, 8460.0, 13615.0, 19602.0, 19988.0 ],
- 57500: [ 14639.0, 14089.0, 9188.0, 14639.0, 20652.0, 21038.0 ],
- 60000: [ 15664.0, 15115.0, 9928.0, 15664.0, 21702.0, 22088.0 ]
- }
- self.t = LStRechner2006()
- self.t.SetZeitraum(JAHR)
-
- def test_lohnsteuer(self):
- """Testet GetLohnsteuer gegen die offizielle Prüftabelle"""
- self.SetUp()
- for lohn in self.prueftabelle.keys():
- for stkl in range(1, 7):
- self.t.SetLohn(lohn)
- self.t.SetSteuerklasse(stkl)
- self.t.Calc()
- self.assertEquals(self.t.GetLohnsteuer(),
- self.prueftabelle[lohn][stkl - 1])
-
- def test_api_lohnaequi(self):
- """Testet SetLohn GetLohn Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 1234.56, 2000.01, 2000.10, 2000.30, 2000.50, 3000,
- 3000.01, 50000, 70000, 90000, 1000000.01, 100000000000.01):
- self.t.SetLohn(val)
- self.assertEquals(self.t.GetLohn(), val)
-
- def test_api_zeitraumaequi(self):
- """Testet SetZeitraum GetZeitraum Äquivalenz"""
- self.SetUp()
- for val in (JAHR, MONAT, WOCHE, TAG):
- self.t.SetZeitraum(val)
- self.assertEquals(self.t.GetZeitraum(), val)
-
- def test_api_steuerklasseaequi(self):
- """Testet SetSteuerklasse GetSteuerklasse Äquivalenz"""
- self.SetUp()
- for val in (I, II, III, IV, V, VI):
- self.t.SetSteuerklasse(val)
- self.assertEquals(self.t.GetSteuerklasse(), val)
-
- def test_api_kirchensteueraequi(self):
- """Testet SetKirchensteuer GetKirchensteuer Äquivalenz"""
- self.SetUp()
- for val in (0, 1, 5.5, 14.32, 8, 9, 50.50, 87.65, 100):
- self.t.SetKirchensteuerProzent(val)
- self.assertEquals(self.t.GetKirchensteuerProzent(), val)
-
-
-if __name__ == "__main__":
- unittest.main()
Copied: trunk/COPYING (from rev 46, COPYING)
Copied: trunk/LST2005.py (from rev 46, LST2005.py)
Copied: trunk/LST2006.py (from rev 53, LST2006.py)
Copied: trunk/NEWS (from rev 56, NEWS)
Copied: trunk/Programmablaufplan.txt (from rev 59, Programmablaufplan.txt)
Copied: trunk/README (from rev 57, README)
Copied: trunk/lohnrechner.py (from rev 55, lohnrechner.py)
Copied: trunk/test_Lohnsteuer2005.py (from rev 48, test_Lohnsteuer2005.py)
Copied: trunk/test_Lohnsteuer2006.py (from rev 50, test_Lohnsteuer2006.py)
More information about the Lohnrechner-commits
mailing list