From 2bf932d78260cc17553112d7ca43a1a51f80ef3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 19 Dec 2005 09:44:41 +0000
Subject: [PATCH] change omit_input / omit_output to match
 Resource_zGetInventory behaviour. use date from stock table

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4762 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_core/Resource_zStatInventory.xml     | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zStatInventory.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zStatInventory.xml
index 01fdb90a6c..8d52f3713d 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zStatInventory.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zStatInventory.xml
@@ -297,19 +297,19 @@ WHERE\n
   AND movement.is_accountable = 1\n
   AND node.uid = stock.node_uid\n
   <dtml-if from_date>\n
-    AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n
+    AND stock.date >= <dtml-sqlvar from_date type="datetime">\n
   </dtml-if>\n
   <dtml-if at_date>\n
-    AND movement.stop_date <= <dtml-sqlvar at_date type="datetime">\n
+    AND stock.date <= <dtml-sqlvar at_date type="datetime">\n
   </dtml-if>\n
   <dtml-if to_date>\n
-    AND movement.stop_date < <dtml-sqlvar to_date type="datetime">\n
+    AND stock.date < <dtml-sqlvar to_date type="datetime">\n
   </dtml-if>\n
   <dtml-if omit_simulation>\n
     AND child.portal_type != "Simulation Movement"\n
   </dtml-if>\n
   <dtml-if omit_input>\n
-    AND stock.quantity > 0\n
+    AND stock.quantity < 0\n
     AND (movement.source_uid <> movement.destination_uid \n
      OR  stock.section_uid <> stock.mirror_section_uid\n
      OR  movement.destination_uid IS NULL\n
@@ -317,7 +317,7 @@ WHERE\n
     )\n
   </dtml-if>\n
   <dtml-if omit_output>\n
-    AND stock.quantity < 0\n
+    AND stock.quantity > 0\n
     AND (movement.source_uid <> movement.destination_uid \n
      OR  stock.section_uid <> stock.mirror_section_uid\n
      OR  movement.destination_uid IS NULL\n
@@ -442,19 +442,19 @@ WHERE\n
   AND movement.is_accountable = 1\n
   AND node.uid = stock.node_uid\n
   <dtml-if from_date>\n
-    AND movement.stop_date >= <dtml-sqlvar from_date type="datetime">\n
+    AND stock.date >= <dtml-sqlvar from_date type="datetime">\n
   </dtml-if>\n
   <dtml-if at_date>\n
-    AND movement.stop_date <= <dtml-sqlvar at_date type="datetime">\n
+    AND stock.date <= <dtml-sqlvar at_date type="datetime">\n
   </dtml-if>\n
   <dtml-if to_date>\n
-    AND movement.stop_date < <dtml-sqlvar to_date type="datetime">\n
+    AND stock.date < <dtml-sqlvar to_date type="datetime">\n
   </dtml-if>\n
   <dtml-if omit_simulation>\n
     AND child.portal_type != "Simulation Movement"\n
   </dtml-if>\n
   <dtml-if omit_input>\n
-    AND stock.quantity > 0\n
+    AND stock.quantity < 0\n
     AND (movement.source_uid <> movement.destination_uid \n
      OR  stock.section_uid <> stock.mirror_section_uid\n
      OR  movement.destination_uid IS NULL\n
@@ -462,7 +462,7 @@ WHERE\n
     )\n
   </dtml-if>\n
   <dtml-if omit_output>\n
-    AND stock.quantity < 0\n
+    AND stock.quantity > 0\n
     AND (movement.source_uid <> movement.destination_uid \n
      OR  stock.section_uid <> stock.mirror_section_uid\n
      OR  movement.destination_uid IS NULL\n
-- 
2.30.9