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

update general ledger report to use new columns names in...

update general ledger report to use new columns names in Account_viewAccountingTransactionList/listbox.
Account_statCredit/Account_statDebit reinject selection parameters in the query, because general ledger uses Account_viewAccountingTransactionList with mirror_section_uid or payment_uid.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11641 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c6725399
...@@ -103,16 +103,19 @@ else:\n ...@@ -103,16 +103,19 @@ else:\n
\n \n
result = []\n result = []\n
\n \n
account_columns = ( (\'date\', \'Date\')\n \n
, (\'specific_reference\', \'Reference\')\n account_columns = (\n
, (\'title\', \'Label\')\n (\'Movement_getSpecificReference\', \'Reference\'),\n
, (\'translated_portal_type\', \'Type\')\n (\'Movement_getExplanationTitle\', \'Title\'),\n
, (\'third_party\', \'Third Party\')\n (\'date\', \'Date\'),\n
, (\'translated_simulation_state_title\', \'State\')\n (\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n
, (\'debit\', \'Debit\')\n (\'Movement_getExplanationReference\', \'Invoice Number\'),\n
, (\'credit\', \'Credit\')\n (\'Movement_getMirrorSectionTitle\', \'Third Party\'),\n
, (\'net_balance\', \'Balance\')\n (\'getTranslatedSimulationStateTitle\', \'State\'),\n
)\n (\'Movement_getDebitPrice\', \'Debit\'),\n
(\'Movement_getCreditPrice\', \'Credit\'),\n
(\'total_price\', \'Balance\'),\n
(\'running_total_price\', \'Net\'), )\n
\n \n
if gap:\n if gap:\n
gap_value_list = [cat_tool.gap.restrictedTraverse(gap)] + \\\n gap_value_list = [cat_tool.gap.restrictedTraverse(gap)] + \\\n
...@@ -133,6 +136,7 @@ if account_inventory_list_cache_params.has_key(\'from_date\'):\n ...@@ -133,6 +136,7 @@ if account_inventory_list_cache_params.has_key(\'from_date\'):\n
del account_inventory_list_cache_params[\'from_date\']\n del account_inventory_list_cache_params[\'from_date\']\n
\n \n
for c in gap_value_list:\n for c in gap_value_list:\n
# FIXME: this part is not working !\n
account_list = c.getGapRelatedValueList(portal_type="Account")\n account_list = c.getGapRelatedValueList(portal_type="Account")\n
strict_account_list = c.getGapRelatedValueList(portal_type="Account",\n strict_account_list = c.getGapRelatedValueList(portal_type="Account",\n
strict_membership=1)\n strict_membership=1)\n
...@@ -167,8 +171,8 @@ for c in gap_value_list:\n ...@@ -167,8 +171,8 @@ for c in gap_value_list:\n
at_date=at_date,\n at_date=at_date,\n
simulation_state=simulation_state):\n simulation_state=simulation_state):\n
third_party_params = params.copy()\n third_party_params = params.copy()\n
third_party_params[\'mirror_section_uid\'] = third_party_brain.uid\n
third_party_uid = third_party_brain.uid or " = NULL"\n third_party_uid = third_party_brain.uid or " = NULL"\n
third_party_params[\'mirror_section_uid\'] = third_party_uid\n
title = "%s: %s (%s)" % ( c.getId()\n title = "%s: %s (%s)" % ( c.getId()\n
, account.getTitle()\n , account.getTitle()\n
, third_party_brain.title\n , third_party_brain.title\n
...@@ -186,7 +190,7 @@ for c in gap_value_list:\n ...@@ -186,7 +190,7 @@ for c in gap_value_list:\n
selection_params=third_party_params.copy(),\n selection_params=third_party_params.copy(),\n
selection_columns=account_columns,\n selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n \'ascending\')]))\n
\n \n
elif account.isMemberOf(\'account_type/asset/cash/bank\'):\n elif account.isMemberOf(\'account_type/asset/cash/bank\'):\n
...@@ -196,8 +200,8 @@ for c in gap_value_list:\n ...@@ -196,8 +200,8 @@ for c in gap_value_list:\n
simulation_state=simulation_state):\n simulation_state=simulation_state):\n
bank_params = params.copy()\n bank_params = params.copy()\n
if bank_account_brain.path is not None:\n if bank_account_brain.path is not None:\n
bank_params[\'payment_uid\'] = bank_account_brain.uid\n
bank_account_uid = bank_account_brain.uid or " = NULL"\n bank_account_uid = bank_account_brain.uid or " = NULL"\n
bank_params[\'payment_uid\'] = bank_account_uid\n
title = "%s: %s (%s)" % ( c.getId()\n title = "%s: %s (%s)" % ( c.getId()\n
, account.getTitle()\n , account.getTitle()\n
, bank_account_brain.title\n , bank_account_brain.title\n
...@@ -218,7 +222,7 @@ for c in gap_value_list:\n ...@@ -218,7 +222,7 @@ for c in gap_value_list:\n
selection_params=bank_params.copy(),\n selection_params=bank_params.copy(),\n
selection_columns=account_columns,\n selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n \'ascending\')]))\n
elif len(sim_tool.getMovementHistoryList(\n elif len(sim_tool.getMovementHistoryList(\n
node_uid=account.getUid(),\n node_uid=account.getUid(),\n
...@@ -232,7 +236,7 @@ for c in gap_value_list:\n ...@@ -232,7 +236,7 @@ for c in gap_value_list:\n
selection_params=params,\n selection_params=params,\n
selection_columns=account_columns,\n selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n \'ascending\')]))\n
\n \n
return result\n return result\n
......
...@@ -73,6 +73,8 @@ account as node\n ...@@ -73,6 +73,8 @@ account as node\n
"""\n """\n
kw[\'node_uid\'] = context.getUid()\n kw[\'node_uid\'] = context.getUid()\n
kw[\'omit_input\'] = 1\n kw[\'omit_input\'] = 1\n
kw.update(kw[\'selection\'].getParams())\n
\n
# here, or 0 is to prevent displaying "- 0"\n # here, or 0 is to prevent displaying "- 0"\n
return - context.Node_statAccountingBalance(**kw) or 0\n return - context.Node_statAccountingBalance(**kw) or 0\n
</string> </value> </string> </value>
...@@ -121,6 +123,7 @@ return - context.Node_statAccountingBalance(**kw) or 0\n ...@@ -121,6 +123,7 @@ return - context.Node_statAccountingBalance(**kw) or 0\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>_write_</string> <string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -73,6 +73,8 @@ account as a node\n ...@@ -73,6 +73,8 @@ account as a node\n
"""\n """\n
kw[\'node_uid\'] = context.getUid()\n kw[\'node_uid\'] = context.getUid()\n
kw[\'omit_output\'] = 1\n kw[\'omit_output\'] = 1\n
kw.update(kw[\'selection\'].getParams())\n
\n
return context.Node_statAccountingBalance(**kw)\n return context.Node_statAccountingBalance(**kw)\n
</string> </value> </string> </value>
</item> </item>
...@@ -120,6 +122,7 @@ return context.Node_statAccountingBalance(**kw)\n ...@@ -120,6 +122,7 @@ return context.Node_statAccountingBalance(**kw)\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>_write_</string> <string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
......
143 144
\ 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