Commit 259726c0 authored by Sebastien Robin's avatar Sebastien Robin

do not use the fast input on stop payment, we must

use reference min and reference max instead

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10948 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 614e2a31
......@@ -64,7 +64,7 @@
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
......
......@@ -483,6 +483,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -684,6 +687,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -473,6 +473,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -667,6 +670,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -484,6 +484,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -686,6 +689,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -483,6 +483,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -684,6 +687,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -484,6 +484,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -686,6 +689,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -484,6 +484,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -686,6 +689,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -349,6 +349,9 @@
<permission type='list'>
<name>Edit Factories</name>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='list'>
<name>Edit ReStructuredText</name>
</permission>
......@@ -493,6 +496,9 @@
<permission type='list'>
<name>View</name>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='list'>
<name>View History</name>
</permission>
......
......@@ -486,6 +486,9 @@
<name>Edit Factories</name>
<role>Manager</role>
</permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'>
<name>Edit ReStructuredText</name>
<role>Manager</role>
......@@ -689,6 +692,9 @@
<role>Author</role>
<role>Manager</role>
</permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'>
<name>View History</name>
<role>Assignee</role>
......
......@@ -75,11 +75,38 @@
# 1 - if a end date is not passed yet, we will create the check\n
# 2 - if the end date is passed, we raise an error\n
from Products.ERP5Type.Message import Message\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from DateTime import DateTime\n
\n
\n
bank_account = context.getDestinationPaymentValue()\n
reference_list = [reference]\n
if reference is not None:\n
reference_list = [reference]\n
\n
elif reference_range_min is not None or reference_range_max is not None:\n
reference_list = []\n
\n
if reference_range_max is None:\n
reference_range_max = reference_range_min\n
\n
elif reference_range_min is None:\n
reference_range_min = reference_range_max\n
\n
try:\n
reference_range_min = int(reference_range_min)\n
reference_range_max = int(reference_range_max)\n
except ValueError:\n
msg = Message(domain=\'ui\', message=\'Sorry, make sure you have entered the right check number.\')\n
raise ValidationFailed, (msg,)\n
\n
if reference_range_min>reference_range_max :\n
msg = Message(domain=\'ui\', message=\'Sorry, the min number must be less than the max number.\')\n
raise ValidationFailed, (msg,)\n
\n
for ref in range(reference_range_min,reference_range_max+1):\n
# We will look for each reference and add the right number\n
reference_list.append(ref)\n
\n
check_list = []\n
for check_reference in reference_list:\n
message_tag = \'check_%s\' % (check_reference, )\n
......@@ -125,7 +152,7 @@ for check_reference in reference_list:\n
check_list.append(check)\n
\n
if reference is not None:\n
return check\n
return check_list[0]\n
return check_list\n
......@@ -188,22 +215,27 @@ return check_list\n
<string>reference_range_max</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>DateTime</string>
<string>_getattr_</string>
<string>context</string>
<string>bank_account</string>
<string>None</string>
<string>reference_list</string>
<string>check_list</string>
<string>int</string>
<string>ValueError</string>
<string>msg</string>
<string>_getiter_</string>
<string>range</string>
<string>ref</string>
<string>check_list</string>
<string>check_reference</string>
<string>message_tag</string>
<string>msg</string>
<string>ValidationFailed</string>
<string>result</string>
<string>len</string>
<string>end_date</string>
<string>now</string>
<string>None</string>
<string>checkbook</string>
<string>_getitem_</string>
<string>generic_model</string>
......
......@@ -397,9 +397,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_module</string> </key>
......
......@@ -337,9 +337,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_module</string> </key>
......
......@@ -397,9 +397,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
......@@ -78,24 +78,29 @@ class Dummy:\n
\n
dummy = Dummy()\n
node = kw.get(\'node\',dummy)\n
vault = kw.get(\'vault\',dummy)\n
\n
if item_portal_type_list is None:\n
item_portal_type_list = ["Checkbook","Check"]\n
\n
if listbox is None:\n
\n
if vault is not dummy:\n
node = vault\n
if node is dummy:\n
node = None\n
else:\n
if node is None:\n
node = context.getBaobabSource()\n
\n
reference_date = DateTime()\n
item_list = []\n
listbox = []\n
getCurrentTrackingList = context.portal_simulation.getCurrentTrackingList\n
context.log(\'current_tracking_list src\',getCurrentTrackingList(at_date=reference_date, node=node,src__=1))\n
#context.log(\'current_tracking_list src\',getCurrentTrackingList(at_date=reference_date, node=node,src__=1,where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'"))\n
#return [x.path for x in getCurrentTrackingList(at_date=reference_date, node=node)]\n
current_tracking_list = [x.getObject() for x in getCurrentTrackingList(\n
at_date=reference_date, node=node)]\n
at_date=reference_date, node=node,\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n
for item in current_tracking_list:\n
exclude=0\n
if model_filter_dict is not None:\n
......@@ -198,6 +203,7 @@ return context.asContext(context=None\n
<string>dummy</string>
<string>_getattr_</string>
<string>node</string>
<string>vault</string>
<string>None</string>
<string>context</string>
<string>reference_date</string>
......
......@@ -67,8 +67,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>bottom</string>
<string>hidden</string>
<string>left</string>
</list>
</value>
</item>
......@@ -77,19 +76,13 @@
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<key> <string>left</string> </key>
<value>
<list>
<string>listbox</string>
<string>my_vault</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -119,7 +112,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Report</string> </value>
<value> <string>Item Report</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......
......@@ -238,16 +238,7 @@
<item>
<key> <string>items</string> </key>
<value>
<list>
<tuple>
<string>a</string>
<string>a</string>
</tuple>
<tuple>
<string>z</string>
<string>z</string>
</tuple>
</list>
<list/>
</value>
</item>
<item>
......@@ -256,7 +247,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -112,6 +112,8 @@
<list>
<string>my_destination_payment_reference</string>
<string>my_destination_payment_title</string>
<string>my_reference_range_min</string>
<string>my_reference_range_max</string>
<string>my_description</string>
</list>
</value>
......
......@@ -322,20 +322,12 @@
<value>
<list>
<tuple>
<string>resource_title</string>
<string>getResourceTitle</string>
<string>Resource</string>
</tuple>
<tuple>
<string>check_amount_title</string>
<string>Variation</string>
</tuple>
<tuple>
<string>reference_range_min</string>
<string>Start Number</string>
</tuple>
<tuple>
<string>reference_range_max</string>
<string>Stop Number</string>
<string>Number</string>
</tuple>
</list>
</value>
......@@ -492,7 +484,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Checkbooks</string> </value>
<value> <string>Checks</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
......@@ -520,7 +512,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>objectValues</string> </value>
<value> <string>Delivery_getMovementList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -96,7 +96,9 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -171,4 +173,23 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getSimulationState() in (\'draft\',\'confirmed\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -142,7 +142,9 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -163,7 +165,7 @@
<item>
<key> <string>input_style</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -260,6 +262,25 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getSimulationState()==\'draft\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
......
......@@ -515,7 +515,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>objectValues</string> </value>
<value> <string>Delivery_getMovementList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -101,6 +101,7 @@
<string>my_source_reference</string>
<string>my_source_logical_path</string>
<string>my_start_date</string>
<string>my_source_total_asset_price</string>
</list>
</value>
</item>
......
......@@ -515,7 +515,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>objectValues</string> </value>
<value> <string>Delivery_getMovementList</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>FloatField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_total_asset_price</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>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</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>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Total Amount</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -86,6 +86,12 @@ if not account.isOverdraftFacility():\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
......@@ -163,4 +169,25 @@ if not account.isOverdraftFacility():\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,42 +75,9 @@ from Products.ERP5Type.Message import Message\n
transaction = state_change[\'object\']\n
bank_account = transaction.getDestinationPaymentValue()\n
check_number = transaction.getAggregateFreeText()\n
message_tag = \'check_%s\' % (check_number, )\n
\n
# XXX: no need to handle this cleanly for now, so just raise an error.\n
if context.portal_activities.countMessageWithTag(message_tag) != 0:\n
msg = Message(domain=\'ui\', message="This check number is already being indexed.")\n
raise ValidationFailed, (msg,)\n
\n
result = context.portal_catalog(portal_type = \'Check\', reference = check_number)\n
if len(result) == 0:\n
# This happens only if automatic creation is allowed. So create a new check at this point.\n
\n
# Get a checkbook for this bank account.\n
checkbook = None\n
generic_model = context.portal_catalog(portal_type = \'Checkbook Model\', title = \'Generic\')[0].getObject()\n
# XXX it would be better to use a related key for this, but z_related_resource is too specific to\n
# movement at the moment.\n
for brain in context.portal_catalog(portal_type = \'Checkbook\',\n
destination_payment_uid = bank_account.getUid()):\n
obj = brain.getObject()\n
if obj.getResourceUid() == generic_model.getUid():\n
checkbook = obj\n
break\n
if checkbook is None:\n
# Create a checkbook.\n
# To prevent duplicated checkbooks for a single bank account, index this new checkbook immediately.\n
# This has a performance penalty, but this part of the script will rarely be called (once per bank account).\n
checkbook = context.checkbook_module.newContent(portal_type = \'Checkbook\',\n
resource_value = generic_model,\n
destination_payment_value = bank_account,\n
immediate_reindex = 1)\n
# Create a check.\n
check = checkbook.newContent(portal_type = \'Check\', reference = check_number, activate_kw={\'tag\': message_tag})\n
# Automatically issue this check.\n
check.confirm()\n
else:\n
check = result[0].getObject()\n
check = transaction.Base_checkOrCreateCheck(reference=check_number)\n
\n
line = transaction.get(\'movement\')\n
if line is not None and line.getPortalType() == \'Banking Operation Line\':\n
......@@ -188,20 +155,9 @@ transaction.edit(aggregate = check.getRelativeUrl())\n
<string>_getattr_</string>
<string>bank_account</string>
<string>check_number</string>
<string>message_tag</string>
<string>context</string>
<string>msg</string>
<string>ValidationFailed</string>
<string>result</string>
<string>len</string>
<string>None</string>
<string>checkbook</string>
<string>generic_model</string>
<string>_getiter_</string>
<string>brain</string>
<string>obj</string>
<string>check</string>
<string>line</string>
<string>None</string>
</tuple>
</value>
</item>
......
......@@ -82,6 +82,12 @@ check.deliver()\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
......@@ -162,4 +168,25 @@ check.deliver()\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>transaction = state_change.object\n
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>kw</string>
<string>_getattr_</string>
<string>transaction</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -60,7 +60,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -71,6 +71,11 @@
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
transaction = state_change.object\n
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
\n
\n
delivery = state_change.object\n
portal = context.getPortalObject()\n
......@@ -189,6 +194,7 @@ for line in line_list:\n
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getattr_</string>
<string>transaction</string>
<string>delivery</string>
<string>context</string>
<string>portal</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>transaction = state_change.object\n
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>kw</string>
<string>_getattr_</string>
<string>transaction</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>transaction = state_change.object\n
\n
# Check getBaobabSource and getBaobabDestination\n
transaction.Base_checkBaobabSourceAndDestination()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>kw</string>
<string>_getattr_</string>
<string>transaction</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<value> <string>validateSourceAndDestination</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -70,12 +70,21 @@
<key> <string>_body</string> </key>
<value> <string># We will make sure that the check will not be usable\n
transaction = state_change[\'object\']\n
from Products.ERP5Type.Message import Message\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
line_list = transaction.getMovementList()\n
portal_workflow = transaction.portal_workflow\n
\n
aggregate_list = []\n
line_list = transaction.getMovementList()\n
for line in line_list:\n
aggregate_list = line.getAggregateValueList()\n
aggregate_list.extend(line.getAggregateValueList())\n
ref_min = transaction.getReferenceRangeMin()\n
ref_max = transaction.getReferenceRangeMin()\n
if ref_min is not None or ref_max is not None:\n
if len(aggregate_list)==0:\n
msg = Message(domain=\'ui\', message=\'Sorry, no check was found, but there is a reference.\')\n
raise ValidationFailed, (msg,)\n
for aggregate in aggregate_list:\n
if aggregate.getPortalType()==\'Check\':\n
aggregate.setStopDate(transaction.getStartDate())\n
......@@ -132,12 +141,21 @@ for line in line_list:\n
<string>kw</string>
<string>_getitem_</string>
<string>transaction</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getattr_</string>
<string>line_list</string>
<string>portal_workflow</string>
<string>aggregate_list</string>
<string>line_list</string>
<string>_getiter_</string>
<string>line</string>
<string>aggregate_list</string>
<string>ref_min</string>
<string>ref_max</string>
<string>None</string>
<string>len</string>
<string>msg</string>
<string>aggregate</string>
</tuple>
</value>
......
......@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
transaction = state_change[\'object\']\n
......@@ -84,6 +86,41 @@ if not transaction.Baobab_checkCounterDateOpen(site=source, date=date):\n
msg = Message(domain = "ui", message="Counter Date is not opened")\n
raise ValidationFailed, (msg,)\n
\n
ref_min = transaction.getReferenceRangeMin()\n
ref_max = transaction.getReferenceRangeMax()\n
\n
# We will first retrieve all checks\n
check_list = []\n
if ref_min is not None or ref_max is not None:\n
check_list = transaction.Base_checkOrCreateCheck(\n
reference_range_min = ref_min,\n
reference_range_max = ref_max)\n
if len(check_list)>0:\n
# First make sure there is no delivery line\n
line_list = transaction.objectValues(portal_type=\'Cash Delivery Line\')\n
if len(line_list)>0:\n
id_list = [x.getId() for x in line_list]\n
transaction.manage_delObjects(ids=id_list)\n
\n
# Then we will construct a new line for each check\n
for item in check_list:\n
delivery_line = transaction.newContent(portal_type=\'Checkbook Delivery Line\')\n
item_dict = {}\n
reference_range_min = None\n
reference_range_max = None\n
if item.getPortalType()==\'Check\':\n
reference_range_min = reference_range_max = item.getReference()\n
item_dict[\'reference_range_min\'] = reference_range_min\n
item_dict[\'reference_range_max\'] = reference_range_max\n
item_dict[\'destination_trade\'] = item.getDestinationTrade()\n
item_dict["resource_value"] = item.getResourceValue()\n
item_dict["check_amount"] = item.getCheckAmount()\n
item_dict["check_type"] = item.getCheckType()\n
item_dict["price_currency"] = item.getPriceCurrency()\n
item_dict["aggregate_value"] = item\n
item_dict["quantity"] = 1\n
delivery_line.edit(**item_dict)\n
\n
# First we have to look if we have some checks with some prices,\n
# if so, this means that we are saling such kinds of check, thus\n
# we must change the position of the customer account\n
......@@ -140,7 +177,9 @@ if debit_required:\n
elif error[\'error_code\'] != 0:\n
msg = Message(domain=\'ui\', message="Unknown error code.")\n
raise ValidationFailed, (msg,)\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -164,6 +203,12 @@ if debit_required:\n
<key> <string>_params</string> </key>
<value> <string>state_change, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
......@@ -201,12 +246,27 @@ if debit_required:\n
<string>None</string>
<string>source</string>
<string>msg</string>
<string>ref_min</string>
<string>ref_max</string>
<string>check_list</string>
<string>len</string>
<string>line_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>id_list</string>
<string>item</string>
<string>delivery_line</string>
<string>item_dict</string>
<string>reference_range_min</string>
<string>reference_range_max</string>
<string>_write_</string>
<string>_apply_</string>
<string>movement_list</string>
<string>total_debit</string>
<string>_getiter_</string>
<string>movement</string>
<string>aggregate_value_list</string>
<string>item</string>
<string>debit_required</string>
<string>line</string>
<string>bank_account</string>
......
......@@ -26,6 +26,12 @@
<key> <string>id</string> </key>
<value> <string>confirmed</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Stop Payment Requested</string> </value>
......@@ -50,4 +56,55 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -71,7 +71,8 @@
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Auditor</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......@@ -89,7 +90,8 @@
<key> <string>View</string> </key>
<value>
<tuple>
<string>Auditor</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
......
......@@ -26,6 +26,12 @@
<key> <string>id</string> </key>
<value> <string>started</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Payment Stopped</string> </value>
......@@ -49,4 +55,55 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -26,6 +26,12 @@
<key> <string>id</string> </key>
<value> <string>stopped</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Lift Requested</string> </value>
......@@ -49,4 +55,55 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Annuler</string> </value>
<value> <string>Cancel</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
......
......@@ -32,7 +32,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>updateCheck</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
<value> <string>updateCheck</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -28,7 +28,7 @@
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=stop_action</string> </value>
<value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=start_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
......
26
\ No newline at end of file
32
\ 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