Commit a51c34ad authored by Aurel's avatar Aurel

update check payment in order to follow new specifications

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17930 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6316e21c
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n \n
# Check that a check exists for given bank account and reference.\n # Check that a check exists for given bank account and reference.\n
check = context.Base_checkOrCreateCheck(reference=reference, \n if check is None:\n
check = context.Base_checkOrCreateCheck(reference=reference, \n
bank_account=bank_account,\n bank_account=bank_account,\n
resource=resource)\n resource=resource)\n
\n \n
...@@ -109,7 +110,7 @@ return check\n ...@@ -109,7 +110,7 @@ return check\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>bank_account, reference, resource</string> </value> <value> <string>bank_account, reference, resource, check=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -129,7 +130,7 @@ return check\n ...@@ -129,7 +130,7 @@ return check\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>3</int> </value> <value> <int>4</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -138,13 +139,14 @@ return check\n ...@@ -138,13 +139,14 @@ return check\n
<string>bank_account</string> <string>bank_account</string>
<string>reference</string> <string>reference</string>
<string>resource</string> <string>resource</string>
<string>check</string>
<string>Products.ERP5Type.Message</string> <string>Products.ERP5Type.Message</string>
<string>Message</string> <string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>check</string>
<string>bad_simulation_state_dict</string> <string>bad_simulation_state_dict</string>
<string>simulation_state</string> <string>simulation_state</string>
<string>_getitem_</string> <string>_getitem_</string>
...@@ -160,7 +162,9 @@ return check\n ...@@ -160,7 +162,9 @@ return check\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -139,6 +139,20 @@ check = transaction.Base_checkCheck(reference=check_number, bank_account=bank_ac ...@@ -139,6 +139,20 @@ check = transaction.Base_checkCheck(reference=check_number, bank_account=bank_ac
transaction.edit(aggregate=check.getRelativeUrl())\n transaction.edit(aggregate=check.getRelativeUrl())\n
\n \n
context.updateBankingOperation(state_change)\n context.updateBankingOperation(state_change)\n
\n
# Test if the account balance is sufficient.\n
# We do not need to serialize here because we do not make\n
# reservation yet\n
error = transaction.BankAccount_checkAvailableBalance(bank_account.getRelativeUrl(), price)\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Bank account is not sufficient.")\n
raise ValidationFailed, (msg,)\n
elif error[\'error_code\'] == 2:\n
msg = Message(domain=\'ui\', message="Bank account is not valid.")\n
raise ValidationFailed, (msg,)\n
elif error[\'error_code\'] != 0:\n
msg = Message(domain=\'ui\', message="Unknown error code.")\n
raise ValidationFailed, (msg,)\n
]]></string> </value> ]]></string> </value>
...@@ -216,6 +230,7 @@ context.updateBankingOperation(state_change)\n ...@@ -216,6 +230,7 @@ context.updateBankingOperation(state_change)\n
<string>check_resource</string> <string>check_resource</string>
<string>check</string> <string>check</string>
<string>context</string> <string>context</string>
<string>error</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
<string>cancel_action</string> <string>cancel_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string> <string>delete_action</string>
<string>order</string>
<string>order_action</string>
<string>plan</string> <string>plan</string>
<string>plan_action</string> <string>plan_action</string>
</tuple> </tuple>
......
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
<key> <string>Add portal content</string> </key> <key> <string>Add portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -95,7 +94,6 @@ ...@@ -95,7 +94,6 @@
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
<tuple> <tuple>
<string>Manager</string> <string>Manager</string>
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</item> </item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Check Consistency</string> </value> <value> <string>Send to Validation</string> </value>
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
......
343 344
\ 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