Commit bd13141c authored by Jérome Perrin's avatar Jérome Perrin

if 'hide_grouping' is true, do not show movements having a grouping reference.

In the current configuration, stats shows the total, this is intentional,
because if a movement A (date=2006/12/20) is grouped with a movement B
(date=2007/01/01), the stat should show movement A, even if he is grouped. This
is also a way to see grouping errors.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10534 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8ab0652c
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n <value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Message import Message\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
params = portal.ERP5Accounting_getParams(selection)\n params = portal.ERP5Accounting_getParams(selection)\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n N_ = lambda msg: Message(\'erp5_ui\', msg)\n
...@@ -99,7 +101,7 @@ net_balance = 0.0\n ...@@ -99,7 +101,7 @@ net_balance = 0.0\n
\n \n
if from_date:\n if from_date:\n
# Create a new parameter list to get the previous balance\n # Create a new parameter list to get the previous balance\n
get_inventory_kw = params.copy()\n get_inventory_kw = params.copy() # do not include omit_grouping here\n
get_inventory_kw[\'to_date\'] = from_date\n get_inventory_kw[\'to_date\'] = from_date\n
# TODO: using a list of section_uid \n # TODO: using a list of section_uid \n
# \'where_expression\': " section.portal_type = \'Organisation\' " \n # \'where_expression\': " section.portal_type = \'Organisation\' " \n
...@@ -141,6 +143,8 @@ if from_date:\n ...@@ -141,6 +143,8 @@ if from_date:\n
getTranslatedSimulationStateTitle=\'\',\n getTranslatedSimulationStateTitle=\'\',\n
)\n )\n
new_result = [previous_balance]\n new_result = [previous_balance]\n
if selection.getParams().get(\'hide_grouping\'):\n
params[\'where_expression\'] = \'catalog.grouping_reference is NULL\'\n
new_result.extend(\n new_result.extend(\n
portal.portal_simulation.getMovementHistoryList(\n portal.portal_simulation.getMovementHistoryList(\n
from_date=from_date,\n from_date=from_date,\n
...@@ -162,8 +166,10 @@ context.log(\'sql\\nparams=%s\\nsort_on=%s\' % (params, sort_on),\n ...@@ -162,8 +166,10 @@ context.log(\'sql\\nparams=%s\\nsort_on=%s\' % (params, sort_on),\n
sort_on=sort_on,\n sort_on=sort_on,\n
src__=1,\n src__=1,\n
**params))\n **params))\n
\n \n
# We try not to convert to a list.\n if selection.getParams().get(\'hide_grouping\'):\n
params[\'where_expression\'] = \'catalog.grouping_reference is NULL\'\n
# We try not to convert to a list, hence the copy & paste\n
return portal.portal_simulation.getMovementHistoryList(\n return portal.portal_simulation.getMovementHistoryList(\n
from_date=from_date,\n from_date=from_date,\n
initial_running_total_price=net_balance,\n initial_running_total_price=net_balance,\n
...@@ -172,7 +178,9 @@ return portal.portal_simulation.getMovementHistoryList(\n ...@@ -172,7 +178,9 @@ return portal.portal_simulation.getMovementHistoryList(\n
selection_domain_join_column=\'section_uid\',\n selection_domain_join_column=\'section_uid\',\n
sort_on=sort_on,\n sort_on=sort_on,\n
**params)\n **params)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
......
58 59
\ 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