From da7e8bade8701d0205bcfe70a927f3f21395f714 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 12 Oct 2005 07:30:49 +0000
Subject: [PATCH] fixed bug when the quantity was none on a line, the error
 was: TypeError: bad operand type for unary -

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3999 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql b/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql
index 8b3ad4323b..136d6b3f7f 100755
--- a/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql
+++ b/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql
@@ -46,7 +46,9 @@ WHERE
           <dtml-call expr="row_list.append([uid[loop_item], getDestinationUid[loop_item], getDestinationSectionUid[loop_item], getDestinationPaymentUid[loop_item], getDestinationFunctionUid[loop_item], getDestinationProjectUid[loop_item], getSourceSectionUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item]])">
         </dtml-if>
         <dtml-if "getSourceUid[loop_item]">
-          <dtml-call expr="row_list.append([uid[loop_item], getSourceUid[loop_item], getSourceSectionUid[loop_item], getSourcePaymentUid[loop_item], getSourceFunctionUid[loop_item], getSourceProjectUid[loop_item], getDestinationSectionUid[loop_item], getResourceUid[loop_item], -getInventoriatedQuantity[loop_item], getStartDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item]])">
+          <dtml-if "getInventoriatedQuantity[loop_item]">
+            <dtml-call expr="row_list.append([uid[loop_item], getSourceUid[loop_item], getSourceSectionUid[loop_item], getSourcePaymentUid[loop_item], getSourceFunctionUid[loop_item], getSourceProjectUid[loop_item], getDestinationSectionUid[loop_item], getResourceUid[loop_item], -getInventoriatedQuantity[loop_item], getStartDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item]])">
+          </dtml-if>
         </dtml-if>
       </dtml-if>
     </dtml-if>
-- 
2.30.9