Commit 09195c50 authored by Sebastien Robin's avatar Sebastien Robin

fixed worklist on check deposit

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16623 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9e9a7cfa
......@@ -6,6 +6,7 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
reference_dict = {}
reference_dict['CHEQUIER_COMPTE_COURANT_ORDINAIRE'] = 'CHCCO'
reference_dict['CHEQUIER_COMPTE_ORDINAIRE_DU_PERSONNEL'] = 'CHCOP'
reference_dict['CARNET_BON_VIREMENT'] = 'CABV'
reference_dict['BON_VIREMENT'] = 'BV'
# We will build a several listbox like it is already done into the user interface
# A listbox will be build for every resource
......@@ -13,6 +14,7 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
file_item_list = xml_content.xpath('//object')
# First, construct a dictionnary for every resource
import_dict = {}
self.log("import checkbook", "file_item_list = %s" %(file_item_list,))
for item in file_item_list:
checkbook_id = item.xpath("string(@id)")
check_quantity = str(item.xpath("string(./check_quantity)"))
......@@ -31,9 +33,10 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
item_dict['check_quantity'] = check_quantity
item_dict['quantity'] = quantity
item_dict['internal_account_number'] = internal_account_number
#self.log("import checkbook", "item_dict = %s" %(item_dict,))
listbox_dict = {}
for (checkbook_type, checkbook_dict) in import_dict.items():
self.log("checkbook_type %s, checkbook_dict %s" %(checkbook_type, checkbook_dict), "")
listbox = []
i = 0
resource_list = self.portal_catalog(portal_type=['Checkbook Model',
......@@ -54,6 +57,7 @@ def CheckbookReception_importItemFile(self, import_file=None, REQUEST=None, **kw
amount.getRelativeUrl()
for (account, account_dict) in checkbook_dict.items():
for (gid, item_dict) in account_dict.items():
self.log("is checkbook ? %s" %is_checkbook, "will fill value %s" %(item_dict,))
listbox_line = {}
listbox_line['listbox_key'] = '%05i' % i
listbox_line['reference_range_min'] = item_dict['reference_min']
......
......@@ -186,6 +186,10 @@ else:\n
(reference_range_max - reference_range_min + 1 != check_quantity * quantity\n
or\n
reference_range_max < reference_range_min):\n
context.log("Range is not valid",\n
"range max %s, range min %s, check quantity %s, quanityt %s" %(reference_range_max,\n
reference_range_min,\n
check_quantity, quantity))\n
message = \'The range is not valid\'\n
generate_error(line,\'reference_range_min\',message)\n
generate_error(line,\'reference_range_max\',message)\n
......
......@@ -96,7 +96,7 @@ if check == 1:\n
\n
if create==1:\n
for line in line_list:\n
line.activate(tag=checkbook_reception_tag).\\\n
line.activate(priority=4, tag=checkbook_reception_tag).\\\n
CheckbookReceptionLine_checkOrCreateItemList(create=1, tag=checkbook_reception_tag, confirm_check=confirm_check)\n
</string> </value>
</item>
......
......@@ -27,19 +27,19 @@
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Waiting for correction (%(count)s)</string> </value>
<value> <string>Waiting for second validation (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
Base_viewWorklist?simulation_state=planned&portal_type=Check Deposit&reset=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Waiting for correction</string> </value>
<value> <string>Waiting for second validation</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
......@@ -49,7 +49,7 @@ Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
</item>
<item>
<key> <string>id</string> </key>
<value> <string>started</string> </value>
<value> <string>planned</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
......@@ -63,11 +63,8 @@ Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -77,7 +74,7 @@ Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
<value>
<tuple>
<string>Manager</string>
<string>DestinationAssignee</string>
<string>Assignee</string>
</tuple>
</value>
</item>
......@@ -87,17 +84,14 @@ Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
......@@ -112,7 +106,7 @@ Base_viewWorklist?simulation_state=started&portal_type=Check Deposit&reset=1
<key> <string>simulation_state</string> </key>
<value>
<tuple>
<string>started</string>
<string>planned</string>
</tuple>
</value>
</item>
......
325
\ No newline at end of file
326
\ 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