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 @@
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\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
resource=resource)\n
\n
......@@ -109,7 +110,7 @@ return check\n
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -129,7 +130,7 @@ return check\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>3</int> </value>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -138,13 +139,14 @@ return check\n
<string>bank_account</string>
<string>reference</string>
<string>resource</string>
<string>check</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>check</string>
<string>bad_simulation_state_dict</string>
<string>simulation_state</string>
<string>_getitem_</string>
......@@ -160,7 +162,9 @@ return check\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
......
......@@ -139,6 +139,20 @@ check = transaction.Base_checkCheck(reference=check_number, bank_account=bank_ac
transaction.edit(aggregate=check.getRelativeUrl())\n
\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>
......@@ -216,6 +230,7 @@ context.updateBankingOperation(state_change)\n
<string>check_resource</string>
<string>check</string>
<string>context</string>
<string>error</string>
</tuple>
</value>
</item>
......
......@@ -41,6 +41,8 @@
<string>cancel_action</string>
<string>delete</string>
<string>delete_action</string>
<string>order</string>
<string>order_action</string>
<string>plan</string>
<string>plan_action</string>
</tuple>
......
......@@ -86,7 +86,6 @@
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......@@ -95,7 +94,6 @@
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
......
......@@ -79,6 +79,7 @@
<tuple>
<string>Manager</string>
<string>Assignee</string>
<string>Assignor</string>
</tuple>
</value>
</item>
......
......@@ -21,7 +21,7 @@
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Check Consistency</string> </value>
<value> <string>Send to Validation</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
......
343
\ No newline at end of file
344
\ 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