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

don't substract 1 to from_date, because it might be None in case it's not set in preferences

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7071 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 37007ea9
...@@ -66,8 +66,7 @@ ...@@ -66,8 +66,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>src__ = False\n <value> <string>src__ = kw.get(\'src__\', False)\n
if kw.has_key(\'src__\'): src__ = kw[\'src__\']\n
precision = context.Base_getPreferredPrecision()\n precision = context.Base_getPreferredPrecision()\n
r_ = lambda x: context.Base_getRoundValue(x, precision)\n r_ = lambda x: context.Base_getRoundValue(x, precision)\n
\n \n
...@@ -92,10 +91,13 @@ at_date = kw.get(\'at_date\', preference.getPreferredAccountin ...@@ -92,10 +91,13 @@ at_date = kw.get(\'at_date\', preference.getPreferredAccountin
# Build the common inventory dict\n # Build the common inventory dict\n
params = {}\n params = {}\n
\n \n
if kw.get(\'no_from_date\', False): from_date = None\n if kw.get(\'no_from_date\', False):\n
from_date = None\n
\n \n
if simulation_state: params[\'simulation_state\'] = simulation_state\n if simulation_state:\n
if section_category: params[\'section_category\'] = section_category\n params[\'simulation_state\'] = simulation_state\n
if section_category:\n
params[\'section_category\'] = section_category\n
\n \n
# Get payment and mirror related parameters\n # Get payment and mirror related parameters\n
MARKER = []\n MARKER = []\n
...@@ -121,10 +123,8 @@ net_balance = 0.0\n ...@@ -121,10 +123,8 @@ net_balance = 0.0\n
\n \n
# Create a new parameter list to get the previous balance\n # Create a new parameter list to get the previous balance\n
get_inventory_kw = params.copy()\n get_inventory_kw = params.copy()\n
get_inventory_kw.update({ \'omit_simulation\' : True\n get_inventory_kw.update({ \'to_date\' : from_date,\n
, \'to_date\' : from_date\n \'where_expression\': " section.portal_type = \'Organisation\' "\n
, \'where_expression\': " section.portal_type = \'Organisation\' "\n
, \'stat\' : True\n
})\n })\n
\n \n
# Get previous debit and credit\n # Get previous debit and credit\n
...@@ -147,7 +147,7 @@ if previous_total_credit != 0 or previous_total_debit != 0:\n ...@@ -147,7 +147,7 @@ if previous_total_credit != 0 or previous_total_debit != 0:\n
\n \n
previous_balance.edit( \\\n previous_balance.edit( \\\n
title = context.Base_translateString("Previous Balance")\n title = context.Base_translateString("Previous Balance")\n
, date = from_date - 1\n , date = from_date\n
, portal_type = ""\n , portal_type = ""\n
, simulation_state_title = ""\n , simulation_state_title = ""\n
, debit = previous_total_debit\n , debit = previous_total_debit\n
...@@ -240,10 +240,9 @@ return new_result\n ...@@ -240,10 +240,9 @@ return new_result\n
<tuple> <tuple>
<string>selection</string> <string>selection</string>
<string>kw</string> <string>kw</string>
<string>_getattr_</string>
<string>False</string> <string>False</string>
<string>src__</string> <string>src__</string>
<string>_getattr_</string>
<string>_getitem_</string>
<string>context</string> <string>context</string>
<string>precision</string> <string>precision</string>
<string>r_</string> <string>r_</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