details:   https://code.openbravo.com/erp/devel/pi/rev/1da36fb5ddbe
changeset: 21253:1da36fb5ddbe
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Wed Oct 09 19:43:59 2013 +0200
summary:   Fixed 24919: Speedup AcctServer.checkDocuments
Avoid checking same docbasetype several times by only doing
check for distinct docbasetype values thus skipping duplicates
which happen as docbasetypes are defined per organization.

details:   https://code.openbravo.com/erp/devel/pi/rev/e721f9bcbfc1
changeset: 21254:e721f9bcbfc1
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Wed Oct 09 19:45:30 2013 +0200
summary:   Issue 24919: Small code-cleanup
Delete unused (non-public) selectDocuments methods in xsql file to make
it obvious that the method is not used.

diffstat:

 src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql |  35 +--------------
 1 files changed, 1 insertions(+), 34 deletions(-)

diffs (52 lines):

diff -r 81de998abbec -r e721f9bcbfc1 
src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql Wed Oct 09 
17:39:29 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql Wed Oct 09 
19:45:30 2013 +0200
@@ -523,39 +523,6 @@
       </Sql>
       <Parameter name="adUserClient" type="replace" optional="true" 
after="AD_Org.AD_Client_ID IN (" text="'1'"/>
    </SqlMethod>
-    <SqlMethod name="selectDocuments" type="preparedStatement" return="single">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql>
-      <![CDATA[
-        select 1 as id from dual where exists (
-        select  C_INVOICE_ID as id
-        from  c_invoice a, ad_org
-        where posted = 'N'
-        and processed = 'Y'
-        and (processing = 'N' or processing is null)
-        AND ad_org.ad_org_id=a.ad_org_id
-        AND a.ad_client_id = ?
-        AND AD_ISORGINCLUDED(ad_org.ad_org_id, ?, ad_org.ad_client_id)<>-1
-        AND EXISTS (select 1
-               from c_year, c_period, c_periodcontrol, ad_org
-               where c_year.c_year_id = c_period.c_year_id
-              and c_period.c_period_id = c_periodcontrol.c_period_id
-              and c_year.c_calendar_id = ad_org.c_calendar_id
-              and ad_org.ad_client_id = a.ad_client_id
-              and c_periodcontrol.docbasetype = ?
-              and c_periodcontrol.periodstatus = 'O'
-              and    a.dateacct >= c_period.StartDate
-              and     a.dateacct < c_period.EndDate + 1))
-      ]]>
-      </Sql>
-      <Parameter name="tableName" type="replace" optional="true" after="select 
 " text="C_INVOICE"/>
-      <Parameter name="tableName" type="replace" optional="true" after="from  
" text="c_invoice"/>
-      <Parameter name="adClientId" />
-      <Parameter name="adOrgId"/>
-      <Parameter name="docbasetype"/>
-      <Parameter name="dateColumn" type="replace" optional="true" after="and   
 a." text="dateacct"/>
-      <Parameter name="dateColumn" type="replace" optional="true" after="and   
  a." text="dateacct"/>
-   </SqlMethod>
    <SqlMethod name="selectDocumentsDates" type="preparedStatement" 
return="single">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
@@ -639,7 +606,7 @@
    <SqlMethod name="selectDocTypes" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-      select docbasetype as name from c_doctype
+      select distinct docbasetype as name from c_doctype
       where ad_table_id = ?
       and ad_client_id = ?
       </Sql>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to