src-db/database/model/functions/GENERATESOFROMPROJECT.xml
changeset 1605 8a0fe0193bef
parent 799 fef2c5e2feb7
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="FUNCTION GENERATESOFROMPROJECT">
     2   <database name="FUNCTION GENERATESOFROMPROJECT">
     3     <function name="GENERATESOFROMPROJECT" type="NULL">
     3     <function name="GENERATESOFROMPROJECT" 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   v_ResultStr VARCHAR2(2000):='';
    23   v_ResultStr VARCHAR2(2000):='';
    24   v_Message VARCHAR2(2000):='';
    24   v_Message VARCHAR2(2000):='';
    25   v_Result NUMBER:=1; -- 0=failure
    25   v_Result NUMBER:=1; -- 0=failure
    26   v_Record_ID NUMBER;
    26   v_Record_ID VARCHAR2(32);
    27   v_AD_User_ID NUMBER;
    27   v_AD_User_ID VARCHAR2(32);
    28   TYPE RECORD IS REF CURSOR;
    28   TYPE RECORD IS REF CURSOR;
    29     Cur_Parameter RECORD;
    29     Cur_Parameter RECORD;
    30     v_C_Order_ID NUMBER;
    30     v_C_Order_ID VARCHAR2(32);
    31     v_C_OrderLine_ID NUMBER;
    31     v_C_OrderLine_ID VARCHAR2(32);
    32     v_C_DOCTYPE_ID NUMBER;
    32     v_C_DOCTYPE_ID VARCHAR2(32);
    33     v_DocumentNo NVARCHAR2(30) ;
    33     v_DocumentNo NVARCHAR2(30) ;
    34   BEGIN
    34   BEGIN
    35     --  Update AD_PInstance
    35     --  Update AD_PInstance
    36     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
    36     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
    37     v_ResultStr:='PInstanceNotFound';
    37     v_ResultStr:='PInstanceNotFound';
    64       v_Size NUMBER;
    64       v_Size NUMBER;
    65       v_UOM NUMBER;
    65       v_UOM NUMBER;
    66       v_PriceStd NUMBER;
    66       v_PriceStd NUMBER;
    67       v_PriceList NUMBER;
    67       v_PriceList NUMBER;
    68       v_PriceLimit NUMBER;
    68       v_PriceLimit NUMBER;
    69       v_C_UOM_ID NUMBER;
    69       v_C_UOM_ID VARCHAR2(32);
    70       v_C_Currency_ID NUMBER;
    70       v_C_Currency_ID VARCHAR2(32);
    71       v_M_PriceList_ID NUMBER;
    71       v_M_PriceList_ID VARCHAR2(32);
    72       v_Billto_ID NUMBER;
    72       v_Billto_ID VARCHAR2(32);
    73       v_InvoiceRule CHAR;
    73       v_InvoiceRule CHAR;
    74       v_M_PriceList_Version_ID NUMBER;
    74       v_M_PriceList_Version_ID VARCHAR2(32);
    75       v_PriceActual NUMBER;
    75       v_PriceActual NUMBER;
    76       v_Discount NUMBER;
    76       v_Discount NUMBER;
    77       v_Tax_ID NUMBER;
    77       v_Tax_ID VARCHAR2(32);
    78 
    78 
    79     TYPE RECORD IS REF CURSOR;
    79     TYPE RECORD IS REF CURSOR;
    80       Cur_SO RECORD;
    80       Cur_SO RECORD;
    81       Cur_SOLINES RECORD;
    81       Cur_SOLINES RECORD;
    82     BEGIN
    82     BEGIN