src-db/database/model/functions/C_BUDGET_COPY.xml
changeset 1605 8a0fe0193bef
parent 758 f3845be31c95
child 6493 caf8b663e118
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="FUNCTION C_BUDGET_COPY">
     2   <database name="FUNCTION C_BUDGET_COPY">
     3     <function name="C_BUDGET_COPY" type="NULL">
     3     <function name="C_BUDGET_COPY" type="NULL">
     4       <parameter name="p_pinstance_id" type="NUMERIC" mode="in">
     4       <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
     5         <default/>
     5         <default/>
     6       </parameter>
     6       </parameter>
     7       <body><![CDATA[/*************************************************************************
     7       <body><![CDATA[/*************************************************************************
     8 * The contents of this file are subject to the Openbravo  Public  License
     8 * The contents of this file are subject to the Openbravo  Public  License
     9 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
     9 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
    21 * Contributor(s):  ______________________________________.
    21 * Contributor(s):  ______________________________________.
    22 ************************************************************************/
    22 ************************************************************************/
    23   --  Logistice
    23   --  Logistice
    24   v_ResultStr VARCHAR2(2000):='';
    24   v_ResultStr VARCHAR2(2000):='';
    25   v_Message VARCHAR2(2000):='';
    25   v_Message VARCHAR2(2000):='';
    26   v_Record_ID NUMBER;
    26   v_Record_ID VARCHAR2(32);
    27   v_Result NUMBER:=1; --  Success
    27   v_Result NUMBER:=1; --  Success
    28   v_BudgetFrom_ID NUMBER;
    28   v_BudgetFrom_ID VARCHAR2(32);
    29   --  Parameter
    29   --  Parameter
    30   TYPE RECORD IS REF CURSOR;
    30   TYPE RECORD IS REF CURSOR;
    31     Cur_Parameter RECORD;
    31     Cur_Parameter RECORD;
    32     --  Record Info
    32     --  Record Info
    33     v_Client_ID NUMBER;
    33     v_Client_ID VARCHAR2(32);
    34     v_Org_ID NUMBER;
    34     v_Org_ID VARCHAR2(32);
    35     v_User_ID NUMBER;
    35     v_User_ID VARCHAR2(32);
    36     v_BudgetLine_ID NUMBER;
    36     v_BudgetLine_ID VARCHAR2(32);
    37     v_Period_ID NUMBER;
    37     v_Period_ID VARCHAR2(32);
    38     Cur_BudgetLine RECORD;
    38     Cur_BudgetLine RECORD;
    39   BEGIN
    39   BEGIN
    40     v_Result:=1;
    40     v_Result:=1;
    41     --  Get Parameters
    41     --  Get Parameters
    42     v_ResultStr:='ReadingParameters';
    42     v_ResultStr:='ReadingParameters';
    53       v_Record_ID:=Cur_Parameter.Record_ID;
    53       v_Record_ID:=Cur_Parameter.Record_ID;
    54       v_User_ID:=Cur_Parameter.AD_User_ID;
    54       v_User_ID:=Cur_Parameter.AD_User_ID;
    55       v_Org_ID:=Cur_Parameter.AD_Org_ID;
    55       v_Org_ID:=Cur_Parameter.AD_Org_ID;
    56       v_Client_ID:=Cur_Parameter.AD_Client_ID;
    56       v_Client_ID:=Cur_Parameter.AD_Client_ID;
    57       IF(Cur_Parameter.ParameterName='C_Budget_ID') THEN
    57       IF(Cur_Parameter.ParameterName='C_Budget_ID') THEN
    58         v_BudgetFrom_ID:=Cur_Parameter.P_Number;
    58         v_BudgetFrom_ID:=Cur_Parameter.P_String;
    59         DBMS_OUTPUT.PUT_LINE('  BudgetFrom_ID=' || v_BudgetFrom_ID) ;
    59         DBMS_OUTPUT.PUT_LINE('  BudgetFrom_ID=' || v_BudgetFrom_ID) ;
    60       END IF;
    60       END IF;
    61     END LOOP; --  Get Parameter
    61     END LOOP; --  Get Parameter
    62     DBMS_OUTPUT.PUT_LINE('  v_Record_ID=' || v_Record_ID) ;
    62     DBMS_OUTPUT.PUT_LINE('  v_Record_ID=' || v_Record_ID) ;
    63     FOR Cur_BudgetLine IN
    63     FOR Cur_BudgetLine IN