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

General Ledger:

  * add a summary at the end.
  * calculate section_uid instead of passing section_category
  * don't create level=9 report section, it generates a menu with reportlab
  


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13863 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22b6ca41
......@@ -75,9 +75,12 @@ request = context.REQUEST\n
portal = context.portal_url.getPortalObject()\n
cat_tool = portal.portal_categories\n
sim_tool = portal.portal_simulation\n
N_ = context.Base_translateString\n
\n
at_date = request[\'at_date\']\n
section_category = request[\'section_category\']\n
section_uid = context.Base_getSectionUidListForSectionCategory(\n
request[\'section_category\'])\n
simulation_state = request[\'simulation_state\']\n
from_date = request.get(\'from_date\', None)\n
gap = request.get(\'gap\', None)\n
......@@ -89,7 +92,7 @@ omit_grouping_reference = request.get(\'omit_grouping_reference\', False)\n
request.other[\'is_accounting_report\'] = True\n
\n
params = dict(at_date=at_date,\n
section_category=section_category,\n
section_uid=section_uid,\n
simulation_state=simulation_state,\n
omit_grouping_reference=omit_grouping_reference,\n
from_date_summary=True,\n
......@@ -182,7 +185,6 @@ for c in gap_value_list:\n
result.append(ReportSection(\n
path=account.getPhysicalPath(),\n
title=title,\n
level=9,\n
form_id=\'Account_viewAccountingTransactionList\',\n
selection_name=\'acount_preference_selection\',\n
selection_params=third_party_params.copy(),\n
......@@ -214,7 +216,6 @@ for c in gap_value_list:\n
result.append(ReportSection(\n
path=account.getPhysicalPath(),\n
title=title,\n
level=9,\n
form_id=\'Account_viewAccountingTransactionList\',\n
selection_name=\'accounting_report_selection\',\n
selection_params=bank_params.copy(),\n
......@@ -228,7 +229,6 @@ for c in gap_value_list:\n
result.append(ReportSection(\n
path=account.getPhysicalPath(),\n
title="%s: %s" % (c.getId(), account.getTitle()),\n
level=9,\n
form_id=\'Account_viewAccountingTransactionList\',\n
selection_name=\'accounting_report_selection\',\n
selection_params=params,\n
......@@ -236,6 +236,15 @@ for c in gap_value_list:\n
listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n
total_params = params.copy()\n
if gap:\n
total_params[\'node_category\'] = gap\n
result.append(ReportSection(\n
path=context.getPhysicalPath(),\n
title=N_("Total"),\n
form_id=\'AccountModule_viewGeneralLedgerSummary\',\n
selection_name=\'accounting_report_selection\',\n
selection_params=total_params))\n
\n
return result\n
</string> </value>
......@@ -288,9 +297,11 @@ return result\n
<string>portal</string>
<string>cat_tool</string>
<string>sim_tool</string>
<string>N_</string>
<string>_getitem_</string>
<string>at_date</string>
<string>section_category</string>
<string>section_uid</string>
<string>simulation_state</string>
<string>None</string>
<string>from_date</string>
......@@ -324,6 +335,7 @@ return result\n
<string>bank_account_brain</string>
<string>bank_params</string>
<string>bank_account_uid</string>
<string>total_params</string>
</tuple>
</value>
</item>
......
<?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>from Products.PythonScripts.standard import Object\n
getInventoryAssetPrice = context.getPortalObject().portal_simulation.getInventoryAssetPrice\n
\n
inventory_kw = dict(section_uid=section_uid,\n
simulation_state=simulation_state,\n
at_date=at_date,\n
portal_type=context.getPortalAccountingMovementTypeList(),\n
)\n
if node_category:\n
inventory_kw[\'node_category\'] = node_category\n
\n
return [Object(\n
debit=getInventoryAssetPrice(omit_output=1,\n
**inventory_kw),\n
credit= - getInventoryAssetPrice(omit_input=1,\n
**inventory_kw) or 0,)]\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>section_uid, simulation_state, at_date, node_category=None, from_date=\'ignored\', **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>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>section_uid</string>
<string>simulation_state</string>
<string>at_date</string>
<string>node_category</string>
<string>from_date</string>
<string>kw</string>
<string>Products.PythonScripts.standard</string>
<string>Object</string>
<string>_getattr_</string>
<string>context</string>
<string>getInventoryAssetPrice</string>
<string>dict</string>
<string>inventory_kw</string>
<string>_write_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<string>ignored</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountModule_getGeneralLedgerSummary</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.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>Default</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>Default</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_credit</string>
<string>listbox_debit</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountModule_viewGeneralLedgerSummary</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>AccountModule_viewGeneralLedgerSummary</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Summary</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
239
\ No newline at end of file
240
\ 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