[Erp5-report] r19799 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 11 16:10:18 CET 2008


Author: yusei
Date: Tue Mar 11 16:10:13 2008
New Revision: 19799

URL: http://svn.erp5.org?rev=19799&view=rev
Log:
Use order by and limit in inner query.

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml?rev=19799&r1=19798&r2=19799&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml Tue Mar 11 16:10:13 2008
@@ -635,16 +635,18 @@
         <dtml-elif count>\n
           SELECT COUNT(DISTINCT uid) AS count FROM (\n
         <dtml-else>\n
-          SELECT catalog.*,\n
+          SELECT main.*,\n
           <dtml-let portal="portal_url.getPortalObject()"\n
                     substring_position="len(\'/\'.join(portal.getPhysicalPath()))+1"\n
                     portal_absolute_url="portal.absolute_url(relative=1)">\n
-          ( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
+          ( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=main.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
           </dtml-let>\n
-          ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
-          ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
-          ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
+          ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=main.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
+          ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = main.uid AND stock.section_uid=main.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
+          ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = main.uid AND stock.section_uid=main.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
           FROM (\n
+           SELECT *\n
+           FROM (\n
         </dtml-if>\n
 \n
 <dtml-comment>\n
@@ -1047,6 +1049,7 @@
           <dtml-else>\n
             <dtml-unless no_limit>LIMIT 1000</dtml-unless>\n
           </dtml-if>\n
+        ) as main\n
         </dtml-if>\n
 \n
 </dtml-if>\n
@@ -1296,16 +1299,18 @@
         <dtml-elif count>\n
           SELECT COUNT(DISTINCT uid) AS count FROM (\n
         <dtml-else>\n
-          SELECT catalog.*,\n
+          SELECT main.*,\n
           <dtml-let portal="portal_url.getPortalObject()"\n
                     substring_position="len(\'/\'.join(portal.getPhysicalPath()))+1"\n
                     portal_absolute_url="portal.absolute_url(relative=1)">\n
-          ( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
+          ( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=main.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
           </dtml-let>\n
-          ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
-          ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
-          ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
+          ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=main.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
+          ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = main.uid AND stock.section_uid=main.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
+          ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = main.uid AND stock.section_uid=main.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
           FROM (\n
+           SELECT *\n
+           FROM (\n
         </dtml-if>\n
 \n
 <dtml-comment>\n
@@ -1708,6 +1713,7 @@
           <dtml-else>\n
             <dtml-unless no_limit>LIMIT 1000</dtml-unless>\n
           </dtml-if>\n
+        ) as main\n
         </dtml-if>\n
 \n
 </dtml-if>\n

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=19799&r1=19798&r2=19799&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Tue Mar 11 16:10:13 2008
@@ -1,1 +1,1 @@
-637
+639




More information about the Erp5-report mailing list