1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.Element
import Element
20 """Details on amounts due for an account.
23 def __init__(self
, interest
=0.0, principle
=0.0, arrears
=0.0, current
=0.0, charges
=0.0, *args
, **kw_args
):
24 """Initialises a new 'Due' instance.
26 @param interest: Part of 'current' that constitutes the interest portion.
27 @param principle: Part of 'current' that constitutes the portion of the principle amount currently due.
28 @param arrears: Part of 'current' that constitutes the arrears portion.
29 @param current: Current total amount now due: current = principle + arrears + interest + charges. Typically the rule for settlement priority is: interest dues, then arrears dues, then current dues, then charge dues.
30 @param charges: Part of 'current' that constitutes the charge portion: 'charges' = 'Charge.fixedPortion' + 'Charge.variablePortion'.
32 #: Part of 'current' that constitutes the interest portion.
33 self
.interest
= interest
35 #: Part of 'current' that constitutes the portion of the principle amount currently due.
36 self
.principle
= principle
38 #: Part of 'current' that constitutes the arrears portion.
39 self
.arrears
= arrears
41 #: Current total amount now due: current = principle + arrears + interest + charges. Typically the rule for settlement priority is: interest dues, then arrears dues, then current dues, then charge dues.
42 self
.current
= current
44 #: Part of 'current' that constitutes the charge portion: 'charges' = 'Charge.fixedPortion' + 'Charge.variablePortion'.
45 self
.charges
= charges
47 super(Due
, self
).__init
__(*args
, **kw_args
)
49 _attrs
= ["interest", "principle", "arrears", "current", "charges"]
50 _attr_types
= {"interest": float, "principle": float, "arrears": float, "current": float, "charges": float}
51 _defaults
= {"interest": 0.0, "principle": 0.0, "arrears": 0.0, "current": 0.0, "charges": 0.0}