From 553baea46bfc3f05f73ca11d7bc8713a40d6de24 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 20 Dec 2005 15:18:08 +0000
Subject: [PATCH] added column sub_variation_text

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4801 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../sql/erp5_mysql/z_catalog_stock_list.zsql           | 10 ++++++----
 product/ERP5Catalog/sql/erp5_mysql/z_create_stock.zsql |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

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 4befd8632a..e251e27a73 100755
--- a/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql
+++ b/product/ERP5Catalog/sql/erp5_mysql/z_catalog_stock_list.zsql
@@ -27,7 +27,8 @@ getStartDate
 getStopDate
 isAccountable
 getPortalType
-getVariationText</params>
+getVariationText
+getSubVariationText</params>
 DELETE FROM
   stock
 WHERE
@@ -43,10 +44,10 @@ WHERE
     <dtml-if "isMovement[loop_item]">
       <dtml-if "getResourceUid[loop_item]">
         <dtml-if "getDestinationUid[loop_item]">
-          <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], getSourceUid[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-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], getSourceUid[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],getSubVariationText[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], getDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[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], getDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item], getSubVariationText[loop_item]])">
         </dtml-if>
       </dtml-if>
     </dtml-if>
@@ -73,7 +74,8 @@ VALUES
   <dtml-sqlvar expr="row_item[12]" type="int" optional>,
   <dtml-sqlvar expr="row_item[13]" type="string" optional>,
   <dtml-sqlvar expr="row_item[14]" type="string" optional>,
-  <dtml-sqlvar expr="row_item[15]" type="string" optional>
+  <dtml-sqlvar expr="row_item[15]" type="string" optional>,
+  <dtml-sqlvar expr="row_item[16]" type="string" optional>
 )
 <dtml-if sequence-end><dtml-else>,</dtml-if>
     </dtml-in>
diff --git a/product/ERP5Catalog/sql/erp5_mysql/z_create_stock.zsql b/product/ERP5Catalog/sql/erp5_mysql/z_create_stock.zsql
index 0c7784ef89..aa6a55b151 100755
--- a/product/ERP5Catalog/sql/erp5_mysql/z_create_stock.zsql
+++ b/product/ERP5Catalog/sql/erp5_mysql/z_create_stock.zsql
@@ -29,6 +29,7 @@ CREATE TABLE `stock` (
   `portal_type` VARCHAR(255),
   `simulation_state` varchar(255) default '',
   `variation_text` VARCHAR(255),
+  `sub_variation_text` VARCHAR(255),
   KEY `uid` (`uid`),
   KEY `quantity` (`quantity`),
   KEY `section_uid` (`section_uid`),
-- 
2.30.9