[Erp5-report] r15971 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 31 10:35:45 CEST 2007


Author: vincent
Date: Fri Aug 31 10:35:44 2007
New Revision: 15971

URL: http://svn.erp5.org?rev=15971&view=rev
Log:
Make Resource_zGetInventoryList stock-table-name independant.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml?rev=15971&r1=15970&r2=15971&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml Fri Aug 31 10:35:44 2007
@@ -149,6 +149,17 @@
                                 <key> <string>statistic</string> </key>
                                 <value>
                                   <dictionary/>
+                                </value>
+                            </item>
+                            <item>
+                                <key> <string>stock_table_id</string> </key>
+                                <value>
+                                  <dictionary>
+                                    <item>
+                                        <key> <string>default</string> </key>
+                                        <value> <string>stock</string> </value>
+                                    </item>
+                                  </dictionary>
                                 </value>
                             </item>
                             <item>
@@ -181,6 +192,7 @@
                             <string>precision</string>
                             <string>inventory_list</string>
                             <string>statistic</string>
+                            <string>stock_table_id</string>
                           </list>
                         </value>
                     </item>
@@ -213,7 +225,8 @@
 output_simulation_state:list\r\n
 precision\r\n
 inventory_list\r\n
-statistic</string> </value>
+statistic\r\n
+stock_table_id=stock</string> </value>
         </item>
         <item>
             <key> <string>cache_time_</string> </key>
@@ -255,13 +268,13 @@
 
 SELECT\n
 <dtml-if expr="precision is not None">\n
-  SUM(ROUND(stock.quantity, <dtml-var precision>)) AS inventory,\n
-  SUM(ROUND(stock.quantity, <dtml-var precision>)) AS total_quantity,\n
-  SUM(ROUND(stock.total_price, <dtml-var precision>)) AS total_price\n
+  SUM(ROUND(<dtml-var stock_table_id>.quantity, <dtml-var precision>)) AS inventory,\n
+  SUM(ROUND(<dtml-var stock_table_id>.quantity, <dtml-var precision>)) AS total_quantity,\n
+  SUM(ROUND(<dtml-var stock_table_id>.total_price, <dtml-var precision>)) AS total_price\n
 <dtml-else>\n
-  SUM(stock.quantity) AS inventory,\n
-  SUM(stock.quantity) AS total_quantity,\n
-  SUM(stock.total_price) AS total_price\n
+  SUM(<dtml-var stock_table_id>.quantity) AS inventory,\n
+  SUM(<dtml-var stock_table_id>.quantity) AS total_quantity,\n
+  SUM(<dtml-var stock_table_id>.total_price) AS total_price\n
 </dtml-if>\n
 <dtml-if inventory_list>\n
   ,node.title AS node_title,\n
@@ -270,15 +283,15 @@
   section.relative_url AS section_relative_url,\n
   resource.title AS resource_title,\n
   resource.relative_url AS resource_relative_url,\n
-  stock.variation_text AS variation_text,\n
-  stock.sub_variation_text AS sub_variation_text,\n
-  stock.resource_uid AS resource_uid,\n
-  stock.uid AS stock_uid,\n
-  stock.date as date,\n
-  stock.simulation_state as simulation_state,\n
-  stock.mirror_section_uid as mirror_section_uid,\n
-  stock.payment_uid as payment_uid,\n
-  stock.mirror_node_uid as mirror_node_uid,\n
+  <dtml-var stock_table_id>.variation_text AS variation_text,\n
+  <dtml-var stock_table_id>.sub_variation_text AS sub_variation_text,\n
+  <dtml-var stock_table_id>.resource_uid AS resource_uid,\n
+  <dtml-var stock_table_id>.uid AS stock_uid,\n
+  <dtml-var stock_table_id>.date as date,\n
+  <dtml-var stock_table_id>.simulation_state as simulation_state,\n
+  <dtml-var stock_table_id>.mirror_section_uid as mirror_section_uid,\n
+  <dtml-var stock_table_id>.payment_uid as payment_uid,\n
+  <dtml-var stock_table_id>.mirror_node_uid as mirror_node_uid,\n
   catalog.path as path\n
 </dtml-if>\n
 <dtml-if statistic>\n
@@ -289,19 +302,19 @@
   COUNT(DISTINCT section.relative_url) AS section_relative_url,\n
   COUNT(DISTINCT resource.title) AS resource_title,\n
   COUNT(DISTINCT resource.relative_url) AS resource_relative_url,\n
-  COUNT(DISTINCT stock.variation_text) AS variation_text,\n
-  MAX(stock.resource_uid) AS resource_uid,\n
-  COUNT(DISTINCT stock.uid) AS stock_uid,\n
-  MAX(stock.date) AS date\n
+  COUNT(DISTINCT <dtml-var stock_table_id>.variation_text) AS variation_text,\n
+  MAX(<dtml-var stock_table_id>.resource_uid) AS resource_uid,\n
+  COUNT(DISTINCT <dtml-var stock_table_id>.uid) AS stock_uid,\n
+  MAX(<dtml-var stock_table_id>.date) AS date\n
 </dtml-if>\n
 \n
 \n
 FROM\n
-  stock\n
+  <dtml-var stock_table_id>\n
   <dtml-if section_filtered> INNER <dtml-else> LEFT </dtml-if>  \n
-       JOIN catalog AS section ON (section.uid = stock.section_uid)\n
+       JOIN catalog AS section ON (section.uid = <dtml-var stock_table_id>.section_uid)\n
 <dtml-in prefix="table" expr="from_table_list"> \n
-  <dtml-if expr="table_key != \'stock\'">\n
+  <dtml-if expr="table_key != stock_table_id">\n
   , <dtml-var table_item> AS <dtml-var table_key>\n
   </dtml-if>\n
 </dtml-in>\n
@@ -315,15 +328,15 @@
   AND <dtml-var where_expression>\n
 </dtml-if>\n
 \n
-  AND node.uid = stock.node_uid\n
-  AND resource.uid = stock.resource_uid\n
+  AND node.uid = <dtml-var stock_table_id>.node_uid\n
+  AND resource.uid = <dtml-var stock_table_id>.resource_uid\n
 \n
 <dtml-if omit_simulation>\n
   AND catalog.portal_type != \'Simulation Movement\'\n
 </dtml-if>\n
 \n
 <dtml-if selection_domain>\n
-  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=\'stock\', join_column=\'node_uid\')">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=stock_table_id, join_column=\'node_uid\')">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
   AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
@@ -376,13 +389,13 @@
 
 SELECT\n
 <dtml-if expr="precision is not None">\n
-  SUM(ROUND(stock.quantity, <dtml-var precision>)) AS inventory,\n
-  SUM(ROUND(stock.quantity, <dtml-var precision>)) AS total_quantity,\n
-  SUM(ROUND(stock.total_price, <dtml-var precision>)) AS total_price\n
+  SUM(ROUND(<dtml-var stock_table_id>.quantity, <dtml-var precision>)) AS inventory,\n
+  SUM(ROUND(<dtml-var stock_table_id>.quantity, <dtml-var precision>)) AS total_quantity,\n
+  SUM(ROUND(<dtml-var stock_table_id>.total_price, <dtml-var precision>)) AS total_price\n
 <dtml-else>\n
-  SUM(stock.quantity) AS inventory,\n
-  SUM(stock.quantity) AS total_quantity,\n
-  SUM(stock.total_price) AS total_price\n
+  SUM(<dtml-var stock_table_id>.quantity) AS inventory,\n
+  SUM(<dtml-var stock_table_id>.quantity) AS total_quantity,\n
+  SUM(<dtml-var stock_table_id>.total_price) AS total_price\n
 </dtml-if>\n
 <dtml-if inventory_list>\n
   ,node.title AS node_title,\n
@@ -391,15 +404,15 @@
   section.relative_url AS section_relative_url,\n
   resource.title AS resource_title,\n
   resource.relative_url AS resource_relative_url,\n
-  stock.variation_text AS variation_text,\n
-  stock.sub_variation_text AS sub_variation_text,\n
-  stock.resource_uid AS resource_uid,\n
-  stock.uid AS stock_uid,\n
-  stock.date as date,\n
-  stock.simulation_state as simulation_state,\n
-  stock.mirror_section_uid as mirror_section_uid,\n
-  stock.payment_uid as payment_uid,\n
-  stock.mirror_node_uid as mirror_node_uid,\n
+  <dtml-var stock_table_id>.variation_text AS variation_text,\n
+  <dtml-var stock_table_id>.sub_variation_text AS sub_variation_text,\n
+  <dtml-var stock_table_id>.resource_uid AS resource_uid,\n
+  <dtml-var stock_table_id>.uid AS stock_uid,\n
+  <dtml-var stock_table_id>.date as date,\n
+  <dtml-var stock_table_id>.simulation_state as simulation_state,\n
+  <dtml-var stock_table_id>.mirror_section_uid as mirror_section_uid,\n
+  <dtml-var stock_table_id>.payment_uid as payment_uid,\n
+  <dtml-var stock_table_id>.mirror_node_uid as mirror_node_uid,\n
   catalog.path as path\n
 </dtml-if>\n
 <dtml-if statistic>\n
@@ -410,19 +423,19 @@
   COUNT(DISTINCT section.relative_url) AS section_relative_url,\n
   COUNT(DISTINCT resource.title) AS resource_title,\n
   COUNT(DISTINCT resource.relative_url) AS resource_relative_url,\n
-  COUNT(DISTINCT stock.variation_text) AS variation_text,\n
-  MAX(stock.resource_uid) AS resource_uid,\n
-  COUNT(DISTINCT stock.uid) AS stock_uid,\n
-  MAX(stock.date) AS date\n
+  COUNT(DISTINCT <dtml-var stock_table_id>.variation_text) AS variation_text,\n
+  MAX(<dtml-var stock_table_id>.resource_uid) AS resource_uid,\n
+  COUNT(DISTINCT <dtml-var stock_table_id>.uid) AS stock_uid,\n
+  MAX(<dtml-var stock_table_id>.date) AS date\n
 </dtml-if>\n
 \n
 \n
 FROM\n
-  stock\n
+  <dtml-var stock_table_id>\n
   <dtml-if section_filtered> INNER <dtml-else> LEFT </dtml-if>  \n
-       JOIN catalog AS section ON (section.uid = stock.section_uid)\n
+       JOIN catalog AS section ON (section.uid = <dtml-var stock_table_id>.section_uid)\n
 <dtml-in prefix="table" expr="from_table_list"> \n
-  <dtml-if expr="table_key != \'stock\'">\n
+  <dtml-if expr="table_key != stock_table_id">\n
   , <dtml-var table_item> AS <dtml-var table_key>\n
   </dtml-if>\n
 </dtml-in>\n
@@ -436,15 +449,15 @@
   AND <dtml-var where_expression>\n
 </dtml-if>\n
 \n
-  AND node.uid = stock.node_uid\n
-  AND resource.uid = stock.resource_uid\n
+  AND node.uid = <dtml-var stock_table_id>.node_uid\n
+  AND resource.uid = <dtml-var stock_table_id>.resource_uid\n
 \n
 <dtml-if omit_simulation>\n
   AND catalog.portal_type != \'Simulation Movement\'\n
 </dtml-if>\n
 \n
 <dtml-if selection_domain>\n
-  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=\'stock\', join_column=\'node_uid\')">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=stock_table_id, join_column=\'node_uid\')">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
   AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=15971&r1=15970&r2=15971&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Fri Aug 31 10:35:44 2007
@@ -1,1 +1,1 @@
-422
+423




More information about the Erp5-report mailing list