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
movement_portal_type=portal.getPortalAccountingMovementTypeList(),\n
no_mirror_section_uid_cache=1,\n
hide_grouping=request.get(\'omit_grouping_reference\', False))\n
\n
if len(simulation_state) > 1:\n
account_columns = (\n
(\'Movement_getSpecificReference\', \'Reference\'),\n
(\'Movement_getExplanationTitle\', \'Title\'),\n
(\'date\', \'Date\'),\n
(\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n
(\'Movement_getExplanationReference\', \'Invoice Number\'),\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
project = request.get(\'project\')\n
if project:\n
params[\'project_uid\'] = portal.portal_categories.restrictedTraverse(project).getUid()\n
function = request.get(\'function\')\n
if function:\n
params[\'function_uid\'] = portal.portal_categories.restrictedTraverse(function).getUid()\n
\n
account_columns = (\n
(\'Movement_getSpecificReference\', \'Reference\'),\n
(\'Movement_getExplanationTitle\', \'Title\'),\n
(\'date\', \'Date\'),\n
(\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\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
(\'credit\', \'Credit\'),\n
(\'running_total_price\', \'Net\'), )\n
......@@ -507,8 +505,11 @@ return report_section_list\n
<string>_write_</string>
<string>dict</string>
<string>params</string>
<string>len</string>
<string>project</string>
<string>function</string>
<string>account_columns</string>
<string>len</string>
<string>_inplacevar_</string>
<string>traverse</string>
<string>account_name_cache</string>
<string>getAccountName</string>
......
......@@ -61,6 +61,10 @@ inventory_kw = dict(section_uid=section_uid,\n
at_date=at_date,\n
portal_type=context.getPortalAccountingMovementTypeList(),\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
if node_category:\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
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -133,7 +137,7 @@ return [Object(debit=debit, credit=credit)]\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>7</int> </value>
<value> <int>9</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -145,6 +149,8 @@ return [Object(debit=debit, credit=credit)]\n
<string>period_start_date</string>
<string>precision</string>
<string>node_category</string>
<string>function_uid</string>
<string>project_uid</string>
<string>from_date</string>
<string>kw</string>
<string>Products.PythonScripts.standard</string>
......@@ -154,6 +160,7 @@ return [Object(debit=debit, credit=credit)]\n
<string>getInventoryAssetPrice</string>
<string>dict</string>
<string>inventory_kw</string>
<string>_write_</string>
<string>_apply_</string>
<string>income_node_category</string>
<string>balance_node_category</string>
......@@ -172,6 +179,8 @@ return [Object(debit=debit, credit=credit)]\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<string>ignored</string>
</tuple>
......
1238
\ No newline at end of file
1241
\ 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