Commit 305ff3e9 authored by Jérome Perrin's avatar Jérome Perrin

use total_price instead of quantity


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5605 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00df1a1e
...@@ -264,28 +264,28 @@ ...@@ -264,28 +264,28 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>selection</string> <string>selection</string>
<string>selection_domain</string> <string>selection_domain</string>
<string>selection_report</string> <string>selection_report</string>
<string>selection_params</string> <string>selection_params</string>
<string>selection_sort_on</string> <string>selection_sort_on</string>
<string>select_expression</string> <string>select_expression</string>
<string>from_date</string> <string>from_date</string>
<string>at_date</string> <string>at_date</string>
<string>to_date</string> <string>to_date</string>
<string>node</string> <string>node</string>
<string>resource</string> <string>resource</string>
<string>entity</string> <string>entity</string>
<string>stat</string> <string>stat</string>
<string>omit_input</string> <string>omit_input</string>
<string>omit_output</string> <string>omit_output</string>
<string>amount</string> <string>amount</string>
<string>amount_range_min</string> <string>amount_range_min</string>
<string>amount_range_max</string> <string>amount_range_max</string>
<string>creation_date_range_min</string> <string>creation_date_range_min</string>
<string>creation_date_range_max</string> <string>creation_date_range_max</string>
<string>section_category</string> <string>section_category</string>
<string>count</string> <string>count</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -308,27 +308,27 @@ ...@@ -308,27 +308,27 @@
</item> </item>
<item> <item>
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>selection\n <value> <string>selection\r\n
selection_domain\n selection_domain\r\n
selection_report\n selection_report\r\n
selection_params=""\n selection_params=""\r\n
selection_sort_on\n selection_sort_on\r\n
select_expression\n select_expression\r\n
from_date=""\n from_date=""\r\n
at_date=""\n at_date=""\r\n
to_date=""\n to_date=""\r\n
node=""\n node=""\r\n
resource=""\n resource=""\r\n
entity=""\n entity=""\r\n
stat=""\n stat=""\r\n
omit_input=""\n omit_input=""\r\n
omit_output=""\n omit_output=""\r\n
amount=""\n amount=""\r\n
amount_range_min=""\n amount_range_min=""\r\n
amount_range_max=""\n amount_range_max=""\r\n
creation_date_range_min=""\n creation_date_range_min=""\r\n
creation_date_range_max=""\n creation_date_range_max=""\r\n
section_category=""\n section_category=""\r\n
count=""</string> </value> count=""</string> </value>
</item> </item>
<item> <item>
...@@ -382,7 +382,7 @@ count=""</string> </value> ...@@ -382,7 +382,7 @@ count=""</string> </value>
\n \n
SELECT\n SELECT\n
<dtml-if stat>\n <dtml-if stat>\n
SUM(stock.quantity) AS quantity\n SUM(stock.total_price) AS total_price\n
<dtml-elif count>\n <dtml-elif count>\n
COUNT(DISTINCT catalog.id) AS count\n COUNT(DISTINCT catalog.id) AS count\n
<dtml-else>\n <dtml-else>\n
...@@ -420,20 +420,21 @@ WHERE\n ...@@ -420,20 +420,21 @@ WHERE\n
<dtml-if amount_range_max> AND ABS(movement.quantity) < <dtml-sqlvar amount_range_max type="float"> </dtml-if>\n <dtml-if amount_range_max> AND ABS(movement.quantity) < <dtml-sqlvar amount_range_max type="float"> </dtml-if>\n
<dtml-if creation_date_range_min> AND catalog.creation_date >= <dtml-sqlvar creation_date_range_min type="datetime"> </dtml-if>\n <dtml-if creation_date_range_min> AND catalog.creation_date >= <dtml-sqlvar creation_date_range_min type="datetime"> </dtml-if>\n
<dtml-if creation_date_range_max> AND catalog.creation_date <= <dtml-sqlvar creation_date_range_max type="datetime"> </dtml-if>\n <dtml-if creation_date_range_max> AND catalog.creation_date <= <dtml-sqlvar creation_date_range_max type="datetime"> </dtml-if>\n
<dtml-if use_movement_table> AND child.parent_uid = catalog.uid \n <dtml-if use_movement_table> AND child.parent_uid = catalog.uid\n
AND movement.uid = child.uid </dtml-if>\n AND movement.uid = child.uid </dtml-if>\n
<dtml-if resource> AND currency.uid = movement.resource_uid \n <dtml-if resource> AND currency.uid = movement.resource_uid\n
AND currency.relative_url = \'<dtml-var resource>\' </dtml-if>\n AND currency.relative_url = \'<dtml-var resource>\' </dtml-if>\n
<dtml-if entity> AND ( related_entity.uid = delivery.destination_section_uid \n <dtml-if entity> AND ( related_entity.uid = delivery.destination_section_uid\n
OR related_entity.uid = delivery.source_section_uid )\n OR related_entity.uid = delivery.source_section_uid )\n
AND related_entity.relative_url = \'<dtml-var entity>\' </dtml-if>\n AND related_entity.relative_url = \'<dtml-var entity>\' </dtml-if>\n
<dtml-if section_category> AND ( category.uid = delivery.destination_section_uid \n <dtml-if section_category> AND ( category.uid = delivery.destination_section_uid\n
OR category.uid = delivery.source_section_uid )\n OR category.uid = delivery.source_section_uid)\n
AND section_c.uid = category.category_uid\n AND section_c.uid = category.category_uid\n
AND section_c.relative_url = <dtml-sqlvar section_category type="string">\n AND section_c.relative_url =\n
<dtml-sqlvar section_category type="string">\n
</dtml-if>\n </dtml-if>\n
\n \n
-- FIXME: we want stop date when we are destination_section and start_date when \n -- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n -- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n -- to avoid the use of stock table here)\n
<dtml-if from_date> AND movement.stop_date >= <dtml-sqlvar from_date type="datetime"> </dtml-if>\n <dtml-if from_date> AND movement.stop_date >= <dtml-sqlvar from_date type="datetime"> </dtml-if>\n
...@@ -442,20 +443,23 @@ WHERE\n ...@@ -442,20 +443,23 @@ WHERE\n
\n \n
<dtml-if node>\n <dtml-if node>\n
AND source_account.uid = movement.source_uid\n AND source_account.uid = movement.source_uid\n
AND ( \n AND (\n
<dtml-in node> \n <dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless> source_account.relative_url = \'<dtml-var sequence-item>\'\n <dtml-unless sequence-start>OR</dtml-unless>\n
source_account.relative_url = \'<dtml-var sequence-item>\'\n
</dtml-in> )\n </dtml-in> )\n
</dtml-if>\n </dtml-if>\n
<dtml-if stat> AND movement.is_accountable = 1 </dtml-if>\n <dtml-if stat> AND movement.is_accountable = 1\n
<dtml-if omit_input> AND stock.quantity < 0\n AND category.uid = stock.section_uid\n
</dtml-if>\n
<dtml-if omit_input> AND stock.total_price < 0\n
AND stock.uid = child.uid </dtml-if>\n AND stock.uid = child.uid </dtml-if>\n
<dtml-if omit_output> AND stock.quantity > 0\n <dtml-if omit_output> AND stock.total_price > 0\n
AND stock.uid = child.uid </dtml-if>\n AND stock.uid = child.uid </dtml-if>\n
<dtml-if expr="selection is not None and selection.isInvertMode() and len(selection.getInvertModeUidList()) > 0">\n <dtml-if expr="selection is not None and selection.isInvertMode() and len(selection.getInvertModeUidList()) > 0">\n
AND ( 0 = 1\n AND ( 0 = 1\n
<dtml-in expr="selection.getInvertModeUidList()">\n <dtml-in expr="selection.getInvertModeUidList()">\n
OR catalog.uid = <dtml-var sequence-item> \n OR catalog.uid = <dtml-var sequence-item>\n
</dtml-in>\n </dtml-in>\n
)\n )\n
</dtml-if>\n </dtml-if>\n
...@@ -526,7 +530,7 @@ WHERE\n ...@@ -526,7 +530,7 @@ WHERE\n
\n \n
SELECT\n SELECT\n
<dtml-if stat>\n <dtml-if stat>\n
SUM(stock.quantity) AS quantity\n SUM(stock.total_price) AS total_price\n
<dtml-elif count>\n <dtml-elif count>\n
COUNT(DISTINCT catalog.id) AS count\n COUNT(DISTINCT catalog.id) AS count\n
<dtml-else>\n <dtml-else>\n
...@@ -564,20 +568,21 @@ WHERE\n ...@@ -564,20 +568,21 @@ WHERE\n
<dtml-if amount_range_max> AND ABS(movement.quantity) < <dtml-sqlvar amount_range_max type="float"> </dtml-if>\n <dtml-if amount_range_max> AND ABS(movement.quantity) < <dtml-sqlvar amount_range_max type="float"> </dtml-if>\n
<dtml-if creation_date_range_min> AND catalog.creation_date >= <dtml-sqlvar creation_date_range_min type="datetime"> </dtml-if>\n <dtml-if creation_date_range_min> AND catalog.creation_date >= <dtml-sqlvar creation_date_range_min type="datetime"> </dtml-if>\n
<dtml-if creation_date_range_max> AND catalog.creation_date <= <dtml-sqlvar creation_date_range_max type="datetime"> </dtml-if>\n <dtml-if creation_date_range_max> AND catalog.creation_date <= <dtml-sqlvar creation_date_range_max type="datetime"> </dtml-if>\n
<dtml-if use_movement_table> AND child.parent_uid = catalog.uid \n <dtml-if use_movement_table> AND child.parent_uid = catalog.uid\n
AND movement.uid = child.uid </dtml-if>\n AND movement.uid = child.uid </dtml-if>\n
<dtml-if resource> AND currency.uid = movement.resource_uid \n <dtml-if resource> AND currency.uid = movement.resource_uid\n
AND currency.relative_url = \'<dtml-var resource>\' </dtml-if>\n AND currency.relative_url = \'<dtml-var resource>\' </dtml-if>\n
<dtml-if entity> AND ( related_entity.uid = delivery.destination_section_uid \n <dtml-if entity> AND ( related_entity.uid = delivery.destination_section_uid\n
OR related_entity.uid = delivery.source_section_uid )\n OR related_entity.uid = delivery.source_section_uid )\n
AND related_entity.relative_url = \'<dtml-var entity>\' </dtml-if>\n AND related_entity.relative_url = \'<dtml-var entity>\' </dtml-if>\n
<dtml-if section_category> AND ( category.uid = delivery.destination_section_uid \n <dtml-if section_category> AND ( category.uid = delivery.destination_section_uid\n
OR category.uid = delivery.source_section_uid )\n OR category.uid = delivery.source_section_uid)\n
AND section_c.uid = category.category_uid\n AND section_c.uid = category.category_uid\n
AND section_c.relative_url = <dtml-sqlvar section_category type="string">\n AND section_c.relative_url =\n
<dtml-sqlvar section_category type="string">\n
</dtml-if>\n </dtml-if>\n
\n \n
-- FIXME: we want stop date when we are destination_section and start_date when \n -- FIXME: we want stop date when we are destination_section and start_date when\n
-- we are source_section (one solution is to read in stock.date, but we try\n -- we are source_section (one solution is to read in stock.date, but we try\n
-- to avoid the use of stock table here)\n -- to avoid the use of stock table here)\n
<dtml-if from_date> AND movement.stop_date >= <dtml-sqlvar from_date type="datetime"> </dtml-if>\n <dtml-if from_date> AND movement.stop_date >= <dtml-sqlvar from_date type="datetime"> </dtml-if>\n
...@@ -586,20 +591,23 @@ WHERE\n ...@@ -586,20 +591,23 @@ WHERE\n
\n \n
<dtml-if node>\n <dtml-if node>\n
AND source_account.uid = movement.source_uid\n AND source_account.uid = movement.source_uid\n
AND ( \n AND (\n
<dtml-in node> \n <dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless> source_account.relative_url = \'<dtml-var sequence-item>\'\n <dtml-unless sequence-start>OR</dtml-unless>\n
source_account.relative_url = \'<dtml-var sequence-item>\'\n
</dtml-in> )\n </dtml-in> )\n
</dtml-if>\n </dtml-if>\n
<dtml-if stat> AND movement.is_accountable = 1 </dtml-if>\n <dtml-if stat> AND movement.is_accountable = 1\n
<dtml-if omit_input> AND stock.quantity < 0\n AND category.uid = stock.section_uid\n
</dtml-if>\n
<dtml-if omit_input> AND stock.total_price < 0\n
AND stock.uid = child.uid </dtml-if>\n AND stock.uid = child.uid </dtml-if>\n
<dtml-if omit_output> AND stock.quantity > 0\n <dtml-if omit_output> AND stock.total_price > 0\n
AND stock.uid = child.uid </dtml-if>\n AND stock.uid = child.uid </dtml-if>\n
<dtml-if expr="selection is not None and selection.isInvertMode() and len(selection.getInvertModeUidList()) > 0">\n <dtml-if expr="selection is not None and selection.isInvertMode() and len(selection.getInvertModeUidList()) > 0">\n
AND ( 0 = 1\n AND ( 0 = 1\n
<dtml-in expr="selection.getInvertModeUidList()">\n <dtml-in expr="selection.getInvertModeUidList()">\n
OR catalog.uid = <dtml-var sequence-item> \n OR catalog.uid = <dtml-var sequence-item>\n
</dtml-in>\n </dtml-in>\n
)\n )\n
</dtml-if>\n </dtml-if>\n
......
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