[Erp5-report] r13966 - in /erp5/trunk/bt5/erp5_banking_cash: WorkflowTemplateItem/portal_wo...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 5 11:47:41 CEST 2007
Author: vincent
Date: Thu Apr 5 11:47:39 2007
New Revision: 13966
URL: http://svn.erp5.org?rev=13966&view=rev
Log:
Explicitely convert currency, grabing "from" and "to" currencies from account incident document.
Modified:
erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml
erp5/trunk/bt5/erp5_banking_cash/bt/revision
Modified: erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml?rev=13966&r1=13965&r2=13966&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml (original)
+++ erp5/trunk/bt5/erp5_banking_cash/WorkflowTemplateItem/portal_workflow/account_incident_workflow/scripts/checkConsistencyAndValidatePositionAccounting.xml Thu Apr 5 11:47:39 2007
@@ -122,7 +122,13 @@
# Now we will validate the accounting position\n
transaction = state_change[\'object\']\n
bank_account = transaction.getDestinationPaymentValue()\n
-price = transaction.ERP5Banking_getExchangeValue()\n
+exchange_rate_list = transaction.CurrencyExchange_getExchangeRateList(from_currency=transaction.getResource(),\n
+ to_currency=\'currency_module/%s\' % (context.Baobab_getPortalReferenceCurrencyID(), ),\n
+ currency_exchange_type=\'transfer\',\n
+ start_date=transaction.getStartDate())\n
+if len(exchange_rate_list) == 0:\n
+ raise ValidationError, \'Convertion between currencies %s and %s is unknown.\'\n
+price = context.getSourceTotalAssetPrice() * exchange_rate_list[0]\n
line = transaction.get(\'movement\')\n
\n
in_list = transaction.objectValues(portal_type=\'Incoming Account Incident Line\')\n
@@ -232,6 +238,8 @@
<string>len</string>
<string>resource</string>
<string>bank_account</string>
+ <string>exchange_rate_list</string>
+ <string>ValidationError</string>
<string>line</string>
<string>debit</string>
<string>error</string>
Modified: erp5/trunk/bt5/erp5_banking_cash/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_cash/bt/revision?rev=13966&r1=13965&r2=13966&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_cash/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_cash/bt/revision Thu Apr 5 11:47:39 2007
@@ -1,1 +1,1 @@
-262
+263
More information about the Erp5-report
mailing list