Commit af50d07c authored by Sebastien Robin's avatar Sebastien Robin

- added CurrencyExchangeRate propertySheet

- change script ERP5Banking_getExchange in order to take into account specific rates

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15361 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e0629ee6
##############################################################################
#
# Copyright (c) 2002-2007 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class CurrencyExchangeRate:
"""
PropertySheetTemplate properties for all ERP5 objects
"""
_properties = (
{ 'id' : 'currency_exchange_rate',
'description' : 'A particular currency exchange rate used',
'type' : 'float',
'mode' : 'w' },
)
......@@ -67,13 +67,17 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
rate_list = context.CurrencyExchange_getExchangeRateList(from_currency=from_currency,\n
rate = None\n
method = getattr(context, \'getCurrencyExchangeRate\', None)\n
if method is not None:\n
rate = method()\n
if rate is None:\n
rate_list = context.CurrencyExchange_getExchangeRateList(from_currency=from_currency,\n
to_currency=to_currency, \n
currency_exchange_type=currency_exchange_type,\n
start_date=start_date)\n
rate = None\n
if len(rate_list) > 0:\n
rate = rate_list[0]\n
if len(rate_list) > 0:\n
rate = rate_list[0]\n
\n
price = context.getSourceTotalAssetPrice()\n
\n
......@@ -145,11 +149,13 @@ return round(rate * price)\n
<string>to_currency</string>
<string>currency_exchange_type</string>
<string>start_date</string>
<string>_getattr_</string>
<string>context</string>
<string>rate_list</string>
<string>None</string>
<string>rate</string>
<string>getattr</string>
<string>context</string>
<string>method</string>
<string>_getattr_</string>
<string>rate_list</string>
<string>len</string>
<string>_getitem_</string>
<string>price</string>
......
320
\ No newline at end of file
323
\ No newline at end of file
CheckModel
RenderingPreference
BaobabStopDate
\ No newline at end of file
BaobabStopDate
CurrencyExchangeRate
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment