Commit 65801198 authored by Fabien Morin's avatar Fabien Morin

if ppl have a source, don't take it into account in the report :...

if ppl have a source, don't take it into account in the report : Transformation report don't depend on the resource provider. If you select a currency in the report dialog, amount in the report will be displayed only if they match this currency or if they don't have any currency.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33751 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 373a9498
...@@ -54,13 +54,21 @@ ...@@ -54,13 +54,21 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>request = context.REQUEST\n <value> <string>request = context.REQUEST\n
\n
context.getPortalType()\n
\n
request.other[\'categories\'] = reference_variation_category_list\n request.other[\'categories\'] = reference_variation_category_list\n
tmp_context = context.asContext(context=context, REQUEST=request)\n tmp_context = context.asContext(context=context, REQUEST=request)\n
price_currency = kw.get(\'price_currency\', None)\n
\n
result = context.getAggregatedAmountList(tmp_context)\n
final_result = []\n
for line in result:\n
resource = line.getResourceValue()\n
sender_value = None\n
if resource is not None:\n
sender = line.getResourceValue().getPurchaseSupplyLineSource()\n
line.setCategoryMembership(\'source\', sender)\n
line.setCategoryMembership(\'price_currency\', price_currency)\n
\n \n
return context.getAggregatedAmountList(tmp_context)\n return result\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -104,6 +112,15 @@ return context.getAggregatedAmountList(tmp_context)\n ...@@ -104,6 +112,15 @@ return context.getAggregatedAmountList(tmp_context)\n
<string>request</string> <string>request</string>
<string>_write_</string> <string>_write_</string>
<string>tmp_context</string> <string>tmp_context</string>
<string>None</string>
<string>price_currency</string>
<string>result</string>
<string>final_result</string>
<string>_getiter_</string>
<string>line</string>
<string>resource</string>
<string>sender_value</string>
<string>sender</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -59,8 +59,16 @@ ...@@ -59,8 +59,16 @@
request = context.REQUEST\n request = context.REQUEST\n
request.other[\'categories\'] = reference_variation_category_list\n request.other[\'categories\'] = reference_variation_category_list\n
tmp_context = context.asContext(context=context, REQUEST=request)\n tmp_context = context.asContext(context=context, REQUEST=request)\n
price_currency = request.get(\'price_currency\', None)\n
\n \n
aal = context.getAggregatedAmountList(tmp_context)\n aal = context.getAggregatedAmountList(tmp_context)\n
for line in aal:\n
resource = line.getResourceValue()\n
sender_value = None\n
if resource is not None:\n
sender = line.getResourceValue().getPurchaseSupplyLineSource()\n
line.setCategoryMembership(\'source\', sender)\n
line.setCategoryMembership(\'price_currency\', price_currency)\n
\n \n
result = aal.getTotalPrice()\n result = aal.getTotalPrice()\n
return result\n return result\n
...@@ -114,7 +122,13 @@ else:\n ...@@ -114,7 +122,13 @@ else:\n
<string>request</string> <string>request</string>
<string>_write_</string> <string>_write_</string>
<string>tmp_context</string> <string>tmp_context</string>
<string>price_currency</string>
<string>aal</string> <string>aal</string>
<string>_getiter_</string>
<string>line</string>
<string>resource</string>
<string>sender_value</string>
<string>sender</string>
<string>result</string> <string>result</string>
</tuple> </tuple>
</value> </value>
......
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
<list> <list>
<string>your_portal_skin</string> <string>your_portal_skin</string>
<string>your_format</string> <string>your_format</string>
<string>your_price_currency</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_price_currency</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_category</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Currency</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.CurrencyModule_getCurrencyItemList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
471 474
\ 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