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

support cancellation amount in accounting reports

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27718 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d33164e5
...@@ -53,7 +53,13 @@ ...@@ -53,7 +53,13 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return getattr(brain, \'credit_price\', max(-(brain.total_price or 0), 0))\n <value> <string>credit_price = getattr(brain, \'credit_price\', None)\n
if credit_price is None:\n
if brain.isCancellationAmount():\n
credit_price = min(-(brain.total_price or 0), 0)\n
else:\n
credit_price = max(-(brain.total_price or 0), 0)\n
return credit_price\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -94,8 +100,11 @@ ...@@ -94,8 +100,11 @@
<string>selection</string> <string>selection</string>
<string>kwd</string> <string>kwd</string>
<string>getattr</string> <string>getattr</string>
<string>max</string> <string>None</string>
<string>credit_price</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>min</string>
<string>max</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -53,7 +53,13 @@ ...@@ -53,7 +53,13 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return getattr(brain, \'debit_price\', max(brain.total_price, 0))\n <value> <string>debit_price = getattr(brain, \'debit_price\', None)\n
if debit_price is None:\n
if brain.isCancellationAmount():\n
debit_price = min(brain.total_price, 0)\n
else:\n
debit_price = max(brain.total_price, 0)\n
return debit_price\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -94,8 +100,11 @@ ...@@ -94,8 +100,11 @@
<string>selection</string> <string>selection</string>
<string>kwd</string> <string>kwd</string>
<string>getattr</string> <string>getattr</string>
<string>max</string> <string>None</string>
<string>debit_price</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>min</string>
<string>max</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
944 945
\ 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