Commit 3b5f5951 authored by Jérome Perrin's avatar Jérome Perrin

Fix stats on accounting module when filtering by node.

(the functional test failure)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17506 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7d4cb51b
...@@ -513,26 +513,45 @@ WHERE\n ...@@ -513,26 +513,45 @@ WHERE\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if node>\n <dtml-if node>\n
AND category.uid = stock.section_uid\n <dtml-if stat>\n
AND child.uid = stock.uid\n AND stock.uid IN (\n
AND child.parent_uid = catalog.uid\n SELECT child.uid from catalog as child\n
AND (\n WHERE category.uid = stock.section_uid\n
<dtml-in node>\n AND child.parent_uid = catalog.uid\n
<dtml-unless sequence-start>OR</dtml-unless>\n HAVING (SELECT count(stock.uid) from stock, catalog as child\n
stock.node_uid =\n WHERE stock.uid = child.uid \n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n AND child.parent_uid = catalog.uid\n
</dtml-in> )\n AND (\n
</dtml-if>\n <dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless>\n
stock.node_uid =\n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n
</dtml-in> )\n
)\n
)\n
<dtml-else>\n
AND category.uid = stock.section_uid\n
AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n
AND (\n
<dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless>\n
stock.node_uid =\n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n
</dtml-in> )\n
</dtml-if>\n
</dtml-if>\n
\n
<dtml-if stat>\n <dtml-if stat>\n
AND category.uid = stock.section_uid\n AND category.uid = stock.section_uid\n
AND child.uid = stock.uid\n AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n AND child.parent_uid = catalog.uid\n
</dtml-if>\n <dtml-if omit_input> AND stock.total_price < 0\n
<dtml-if omit_input> AND stock.total_price < 0\n AND stock.uid = movement.uid\n
AND stock.uid = movement.uid\n </dtml-if>\n
</dtml-if>\n <dtml-if omit_output> AND stock.total_price > 0\n
<dtml-if omit_output> AND stock.total_price > 0\n AND stock.uid = movement.uid\n
AND stock.uid = movement.uid\n </dtml-if>\n
</dtml-if>\n </dtml-if>\n
<dtml-if expr="selection_name is not None and portal_selections.getSelectionInvertModeFor(selection_name) and len(portal_selections.getSelectionInvertModeUidListFor(selection_name)) > 0">\n <dtml-if expr="selection_name is not None and portal_selections.getSelectionInvertModeFor(selection_name) and len(portal_selections.getSelectionInvertModeUidListFor(selection_name)) > 0">\n
AND ( 0 = 1\n AND ( 0 = 1\n
...@@ -701,26 +720,45 @@ WHERE\n ...@@ -701,26 +720,45 @@ WHERE\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if node>\n <dtml-if node>\n
AND category.uid = stock.section_uid\n <dtml-if stat>\n
AND child.uid = stock.uid\n AND stock.uid IN (\n
AND child.parent_uid = catalog.uid\n SELECT child.uid from catalog as child\n
AND (\n WHERE category.uid = stock.section_uid\n
<dtml-in node>\n AND child.parent_uid = catalog.uid\n
<dtml-unless sequence-start>OR</dtml-unless>\n HAVING (SELECT count(stock.uid) from stock, catalog as child\n
stock.node_uid =\n WHERE stock.uid = child.uid \n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n AND child.parent_uid = catalog.uid\n
</dtml-in> )\n AND (\n
</dtml-if>\n <dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless>\n
stock.node_uid =\n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n
</dtml-in> )\n
)\n
)\n
<dtml-else>\n
AND category.uid = stock.section_uid\n
AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n
AND (\n
<dtml-in node>\n
<dtml-unless sequence-start>OR</dtml-unless>\n
stock.node_uid =\n
<dtml-var "restrictedTraverse(_[\'sequence-item\']).getUid()">\n
</dtml-in> )\n
</dtml-if>\n
</dtml-if>\n
\n
<dtml-if stat>\n <dtml-if stat>\n
AND category.uid = stock.section_uid\n AND category.uid = stock.section_uid\n
AND child.uid = stock.uid\n AND child.uid = stock.uid\n
AND child.parent_uid = catalog.uid\n AND child.parent_uid = catalog.uid\n
</dtml-if>\n <dtml-if omit_input> AND stock.total_price < 0\n
<dtml-if omit_input> AND stock.total_price < 0\n AND stock.uid = movement.uid\n
AND stock.uid = movement.uid\n </dtml-if>\n
</dtml-if>\n <dtml-if omit_output> AND stock.total_price > 0\n
<dtml-if omit_output> AND stock.total_price > 0\n AND stock.uid = movement.uid\n
AND stock.uid = movement.uid\n </dtml-if>\n
</dtml-if>\n </dtml-if>\n
<dtml-if expr="selection_name is not None and portal_selections.getSelectionInvertModeFor(selection_name) and len(portal_selections.getSelectionInvertModeUidListFor(selection_name)) > 0">\n <dtml-if expr="selection_name is not None and portal_selections.getSelectionInvertModeFor(selection_name) and len(portal_selections.getSelectionInvertModeUidListFor(selection_name)) > 0">\n
AND ( 0 = 1\n AND ( 0 = 1\n
......
497 498
\ 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