details:   https://code.openbravo.com/erp/devel/pi/rev/463468c986a3
changeset: 34824:463468c986a3
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Sep 27 00:00:16 2018 +0530
summary:   Fixes Issue 39305:Performance issue in c_bpartner_trg on environment
with lots of data

** Made use of fin_payment_bpartner_credit index in query
to fetch curreny of the generated credit not yet consumed
in c_bpartner_trg.

diffstat:

 src-db/database/model/triggers/C_BPARTNER_TRG.xml |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 58e108f901e1 -r 463468c986a3 
src-db/database/model/triggers/C_BPARTNER_TRG.xml
--- a/src-db/database/model/triggers/C_BPARTNER_TRG.xml Thu Sep 27 14:26:32 
2018 +0000
+++ b/src-db/database/model/triggers/C_BPARTNER_TRG.xml Thu Sep 27 00:00:16 
2018 +0530
@@ -17,7 +17,7 @@
   * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
   * All Rights Reserved.
   * Contributor(s): Openbravo SLU
-  * Contributions are Copyright (C) 2001-2016 Openbravo, S.L.U.
+  * Contributions are Copyright (C) 2001-2018 Openbravo, S.L.U.
   *
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
@@ -272,7 +272,7 @@
        FROM fin_payment p
        WHERE p.c_bpartner_id = :new.C_BPartner_ID
        AND p.generated_credit <> 0
-       AND p.generated_credit-COALESCE(p.used_credit, 0) <> 0;
+       AND obequals(p.generated_credit, p.used_credit) = 'N';
       
                         IF (v_currency_pl <> COALESCE(v_currency_credit, 
v_currency_pl)) THEN
                           SELECT iso_code


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to