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

hardcode precision instead of using wrong scripts

parent e94fff31
...@@ -71,9 +71,6 @@ request = context.REQUEST\n ...@@ -71,9 +71,6 @@ request = context.REQUEST\n
gap_base = request.get("gap_base", "gap/fr/pcg/")\n gap_base = request.get("gap_base", "gap/fr/pcg/")\n
getURL = lambda gap_id: context.GAPCategory_getURLFromId(gap_id, gap_base)\n getURL = lambda gap_id: context.GAPCategory_getURLFromId(gap_id, gap_base)\n
\n \n
precision = context.Base_getPreferredPrecision()\n
r_ = lambda x: context.Base_getRoundValue(x, precision)\n
\n
section = context.restrictedTraverse(request.get("organisation"))\n section = context.restrictedTraverse(request.get("organisation"))\n
section_region = section.getRegion()\n section_region = section.getRegion()\n
\n \n
...@@ -81,8 +78,8 @@ section_region = section.getRegion()\n ...@@ -81,8 +78,8 @@ section_region = section.getRegion()\n
params = { \'omit_simulation\' : True\n params = { \'omit_simulation\' : True\n
, \'simulation_state\': request.get("simulation_state", [\'stopped\', \'delivered\'])\n , \'simulation_state\': request.get("simulation_state", [\'stopped\', \'delivered\'])\n
, \'section_uid\' : section.getUid()\n , \'section_uid\' : section.getUid()\n
, \'precision\' : 2\n
, \'at_date\' : request[\'at_date\']\n , \'at_date\' : request[\'at_date\']\n
, \'where_expression\': " section.portal_type = \'Organisation\' "\n
}\n }\n
params.update(kw)\n params.update(kw)\n
\n \n
...@@ -134,12 +131,12 @@ for gap_id in gap_id_list:\n ...@@ -134,12 +131,12 @@ for gap_id in gap_id_list:\n
\n \n
# Get the transaction\'s balance\n # Get the transaction\'s balance\n
if not region.startswith(section_region):\n if not region.startswith(section_region):\n
new_balance = r_(r_(new_balance) + r_(transaction.total_price)) or 0.0\n new_balance = new_balance + transaction.total_price\n
\n \n
# Update the general balance\n # Update the general balance\n
net_balance = r_(r_(net_balance) + r_(new_balance))\n net_balance = net_balance + new_balance\n
\n \n
return r_(net_balance)\n return net_balance\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
26 27
\ No newline at end of file \ 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