src-db/database/model/triggers/AD_ACCOUNTINGRPT_ELEMENT_TRG.xml
changeset 1605 8a0fe0193bef
parent 756 ae11e4610537
child 1669 a4fcf009a57e
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
    20 * The Initial Developer of the Original Code is Openbravo SL
    20 * The Initial Developer of the Original Code is Openbravo SL
    21 * All portions are Copyright (C) 2001-2006 Openbravo SL
    21 * All portions are Copyright (C) 2001-2006 Openbravo SL
    22 * All Rights Reserved.
    22 * All Rights Reserved.
    23 * Contributor(s):  ______________________________________.
    23 * Contributor(s):  ______________________________________.
    24 ************************************************************************/
    24 ************************************************************************/
    25   v_xTree_ID NUMBER;
    25   v_xTree_ID VARCHAR2(32);
    26   v_xParent_ID NUMBER;
    26   v_xParent_ID VARCHAR2(32);
    27   v_NextNo     NUMBER;
    27   v_NextNo     VARCHAR2(32);
    28 BEGIN
    28 BEGIN
    29   -- Insert AD_Menu Trigger
    29   -- Insert AD_Menu Trigger
    30   --  for Translation
    30   --  for Translation
    31   --  and TreeNode
    31   --  and TreeNode
    32   IF INSERTING THEN
    32   IF INSERTING THEN
    37     -- FROM    AD_CLIENTINFO c, AD_TREENODE n -- AD_TreeNodeMM n
    37     -- FROM    AD_CLIENTINFO c, AD_TREENODE n -- AD_TreeNodeMM n
    38     --  WHERE   c.AD_Tree_Menu_ID=n.AD_Tree_ID
    38     --  WHERE   c.AD_Tree_Menu_ID=n.AD_Tree_ID
    39     --    AND n.Parent_ID IS NULL
    39     --    AND n.Parent_ID IS NULL
    40     --AND c.AD_Client_ID=:NEW.AD_Client_ID;
    40     --AND c.AD_Client_ID=:NEW.AD_Client_ID;
    41     SELECT AD_TREE_ID,
    41     SELECT AD_TREE_ID,
    42       0
    42       '0'
    43     INTO v_xTree_ID,
    43     INTO v_xTree_ID,
    44       v_xParent_ID
    44       v_xParent_ID
    45     FROM AD_TREE
    45     FROM AD_TREE
    46     WHERE treetype='AR'
    46     WHERE treetype='AR'
    47       AND AD_Client_ID=:NEW.AD_Client_ID;
    47       AND AD_Client_ID=:NEW.AD_Client_ID;
    62         :NEW.Created, :NEW.CreatedBy, :NEW.Updated,
    62         :NEW.Created, :NEW.CreatedBy, :NEW.Updated,
    63         :NEW.UpdatedBy, v_xTree_ID, :NEW.AD_Accountingrpt_Element_ID,
    63         :NEW.UpdatedBy, v_xTree_ID, :NEW.AD_Accountingrpt_Element_ID,
    64         v_xParent_ID,(
    64         v_xParent_ID,(
    65         CASE :NEW.IsSummary
    65         CASE :NEW.IsSummary
    66           WHEN 'Y'
    66           WHEN 'Y'
    67           THEN 100
    67           THEN '100'
    68           ELSE 999
    68           ELSE '999'
    69         END
    69         END
    70         )
    70         )
    71       )
    71       )
    72       ;
    72       ;
    73     -- Summary Nodes first
    73     -- Summary Nodes first