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