Commit 161ddc5d authored by Aurel's avatar Aurel

fix way to check bank account

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15100 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ceda9e6
...@@ -103,15 +103,15 @@ transaction.Baobab_checkCounterDateOpen(site=transaction.getSite(),\n ...@@ -103,15 +103,15 @@ transaction.Baobab_checkCounterDateOpen(site=transaction.getSite(),\n
if out_price > 0:\n if out_price > 0:\n
transaction.checkVaultBalance(state_change)\n transaction.checkVaultBalance(state_change)\n
\n \n
if transaction.getIncidentType == "account_incident":\n if transaction.getIncidentType() == "account_incident":\n
bank_account = transaction.getSourcePaymentValue()\n bank_account = transaction.getDestinationPaymentValue()\n
if bank_account is None:\n
msg = Message(domain=\'ui\', message="No bank account defined.")\n
raise ValidationFailed, (msg,)\n
if transaction.BankAccount_isMessagePending(bank_account):\n if transaction.BankAccount_isMessagePending(bank_account):\n
msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n msg = Message(domain=\'ui\', message="There are operations pending for this account that prevent form calculating its position. Please try again later.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
if bank_account is None:\n
msg = Message(domain=\'ui\', message="No bank account defined.")\n
raise ValidationFailed, (msg,)\n
if out_price > 0:\n if out_price > 0:\n
error = transaction.BankAccount_checkAvailableBalance(bank_account.getRelativeUrl(), out_price)\n error = transaction.BankAccount_checkAvailableBalance(bank_account.getRelativeUrl(), out_price)\n
if error[\'error_code\'] == 1:\n if error[\'error_code\'] == 1:\n
......
378 381
\ 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