Commit 2d402ea6 authored by Jérome Perrin's avatar Jérome Perrin

hide lines for which total_price == 0

use total_price instead of quantity
be side independant


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5612 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2cc58c28
...@@ -51,25 +51,25 @@ ...@@ -51,25 +51,25 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>destination_section_uid</string> </key> <key> <string>from_date</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>from_date</string> </key> <key> <string>mirror_section_uid</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>no_destination_section_uid</string> </key> <key> <string>no_mirror_section_uid</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>no_source_payment_uid</string> </key> <key> <string>no_payment_uid</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
...@@ -92,6 +92,12 @@ ...@@ -92,6 +92,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>query</string> </key> <key> <string>query</string> </key>
<value> <value>
...@@ -109,12 +115,6 @@ ...@@ -109,12 +115,6 @@
</dictionary> </dictionary>
</value> </value>
</item> </item>
<item>
<key> <string>source_payment_uid</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>to_date</string> </key> <key> <string>to_date</string> </key>
<value> <value>
...@@ -145,20 +145,20 @@ ...@@ -145,20 +145,20 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>node_uid</string> <string>node_uid</string>
<string>query</string> <string>query</string>
<string>omit_input</string> <string>omit_input</string>
<string>omit_output</string> <string>omit_output</string>
<string>resource_uid</string> <string>resource_uid</string>
<string>from_date</string> <string>from_date</string>
<string>to_date</string> <string>to_date</string>
<string>at_date</string> <string>at_date</string>
<string>transaction_simulation_state</string> <string>transaction_simulation_state</string>
<string>transaction_section_category</string> <string>transaction_section_category</string>
<string>source_payment_uid</string> <string>payment_uid</string>
<string>no_source_payment_uid</string> <string>no_payment_uid</string>
<string>destination_section_uid</string> <string>mirror_section_uid</string>
<string>no_destination_section_uid</string> <string>no_mirror_section_uid</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -191,10 +191,10 @@ to_date\r\n ...@@ -191,10 +191,10 @@ to_date\r\n
at_date\r\n at_date\r\n
transaction_simulation_state:list\r\n transaction_simulation_state:list\r\n
transaction_section_category\r\n transaction_section_category\r\n
source_payment_uid\r\n payment_uid\r\n
no_source_payment_uid\r\n no_payment_uid\r\n
destination_section_uid\r\n mirror_section_uid\r\n
no_destination_section_uid</string> </value> no_mirror_section_uid</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -235,22 +235,21 @@ no_destination_section_uid</string> </value> ...@@ -235,22 +235,21 @@ no_destination_section_uid</string> </value>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
SELECT\n SELECT\n
SUM(stock.quantity) AS quantity\n SUM(stock.quantity) AS quantity,\n
SUM(stock.total_price) AS total_price\n
FROM\n FROM\n
movement,\n movement,\n
stock,\n stock,\n
catalog as child,\n catalog as child,\n
catalog,\n
catalog AS section_c,\n catalog AS section_c,\n
catalog AS section_bc,\n catalog AS section_bc, -- XXX probably not necessary\n
category AS section_membership,\n category AS section_membership,\n
catalog AS section\n catalog AS section\n
<dtml-if query>\n <dtml-if query>\n
, category\n , category\n
</dtml-if>\n </dtml-if>\n
WHERE stock.node_uid = <dtml-var node_uid>\n WHERE stock.node_uid = <dtml-var node_uid>\n
AND child.uid = stock.uid \n AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
AND child.portal_type <> \'Simulation Movement\'\n AND child.portal_type <> \'Simulation Movement\'\n
AND movement.is_accountable = 1\n AND movement.is_accountable = 1\n
...@@ -271,32 +270,32 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -271,32 +270,32 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
AND stock.date < <dtml-sqlvar to_date type="datetime">\n AND stock.date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity > 0.0\n AND stock.total_price > 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity < 0.0\n AND stock.total_price < 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n <dtml-if payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n AND stock.payment_uid = <dtml-sqlvar payment_uid type="int">\n
</dtml-if>\n </dtml-if>\n
<dtml-if no_source_payment_uid>\n <dtml-if no_payment_uid>\n
AND stock.payment_uid IS NULL\n AND stock.payment_uid IS NULL\n
</dtml-if>\n </dtml-if>\n
<dtml-if destination_section_uid>\n <dtml-if mirror_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n AND stock.mirror_section_uid = <dtml-sqlvar mirror_section_uid type="int">\n
</dtml-if>\n </dtml-if>\n
<dtml-if no_destination_section_uid>\n <dtml-if no_mirror_section_uid>\n
AND stock.mirror_section_uid IS NULL\n AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n </dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
catalog.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n stock.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n </dtml-in>\n
)\n )\n
<dtml-else>\n <dtml-else>\n
AND catalog.simulation_state != \'cancelled\' \n AND stock.simulation_state != \'cancelled\' \n
AND catalog.simulation_state != \'draft\' \n AND stock.simulation_state != \'draft\' \n
</dtml-if>\n </dtml-if>\n
AND section.uid = stock.section_uid\n AND section.uid = stock.section_uid\n
<dtml-if transaction_section_category>\n <dtml-if transaction_section_category>\n
...@@ -308,7 +307,8 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -308,7 +307,8 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
<dtml-if query>\n <dtml-if query>\n
AND category.uid = stock.section_uid\n AND category.uid = stock.section_uid\n
AND <dtml-var query>\n AND <dtml-var query>\n
</dtml-if> </dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -347,22 +347,21 @@ AND <dtml-var query>\n ...@@ -347,22 +347,21 @@ AND <dtml-var query>\n
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
SELECT\n SELECT\n
SUM(stock.quantity) AS quantity\n SUM(stock.quantity) AS quantity,\n
SUM(stock.total_price) AS total_price\n
FROM\n FROM\n
movement,\n movement,\n
stock,\n stock,\n
catalog as child,\n catalog as child,\n
catalog,\n
catalog AS section_c,\n catalog AS section_c,\n
catalog AS section_bc,\n catalog AS section_bc, -- XXX probably not necessary\n
category AS section_membership,\n category AS section_membership,\n
catalog AS section\n catalog AS section\n
<dtml-if query>\n <dtml-if query>\n
, category\n , category\n
</dtml-if>\n </dtml-if>\n
WHERE stock.node_uid = <dtml-var node_uid>\n WHERE stock.node_uid = <dtml-var node_uid>\n
AND child.uid = stock.uid \n AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n
AND movement.uid = stock.uid\n AND movement.uid = stock.uid\n
AND child.portal_type <> \'Simulation Movement\'\n AND child.portal_type <> \'Simulation Movement\'\n
AND movement.is_accountable = 1\n AND movement.is_accountable = 1\n
...@@ -383,32 +382,32 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -383,32 +382,32 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
AND stock.date < <dtml-sqlvar to_date type="datetime">\n AND stock.date < <dtml-sqlvar to_date type="datetime">\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_input>\n <dtml-if omit_input>\n
AND stock.quantity > 0.0\n AND stock.total_price > 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if omit_output>\n <dtml-if omit_output>\n
AND stock.quantity < 0.0\n AND stock.total_price < 0.0\n
</dtml-if>\n </dtml-if>\n
<dtml-if source_payment_uid>\n <dtml-if payment_uid>\n
AND stock.payment_uid = <dtml-sqlvar source_payment_uid type="int">\n AND stock.payment_uid = <dtml-sqlvar payment_uid type="int">\n
</dtml-if>\n </dtml-if>\n
<dtml-if no_source_payment_uid>\n <dtml-if no_payment_uid>\n
AND stock.payment_uid IS NULL\n AND stock.payment_uid IS NULL\n
</dtml-if>\n </dtml-if>\n
<dtml-if destination_section_uid>\n <dtml-if mirror_section_uid>\n
AND stock.mirror_section_uid = <dtml-sqlvar destination_section_uid type="int">\n AND stock.mirror_section_uid = <dtml-sqlvar mirror_section_uid type="int">\n
</dtml-if>\n </dtml-if>\n
<dtml-if no_destination_section_uid>\n <dtml-if no_mirror_section_uid>\n
AND stock.mirror_section_uid IS NULL\n AND stock.mirror_section_uid IS NULL\n
</dtml-if>\n </dtml-if>\n
<dtml-if transaction_simulation_state>\n <dtml-if transaction_simulation_state>\n
AND (\n AND (\n
<dtml-in transaction_simulation_state>\n <dtml-in transaction_simulation_state>\n
catalog.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n stock.simulation_state = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n </dtml-in>\n
)\n )\n
<dtml-else>\n <dtml-else>\n
AND catalog.simulation_state != \'cancelled\' \n AND stock.simulation_state != \'cancelled\' \n
AND catalog.simulation_state != \'draft\' \n AND stock.simulation_state != \'draft\' \n
</dtml-if>\n </dtml-if>\n
AND section.uid = stock.section_uid\n AND section.uid = stock.section_uid\n
<dtml-if transaction_section_category>\n <dtml-if transaction_section_category>\n
...@@ -420,7 +419,8 @@ WHERE stock.node_uid = <dtml-var node_uid>\n ...@@ -420,7 +419,8 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
<dtml-if query>\n <dtml-if query>\n
AND category.uid = stock.section_uid\n AND category.uid = stock.section_uid\n
AND <dtml-var query>\n AND <dtml-var query>\n
</dtml-if> </dtml-if>\n
]]></string> </value> ]]></string> </value>
</item> </item>
......
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