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>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ListField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_section</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>unknown_selection</string> </key>
<value> <string>You selected an item that was not in the list.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list>
<tuple>
<string>Bon de Virement</string>
<string>Bon de Virement</string>
</tuple>
<tuple>
<string>Avis de Virement</string>
<string>Avis de Virement</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Destination Accounting Code</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.portal_categories.accounting_code.getCategoryChildTitleItemList(base=1,display_none_category=1)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -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