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
19 class AccountingUnit(Element
):
20 """Unit for accounting; use either 'energyUnit' or 'currencyUnit' to specify the unit for 'value'.
23 def __init__(self
, multiplier
="k", monetaryUnit
="CNY", energyUnit
=0.0, value
=0.0, *args
, **kw_args
):
24 """Initialises a new 'AccountingUnit' instance.
26 @param multiplier: Multiplier for the 'energyUnit' or 'monetaryUnit'. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
27 @param monetaryUnit: Unit of currency. Values are: "CNY", "EUR", "INR", "AUD", "CHF", "DKK", "other", "RUR", "SEK", "GBP", "JPY", "NOK", "CAD", "USD"
28 @param energyUnit: Unit of service.
29 @param value: Value expressed in applicable units.
31 #: Multiplier for the 'energyUnit' or 'monetaryUnit'. Values are: "k", "d", "n", "M", "none", "G", "micro", "T", "c", "m", "p"
32 self
.multiplier
= multiplier
34 #: Unit of currency. Values are: "CNY", "EUR", "INR", "AUD", "CHF", "DKK", "other", "RUR", "SEK", "GBP", "JPY", "NOK", "CAD", "USD"
35 self
.monetaryUnit
= monetaryUnit
38 self
.energyUnit
= energyUnit
40 #: Value expressed in applicable units.
43 super(AccountingUnit
, self
).__init
__(*args
, **kw_args
)
45 _attrs
= ["multiplier", "monetaryUnit", "energyUnit", "value"]
46 _attr_types
= {"multiplier": str, "monetaryUnit": str, "energyUnit": float, "value": float}
47 _defaults
= {"multiplier": "k", "monetaryUnit": "CNY", "energyUnit": 0.0, "value": 0.0}
48 _enums
= {"multiplier": "UnitMultiplier", "monetaryUnit": "Currency"}