Commit 8a5835cb authored by Jérome Perrin's avatar Jérome Perrin

Change what we display for initial balance are calculated. We actually display...

Change what we display for initial balance are calculated. We actually display 'initial_balance_if_debit' and 'initial_balance_if_credit'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16911 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c810951e
...@@ -85,6 +85,7 @@ inventory_movement_type_list = portal.getPortalInventoryMovementTypeList()\n ...@@ -85,6 +85,7 @@ inventory_movement_type_list = portal.getPortalInventoryMovementTypeList()\n
balance_movement_type_list = [ t for t in\n balance_movement_type_list = [ t for t in\n
portal.getPortalAccountingMovementTypeList()\n portal.getPortalAccountingMovementTypeList()\n
if t in inventory_movement_type_list ]\n if t in inventory_movement_type_list ]\n
\n
accounting_movement_type_list = [ t for t in\n accounting_movement_type_list = [ t for t in\n
portal.getPortalAccountingMovementTypeList()\n portal.getPortalAccountingMovementTypeList()\n
if t not in balance_movement_type_list ]\n if t not in balance_movement_type_list ]\n
...@@ -543,6 +544,11 @@ for (node_relative_url, mirror_section_uid, payment_uid), data in \\\n ...@@ -543,6 +544,11 @@ for (node_relative_url, mirror_section_uid, payment_uid), data in \\\n
\n \n
initial_debit_balance = data.get(\'initial_debit_balance\', 0)\n initial_debit_balance = data.get(\'initial_debit_balance\', 0)\n
initial_credit_balance = data.get(\'initial_credit_balance\', 0)\n initial_credit_balance = data.get(\'initial_credit_balance\', 0)\n
\n
initial_balance = initial_debit_balance - initial_credit_balance\n
# initial debit balance actually shows \n
initial_debit_balance = round(max(initial_balance, 0), precision)\n
initial_credit_balance = round(max(-initial_balance, 0) or 0, precision)\n
\n \n
total_initial_debit_balance += round(initial_debit_balance, precision)\n total_initial_debit_balance += round(initial_debit_balance, precision)\n
total_initial_credit_balance += round(initial_credit_balance, precision)\n total_initial_credit_balance += round(initial_credit_balance, precision)\n
...@@ -554,6 +560,7 @@ for (node_relative_url, mirror_section_uid, payment_uid), data in \\\n ...@@ -554,6 +560,7 @@ for (node_relative_url, mirror_section_uid, payment_uid), data in \\\n
total_final_balance_if_debit += round(max(closing_balance, 0), precision)\n total_final_balance_if_debit += round(max(closing_balance, 0), precision)\n
total_final_balance_if_credit += round(max(-closing_balance, 0) or 0, precision)\n total_final_balance_if_credit += round(max(-closing_balance, 0) or 0, precision)\n
\n \n
\n
line_list.append(Object(uid=\'new_\',\n line_list.append(Object(uid=\'new_\',\n
node_id=node_id,\n node_id=node_id,\n
node_title=node_title,\n node_title=node_title,\n
...@@ -580,7 +587,6 @@ def getStringIndex(obj):\n ...@@ -580,7 +587,6 @@ def getStringIndex(obj):\n
return obj[\'string_index\']\n return obj[\'string_index\']\n
line_list.sort(key=getStringIndex)\n line_list.sort(key=getStringIndex)\n
\n \n
\n
# cache values for stat\n # cache values for stat\n
request.set(\'TrialBalance.total_initial_debit_balance\',\n request.set(\'TrialBalance.total_initial_debit_balance\',\n
total_initial_debit_balance)\n total_initial_debit_balance)\n
...@@ -712,6 +718,7 @@ return line_list\n ...@@ -712,6 +718,7 @@ return line_list\n
<string>payment</string> <string>payment</string>
<string>initial_debit_balance</string> <string>initial_debit_balance</string>
<string>initial_credit_balance</string> <string>initial_credit_balance</string>
<string>initial_balance</string>
<string>final_debit_balance</string> <string>final_debit_balance</string>
<string>final_credit_balance</string> <string>final_credit_balance</string>
<string>closing_balance</string> <string>closing_balance</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