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
\n
result = []\n
\n
account_columns = ( (\'date\', \'Date\')\n
, (\'specific_reference\', \'Reference\')\n
, (\'title\', \'Label\')\n
, (\'translated_portal_type\', \'Type\')\n
, (\'third_party\', \'Third Party\')\n
, (\'translated_simulation_state_title\', \'State\')\n
, (\'debit\', \'Debit\')\n
, (\'credit\', \'Credit\')\n
, (\'net_balance\', \'Balance\')\n
)\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
(\'getTranslatedSimulationStateTitle\', \'State\'),\n
(\'Movement_getDebitPrice\', \'Debit\'),\n
(\'Movement_getCreditPrice\', \'Credit\'),\n
(\'total_price\', \'Balance\'),\n
(\'running_total_price\', \'Net\'), )\n
\n
if 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
del account_inventory_list_cache_params[\'from_date\']\n
\n
for c in gap_value_list:\n
# FIXME: this part is not working !\n
account_list = c.getGapRelatedValueList(portal_type="Account")\n
strict_account_list = c.getGapRelatedValueList(portal_type="Account",\n
strict_membership=1)\n
......@@ -167,8 +171,8 @@ for c in gap_value_list:\n
at_date=at_date,\n
simulation_state=simulation_state):\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_params[\'mirror_section_uid\'] = third_party_uid\n
title = "%s: %s (%s)" % ( c.getId()\n
, account.getTitle()\n
, third_party_brain.title\n
......@@ -186,7 +190,7 @@ for c in gap_value_list:\n
selection_params=third_party_params.copy(),\n
selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n
selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n
\n
elif account.isMemberOf(\'account_type/asset/cash/bank\'):\n
......@@ -196,8 +200,8 @@ for c in gap_value_list:\n
simulation_state=simulation_state):\n
bank_params = params.copy()\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_params[\'payment_uid\'] = bank_account_uid\n
title = "%s: %s (%s)" % ( c.getId()\n
, account.getTitle()\n
, bank_account_brain.title\n
......@@ -218,7 +222,7 @@ for c in gap_value_list:\n
selection_params=bank_params.copy(),\n
selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n
selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n
elif len(sim_tool.getMovementHistoryList(\n
node_uid=account.getUid(),\n
......@@ -232,7 +236,7 @@ for c in gap_value_list:\n
selection_params=params,\n
selection_columns=account_columns,\n
listbox_display_mode=\'FlatListMode\',\n
selection_sort_order=[(\'delivery.stop_date\',\n
selection_sort_order=[(\'stock.date\',\n
\'ascending\')]))\n
\n
return result\n
......
......@@ -73,6 +73,8 @@ account as node\n
"""\n
kw[\'node_uid\'] = context.getUid()\n
kw[\'omit_input\'] = 1\n
kw.update(kw[\'selection\'].getParams())\n
\n
# here, or 0 is to prevent displaying "- 0"\n
return - context.Node_statAccountingBalance(**kw) or 0\n
</string> </value>
......@@ -121,6 +123,7 @@ return - context.Node_statAccountingBalance(**kw) or 0\n
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string>
</tuple>
</value>
......
......@@ -73,6 +73,8 @@ account as a node\n
"""\n
kw[\'node_uid\'] = context.getUid()\n
kw[\'omit_output\'] = 1\n
kw.update(kw[\'selection\'].getParams())\n
\n
return context.Node_statAccountingBalance(**kw)\n
</string> </value>
</item>
......@@ -120,6 +122,7 @@ return context.Node_statAccountingBalance(**kw)\n
<string>_getattr_</string>
<string>context</string>
<string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string>
</tuple>
</value>
......
143
\ No newline at end of file
144
\ 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