details: https://code.openbravo.com/erp/devel/pi/rev/e783a7aa28d4
changeset: 21432:e783a7aa28d4
user: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at>
openbravo.com>
date: Mon Nov 11 15:01:36 2013 +0530
summary: Fixes Issue 24519: When deactivating an account, all account
combinations are set as ACTIVE
diffstat:
src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml | 38 ++++++++++++++----
1 files changed, 29 insertions(+), 9 deletions(-)
diffs (55 lines):
diff -r 7ea2815bb68a -r e783a7aa28d4
src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml
--- a/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml Mon Nov 11
12:43:33 2013 +0530
+++ b/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml Mon Nov 11
15:01:36 2013 +0530
@@ -14,7 +14,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2012 Openbravo SLU
+* All portions are Copyright (C) 2001-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************/
@@ -156,14 +156,34 @@
INTO v_Count
FROM C_VALIDCOMBINATION
WHERE Account_ID=:new.C_ElementValue_ID;
- if(v_Count>0) THEN
- UPDATE C_ValidCombination
- SET Updated=now(), isactive = 'Y'
- WHERE Account_ID=:new.C_ElementValue_ID
- AND C_AcctSchema_ID in (SELECT C_AcctSchema_ID
- FROM C_AcctSchema
- WHERE isactive = 'Y');
- ELSE
+ if(v_Count>0) THEN
+ IF :NEW.IsActive = 'Y' AND :OLD.IsActive = 'N' THEN
+ UPDATE C_ValidCombination
+ SET Updated=now(), isactive = 'Y'
+ WHERE Account_ID=:new.C_ElementValue_ID
+ AND C_AcctSchema_ID in (SELECT C_AcctSchema_ID
+ FROM C_AcctSchema
+ WHERE isactive = 'Y')
+ AND m_product_id IS NULL
+ AND c_bpartner_id IS NULL
+ AND ad_orgtrx_id IS NULL
+ AND c_salesregion_id IS NULL
+ AND c_project_id IS NULL
+ AND c_campaign_id IS NULL
+ AND c_activity_id IS NULL
+ AND user1_id IS NULL
+ AND user2_id IS NULL;
+ ELSE
+ IF :NEW.IsActive = 'N' AND :OLD.IsActive = 'Y' THEN
+ UPDATE C_ValidCombination
+ SET Updated=now(), isactive = 'N'
+ WHERE Account_ID=:new.C_ElementValue_ID
+ AND C_AcctSchema_ID in (SELECT C_AcctSchema_ID
+ FROM C_AcctSchema
+ WHERE isactive = 'Y');
+ END IF;
+ END IF;
+ ELSE
FOR cur_AcctSchema IN
(SELECT C_AcctSchema_ID
FROM C_AcctSchema_Element
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits