Commit e79054a8 authored by Sebastien Robin's avatar Sebastien Robin

Allow users to select a foreign currency on cash balance regulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19543 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c99d6144
...@@ -73,7 +73,8 @@ transaction = state_change[\'object\']\n ...@@ -73,7 +73,8 @@ transaction = state_change[\'object\']\n
vault = transaction.getSource()\n vault = transaction.getSource()\n
\n \n
\n \n
if not(vault.endswith(\'encaisse_des_billets_et_monnaies\') or vault.endswith(\'encaisse_des_externes\')):\n if not (vault.endswith(\'encaisse_des_billets_et_monnaies\') or vault.endswith(\'encaisse_des_externes\')or \\\n
\'encaisse_des_devises\' in vault) :\n
msg = Message(domain="ui", message="Invalid source.")\n msg = Message(domain="ui", message="Invalid source.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
...@@ -85,6 +86,14 @@ if vault.endswith(\'encaisse_des_externes\'):\n ...@@ -85,6 +86,14 @@ if vault.endswith(\'encaisse_des_externes\'):\n
msg = Message(domain="ui", message="You must not select the local emission letter.")\n msg = Message(domain="ui", message="You must not select the local emission letter.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
# check resource between line and document\n
doc_resource = transaction.getResource()\n
for line in transaction.contentValues(portal_type=[\'Outgoing Cash Balance Regulation Line\',\n
\'Incoming Cash Balance Regulation Line\']):\n
if line.getResourceValue().getPriceCurrency() != doc_resource:\n
msg = Message(domain="ui", message="Resource defined on document is different from input cash.")\n
raise ValidationFailed, (msg,)\n
\n
# check again that we are in the good accounting date\n # check again that we are in the good accounting date\n
transaction.Baobab_checkCounterDateOpen(site=vault, date=transaction.getStartDate())\n transaction.Baobab_checkCounterDateOpen(site=vault, date=transaction.getStartDate())\n
\n \n
...@@ -181,6 +190,7 @@ if incoming_total != outgoing_total:\n ...@@ -181,6 +190,7 @@ if incoming_total != outgoing_total:\n
<string>site_emission_letter</string> <string>site_emission_letter</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>line</string> <string>line</string>
<string>doc_resource</string>
<string>resource_one</string> <string>resource_one</string>
<string>resource_two</string> <string>resource_two</string>
<string>amount</string> <string>amount</string>
......
602 603
\ No newline at end of file \ 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