Commit 4b9df912 authored by Sebastien Robin's avatar Sebastien Robin

finish changes on check payment in order to support the new way of checking references

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14556 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d21e9791
......@@ -74,17 +74,15 @@ transaction = state_change[\'object\']\n
bank_account = transaction.getDestinationPaymentValue()\n
check_number = transaction.getAggregateFreeText()\n
\n
\n
check = transaction.Base_checkOrCreateCheck(reference=check_number)\n
if not check.Check_isValid():\n
raise ValidationFailed, Message(domain=\'ui\', message=\'Check is in an invalid state\')\n
# Already done before in validateConsistency\n
#check = transaction.Base_checkOrCreateCheck(reference=check_number)\n
#if not check.Check_isValid():\n
# raise ValidationFailed, Message(domain=\'ui\', message=\'Check is in an invalid state\')\n
\n
line = transaction.get(\'movement\')\n
if line is not None and line.getPortalType() == \'Banking Operation Line\':\n
# This is a single currency operation, so it is not necessary to convert the price.\n
line.setSourceDebit(transaction.getSourceTotalAssetPrice())\n
\n
transaction.edit(aggregate = check.getRelativeUrl())\n
</string> </value>
</item>
<item>
......@@ -151,7 +149,6 @@ transaction.edit(aggregate = check.getRelativeUrl())\n
<string>_getattr_</string>
<string>bank_account</string>
<string>check_number</string>
<string>check</string>
<string>line</string>
<string>None</string>
</tuple>
......
......@@ -129,8 +129,9 @@ if check_resource is None:\n
msg = Message(domain=\'ui\', message="Check type not defined.")\n
raise ValidationFailed, (msg,)\n
\n
transaction.Base_checkCheck(reference=check_number, bank_account=bank_account, \n
check = transaction.Base_checkCheck(reference=check_number, bank_account=bank_account, \n
resource=check_resource)\n
transaction.edit(aggregate=check.getRelativeUrl())\n
\n
context.updateBankingOperation(state_change)\n
......@@ -213,6 +214,7 @@ context.updateBankingOperation(state_change)\n
<string>bank_account</string>
<string>check_number</string>
<string>check_resource</string>
<string>check</string>
<string>context</string>
</tuple>
</value>
......
225
\ No newline at end of file
227
\ 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