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

properly implement GL by function and project

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36004 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2672e5ab
...@@ -96,27 +96,25 @@ params = dict(precision=precision,\n ...@@ -96,27 +96,25 @@ params = dict(precision=precision,\n
movement_portal_type=portal.getPortalAccountingMovementTypeList(),\n movement_portal_type=portal.getPortalAccountingMovementTypeList(),\n
no_mirror_section_uid_cache=1,\n no_mirror_section_uid_cache=1,\n
hide_grouping=request.get(\'omit_grouping_reference\', False))\n hide_grouping=request.get(\'omit_grouping_reference\', False))\n
\n project = request.get(\'project\')\n
if len(simulation_state) > 1:\n if project:\n
account_columns = (\n params[\'project_uid\'] = portal.portal_categories.restrictedTraverse(project).getUid()\n
(\'Movement_getSpecificReference\', \'Reference\'),\n function = request.get(\'function\')\n
(\'Movement_getExplanationTitle\', \'Title\'),\n if function:\n
(\'date\', \'Date\'),\n params[\'function_uid\'] = portal.portal_categories.restrictedTraverse(function).getUid()\n
(\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n \n
(\'Movement_getExplanationReference\', \'Invoice Number\'),\n account_columns = (\n
(\'Movement_getMirrorSectionTitle\', \'Third Party\'),\n
(\'getTranslatedSimulationStateTitle\', \'State\'),\n
(\'debit\', \'Debit\'),\n
(\'credit\', \'Credit\'),\n
(\'running_total_price\', \'Net\'), )\n
else:\n
account_columns = (\n
(\'Movement_getSpecificReference\', \'Reference\'),\n (\'Movement_getSpecificReference\', \'Reference\'),\n
(\'Movement_getExplanationTitle\', \'Title\'),\n (\'Movement_getExplanationTitle\', \'Title\'),\n
(\'date\', \'Date\'),\n (\'date\', \'Date\'),\n
(\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n (\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n
(\'Movement_getExplanationReference\', \'Invoice Number\'),\n (\'Movement_getExplanationReference\', \'Invoice Number\'),\n
(\'Movement_getMirrorSectionTitle\', \'Third Party\'),\n (\'Movement_getMirrorSectionTitle\', \'Third Party\'),)\n
\n
if len(simulation_state) > 1:\n
account_columns += (\n
(\'getTranslatedSimulationStateTitle\', \'State\'),)\n
account_columns += (\n
(\'debit\', \'Debit\'),\n (\'debit\', \'Debit\'),\n
(\'credit\', \'Credit\'),\n (\'credit\', \'Credit\'),\n
(\'running_total_price\', \'Net\'), )\n (\'running_total_price\', \'Net\'), )\n
...@@ -507,8 +505,11 @@ return report_section_list\n ...@@ -507,8 +505,11 @@ return report_section_list\n
<string>_write_</string> <string>_write_</string>
<string>dict</string> <string>dict</string>
<string>params</string> <string>params</string>
<string>len</string> <string>project</string>
<string>function</string>
<string>account_columns</string> <string>account_columns</string>
<string>len</string>
<string>_inplacevar_</string>
<string>traverse</string> <string>traverse</string>
<string>account_name_cache</string> <string>account_name_cache</string>
<string>getAccountName</string> <string>getAccountName</string>
......
...@@ -61,6 +61,10 @@ inventory_kw = dict(section_uid=section_uid,\n ...@@ -61,6 +61,10 @@ inventory_kw = dict(section_uid=section_uid,\n
at_date=at_date,\n at_date=at_date,\n
portal_type=context.getPortalAccountingMovementTypeList(),\n portal_type=context.getPortalAccountingMovementTypeList(),\n
)\n )\n
if function_uid:\n
inventory_kw[\'function_uid\'] = function_uid\n
if project_uid:\n
inventory_kw[\'project_uid\'] = project_uid\n
\n \n
if node_category:\n if node_category:\n
# XXX if node category is passed, income or balance accounts are not\n # XXX if node category is passed, income or balance accounts are not\n
...@@ -113,7 +117,7 @@ return [Object(debit=debit, credit=credit)]\n ...@@ -113,7 +117,7 @@ return [Object(debit=debit, credit=credit)]\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>section_uid, simulation_state, at_date, period_start_date, precision, node_category=None, from_date=\'ignored\', **kw</string> </value> <value> <string>section_uid, simulation_state, at_date, period_start_date, precision, node_category=None, function_uid=None, project_uid=None, from_date=\'ignored\', **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -133,7 +137,7 @@ return [Object(debit=debit, credit=credit)]\n ...@@ -133,7 +137,7 @@ return [Object(debit=debit, credit=credit)]\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>7</int> </value> <value> <int>9</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -145,6 +149,8 @@ return [Object(debit=debit, credit=credit)]\n ...@@ -145,6 +149,8 @@ return [Object(debit=debit, credit=credit)]\n
<string>period_start_date</string> <string>period_start_date</string>
<string>precision</string> <string>precision</string>
<string>node_category</string> <string>node_category</string>
<string>function_uid</string>
<string>project_uid</string>
<string>from_date</string> <string>from_date</string>
<string>kw</string> <string>kw</string>
<string>Products.PythonScripts.standard</string> <string>Products.PythonScripts.standard</string>
...@@ -154,6 +160,7 @@ return [Object(debit=debit, credit=credit)]\n ...@@ -154,6 +160,7 @@ return [Object(debit=debit, credit=credit)]\n
<string>getInventoryAssetPrice</string> <string>getInventoryAssetPrice</string>
<string>dict</string> <string>dict</string>
<string>inventory_kw</string> <string>inventory_kw</string>
<string>_write_</string>
<string>_apply_</string> <string>_apply_</string>
<string>income_node_category</string> <string>income_node_category</string>
<string>balance_node_category</string> <string>balance_node_category</string>
...@@ -172,6 +179,8 @@ return [Object(debit=debit, credit=credit)]\n ...@@ -172,6 +179,8 @@ return [Object(debit=debit, credit=credit)]\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<none/>
<none/>
<none/> <none/>
<string>ignored</string> <string>ignored</string>
</tuple> </tuple>
......
1238 1241
\ 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