Commit 15369bb0 authored by Jérome Perrin's avatar Jérome Perrin

typo in getInventory variable name, (+ big mistake in copy/paste,...

typo in getInventory variable name, (+ big mistake in copy/paste, BankAccount_getAccountingTransactionList was commited with the content of Entity_getAccountingTransactionList)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6478 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b82e384
......@@ -97,18 +97,17 @@ if from_date is not None :\n
# Create a new parameter list to get the previous balance\n
get_inventory_kw = params.copy()\n
get_inventory_kw.update({ \'omit_simulation\' : 1\n
, \'payment_uid\' : context.getUid()\n
, \'to_date\' : from_date\n
, \'mirror_section_uid\' : context.getUid()\n
, \'section_portal_type_list\': [\'Organisation\']\n
, \'stat\' : 1\n
})\n
getInventory = context.getPortalObject()\\\n
.portal_simulation.getInventoryAssetPrice\n
\n
getInventory = context.getPortalObject().portal_simulation.getInventory\n
# Get previous debit and credit\n
previous_total_debit = r_(getInventoryAssetPrice(omit_output=1,\n
**get_inventory_kw))\n
previous_total_credit = r_(getInventoryAssetPrice(omit_input =1,\n
**get_inventory_kw))\n
if previous_total_credit != 0 :\n
previous_total_debit = r_(getInventory(omit_output=1, **get_inventory_kw))\n
previous_total_credit = r_(getInventory(omit_input =1, **get_inventory_kw))\n
if previous_total_credit != 0:\n
previous_total_credit = - previous_total_credit\n
\n
# Show the previous balance if not empty\n
......@@ -122,17 +121,12 @@ if from_date is not None :\n
previous_balance.setUid(\'new_000\')\n
\n
previous_balance.edit( \\\n
parent_title = context.Base_translateString("Previous Balance")\n
, section_title = ""\n
title = context.Base_translateString("Previous Balance")\n
, date = from_date - 1\n
, portal_type = ""\n
, account_uid = None\n
, parent_reference = None\n
, parent_specific_reference = None\n
, translated_simulation_state_title = None\n
, simulation_state_title = ""\n
, debit = previous_total_debit\n
, credit = previous_total_credit\n
, grouping_reference = None\n
, balance = net_balance\n
, net_balance = net_balance\n
, is_previous_balance = True\n
......@@ -143,8 +137,15 @@ if from_date is not None :\n
# Show / Hide grouping if needed\n
if kw.has_key(\'hide_grouping\'): params[\'hide_grouping\'] = kw[\'hide_grouping\']\n
\n
# FIXME: same problem as in BankAccount_getAccountingTransactionList\n
result = context.Entity_zGetAccountingTransactionList( from_date = from_date\n
# FIXME:\n
# using listbox current page number * number of line per listbox page, you can call a\n
# ZSQL Method to initialize net_balance and calculate this only for this page.\n
#\n
# But this is just temporary because some day, erp5_accounting will be rewritten using\n
# only portal_catalog and getInventory. The Iventory API should provide a way to implement\n
# such a net_balance column (in one instruction, so that we do not need to write a wrapping\n
# list method like this one)\n
result = context.BankAccount_zGetAccountingTransactionList( from_date = from_date\n
, at_date = at_date\n
, src__ = src__\n
, **params\n
......@@ -163,13 +164,7 @@ for l in result:\n
, debit = l.debit\n
, date = l.date\n
, section_title = l.section_title\n
, parent_reference = l.parent_reference\n
, parent_specific_reference = l.parent_specific_reference\n
, translated_simulation_state_title = o.getTranslatedSimulationStateTitle()\n
# FIXME: overriding \'portal_type\' in asContext is clearly a bad idea, as many methods are storred on the portal type\n
# (hence the translated_simulation_state_title hack) -j\xc3\xa9rome\n
, portal_type = l.portal_type\n
, account_uid = l.account_uid\n
, specific_reference = l.specific_reference\n
)\n
new_result.append(c)\n
\n
......@@ -240,7 +235,6 @@ return new_result\n
<string>get_inventory_kw</string>
<string>getInventory</string>
<string>_apply_</string>
<string>getInventoryAssetPrice</string>
<string>previous_total_debit</string>
<string>previous_total_credit</string>
<string>Products.ERP5Type.Document</string>
......
......@@ -104,9 +104,9 @@ if from_date is not None :\n
getInventory = context.getPortalObject()\\\n
.portal_simulation.getInventoryAssetPrice\n
# Get previous debit and credit\n
previous_total_debit = r_(getInventoryAssetPrice(omit_output=1,\n
previous_total_debit = r_(getInventory(omit_output=1,\n
**get_inventory_kw))\n
previous_total_credit = r_(getInventoryAssetPrice(omit_input =1,\n
previous_total_credit = r_(getInventory(omit_input =1,\n
**get_inventory_kw))\n
if previous_total_credit != 0 :\n
previous_total_credit = - previous_total_credit\n
......@@ -240,7 +240,6 @@ return new_result\n
<string>get_inventory_kw</string>
<string>getInventory</string>
<string>_apply_</string>
<string>getInventoryAssetPrice</string>
<string>previous_total_debit</string>
<string>previous_total_credit</string>
<string>Products.ERP5Type.Document</string>
......
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