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

restore the substract 1 to from_date, the right way is not to show a previous...

restore the substract 1 to from_date, the right way is not to show a previous balance line if we do not have a from_date set

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7076 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent afd1669b
......@@ -121,22 +121,23 @@ params[\'node_uid\'] = kw.get(\'node_uid\', context.getUid())\n
new_result = []\n
net_balance = 0.0\n
\n
# Create a new parameter list to get the previous balance\n
get_inventory_kw = params.copy()\n
get_inventory_kw.update({ \'to_date\' : from_date,\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({ \'to_date\' : from_date,\n
\'where_expression\': " section.portal_type = \'Organisation\' "\n
})\n
\n
# Get previous debit and credit\n
getInventoryAssetPrice = context.getPortalObject().portal_simulation.getInventoryAssetPrice\n
previous_total_debit = getInventoryAssetPrice(omit_output=True, **get_inventory_kw)\n
previous_total_credit = getInventoryAssetPrice(omit_input =True, **get_inventory_kw)\n
# Get previous debit and credit\n
getInventoryAssetPrice = context.getPortalObject().portal_simulation.getInventoryAssetPrice\n
previous_total_debit = getInventoryAssetPrice(omit_output=True, **get_inventory_kw)\n
previous_total_credit = getInventoryAssetPrice(omit_input =True, **get_inventory_kw)\n
\n
if previous_total_credit != 0:\n
if previous_total_credit != 0:\n
previous_total_credit = - previous_total_credit\n
\n
# Show the previous balance if not empty\n
if previous_total_credit != 0 or previous_total_debit != 0:\n
# Show the previous balance if not empty\n
if previous_total_credit != 0 or previous_total_debit != 0:\n
from Products.ERP5Type.Document import newTempAccountingTransaction\n
\n
net_balance = r_(previous_total_debit - previous_total_credit)\n
......@@ -147,7 +148,7 @@ if previous_total_credit != 0 or previous_total_debit != 0:\n
\n
previous_balance.edit( \\\n
title = context.Base_translateString("Previous Balance")\n
, date = from_date\n
, date = from_date - 1\n
, portal_type = ""\n
, simulation_state_title = ""\n
, debit = previous_total_debit\n
......
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