Commit 2f0b407c authored by Kevin Deldycke's avatar Kevin Deldycke

Remove previous hack by a less intrusive one.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 71699b6f
......@@ -81,7 +81,7 @@ at_date = preference.getPreferredAccountingTransactionAtDate()\n
# Build the common inventory dict\n
params = {}\n
\n
if kw.get(\'no_from_date\', 0): from_date = None\n
if kw.get(\'no_from_date\', False): from_date = None\n
\n
if simulation_state: params[\'simulation_state\'] = simulation_state\n
if section_category: params[\'section_category\'] = section_category\n
......@@ -93,20 +93,20 @@ if kw.has_key(\'portal_type\'): params[\'portal_type\'] = kw[\'portal_type\']\n
new_result = []\n
net_balance = 0.0\n
\n
if from_date is not None :\n
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
get_inventory_kw.update({ \'omit_simulation\' : True\n
, \'payment_uid\' : context.getUid()\n
, \'to_date\' : from_date\n
, \'section_portal_type_list\': [\'Organisation\']\n
, \'stat\' : 1\n
, \'where_expression\': " section.portal_type = \'Organisation\' "\n
, \'stat\' : True\n
})\n
\n
getInventory = context.getPortalObject().portal_simulation.getInventory\n
# Get previous debit and credit\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
previous_total_debit = r_(getInventory(omit_output=True, **get_inventory_kw))\n
previous_total_credit = r_(getInventory(omit_input =True, **get_inventory_kw))\n
if previous_total_credit != 0:\n
previous_total_credit = - previous_total_credit\n
\n
......@@ -228,11 +228,13 @@ return new_result\n
<string>from_date</string>
<string>at_date</string>
<string>params</string>
<string>False</string>
<string>None</string>
<string>_write_</string>
<string>new_result</string>
<string>net_balance</string>
<string>get_inventory_kw</string>
<string>True</string>
<string>getInventory</string>
<string>_apply_</string>
<string>previous_total_debit</string>
......@@ -240,7 +242,6 @@ return new_result\n
<string>Products.ERP5Type.Document</string>
<string>newTempAccountingTransaction</string>
<string>previous_balance</string>
<string>True</string>
<string>result</string>
<string>_getiter_</string>
<string>l</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