-----------------------------------------------------------------------------
--
--  Logical unit: Project
--  Component:    PROJ
--
--  IFS Developer Studio Template Version 3.0
--
--  Date    Sign    History
--  ------  ------  ---------------------------------------------------------
-----------------------------------------------------------------------------

layer Cust;

-------------------- PUBLIC DECLARATIONS ------------------------------------


-------------------- PRIVATE DECLARATIONS -----------------------------------


-------------------- LU SPECIFIC IMPLEMENTATION METHODS ---------------------


-------------------- LU SPECIFIC PRIVATE METHODS ----------------------------
@Override
@DynamicComponentDependency PROJBF
PROCEDURE Check_Insert___ (
   newrec_ IN OUT NOCOPY project_tab%ROWTYPE,
   indrec_ IN OUT NOCOPY Indicator_Rec,
   attr_   IN OUT NOCOPY VARCHAR2 )
IS
   
BEGIN
   IF Proj_Comp_Bud_Con_API.Get_C_Budg_On_Subcont(newrec_.company) = 'True' THEN
      newrec_.c_budg_on_subcont := Fnd_Boolean_API.DB_TRUE;
   ELSE
      newrec_.c_budg_on_subcont := Fnd_Boolean_API.DB_FALSE;
   END IF;
   
   
   super(newrec_,indrec_,attr_);
   
END Check_Insert___;

-------------------- LU SPECIFIC PROTECTED METHODS --------------------------


-------------------- LU SPECIFIC PUBLIC METHODS -----------------------------


-------------------- LU CUST NEW METHODS -------------------------------------

PROCEDURE C_Control_On_Sub_Contract__ (
   project_id_                IN VARCHAR2,
   control_on_subcontarct_     IN BOOLEAN )
IS
   CURSOR get_obj IS
   SELECT objid,objversion FROM Project
   WHERE project_id = project_id_;
   
   attr_       VARCHAR2(32000);
   info_       VARCHAR2(32000);
   objid_ VARCHAR2(200);
   objversion_ VARCHAR2(200);
   action_     VARCHAR2(10) := 'DO';
BEGIN
   
   Client_SYS.Clear_Attr(attr_);
   
   IF(control_on_subcontarct_) THEN
      Client_SYS.Add_To_Attr('C_BUDG_ON_SUBCONT', 'True', attr_);
      Proj_Budget_Control_Rules_API.C_Update_Project_Rule_List(project_id_);
   ELSE
      Client_SYS.Add_To_Attr('C_BUDG_ON_SUBCONT', 'False', attr_);
   END IF;
   
   OPEN get_obj;
   FETCH get_obj INTO objid_,objversion_;
   CLOSE get_obj;
   
   Project_API.Modify(info_, objid_, objversion_, attr_, action_);
   
   
   
END C_Control_On_Sub_Contract__;