Commit 45c98eff authored by Aurel's avatar Aurel

2007-12-03 aurel

add possibility to select an accounting code on destination

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17956 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 76906334
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
<string>my_site</string> <string>my_site</string>
<string>my_destination_payment_reference</string> <string>my_destination_payment_reference</string>
<string>my_destination_payment_title</string> <string>my_destination_payment_title</string>
<string>my_destination_section</string>
<string>my_source_total_asset_price</string> <string>my_source_total_asset_price</string>
</list> </list>
</value> </value>
......
...@@ -77,6 +77,17 @@ site = transaction.getSite()\n ...@@ -77,6 +77,17 @@ site = transaction.getSite()\n
date = transaction.getStartDate()\n date = transaction.getStartDate()\n
transaction.Baobab_checkAccountingDateOpen(site=site, date=date)\n transaction.Baobab_checkAccountingDateOpen(site=site, date=date)\n
\n \n
# Check we don\'t defined accounting code and account\n
if transaction.getDestinationSection() not in ("", None) and \\\n
transaction.getDestinationPayment() not in ("", None):\n
msg = Message(domain=\'ui\', message="You can\'t defined both account and accounting code.")\n
raise ValidationFailed, (msg,)\n
\n
if transaction.getDestinationSection() in ("", None) and \\\n
transaction.getDestinationPayment() in ("", None):\n
msg = Message(domain=\'ui\', message="You must defined an account or and accounting code as destination.")\n
raise ValidationFailed, (msg,)\n
\n
# Check the amount.\n # Check the amount.\n
price = transaction.getSourceTotalAssetPrice()\n price = transaction.getSourceTotalAssetPrice()\n
if price is None or price <= 0:\n if price is None or price <= 0:\n
...@@ -85,12 +96,10 @@ if price is None or price <= 0:\n ...@@ -85,12 +96,10 @@ if price is None or price <= 0:\n
\n \n
# Check the bank account.\n # Check the bank account.\n
destination_bank_account = transaction.getDestinationPaymentValue()\n destination_bank_account = transaction.getDestinationPaymentValue()\n
if destination_bank_account is None:\n if destination_bank_account is not None:\n
msg = Message(domain=\'ui\', message="Destination bank account not defined.")\n if destination_bank_account.getValidationState() != \'valid\':\n
raise ValidationFailed, (msg,)\n msg = Message(domain=\'ui\', message=\'Destination bank account is not valid.\')\n
if destination_bank_account.getValidationState() != \'valid\':\n raise ValidationFailed, (msg,)\n
msg = Message(domain=\'ui\', message=\'Destination bank account is not valid.\')\n
raise ValidationFailed, (msg,)\n
\n \n
# Check if the total price is equal to the total asset price.\n # Check if the total price is equal to the total asset price.\n
if transaction.getTotalPrice(portal_type = \'Check Operation Line\') != transaction.getSourceTotalAssetPrice():\n if transaction.getTotalPrice(portal_type = \'Check Operation Line\') != transaction.getSourceTotalAssetPrice():\n
...@@ -238,9 +247,9 @@ if transaction.getSimulationState() == "draft":\n ...@@ -238,9 +247,9 @@ if transaction.getSimulationState() == "draft":\n
<string>_getattr_</string> <string>_getattr_</string>
<string>site</string> <string>site</string>
<string>date</string> <string>date</string>
<string>price</string>
<string>None</string> <string>None</string>
<string>msg</string> <string>msg</string>
<string>price</string>
<string>destination_bank_account</string> <string>destination_bank_account</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>check_operation_line</string> <string>check_operation_line</string>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</item> </item>
<item> <item>
<key> <string>actbox_name</string> </key> <key> <string>actbox_name</string> </key>
<value> <string>Pay</string> </value> <value> <string>Settle</string> </value>
</item> </item>
<item> <item>
<key> <string>actbox_url</string> </key> <key> <string>actbox_url</string> </key>
......
344 345
\ 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