src-db/database/model/functions/COPY_PRODUCT_TEMPLATE.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 COPY_PRODUCT_TEMPLATE">
     2   <database name="FUNCTION COPY_PRODUCT_TEMPLATE">
     3     <function name="COPY_PRODUCT_TEMPLATE" type="NULL">
     3     <function name="COPY_PRODUCT_TEMPLATE" type="NULL">
     4       <parameter name="pinstance_id" type="NUMERIC" mode="in">
     4       <parameter name="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   -- Parameter
    27   -- Parameter
    28   TYPE RECORD IS REF CURSOR;
    28   TYPE RECORD IS REF CURSOR;
    29     Cur_Parameter RECORD;
    29     Cur_Parameter RECORD;
    30     -- Record Info
    30     -- Record Info
    31     v_Bpartner NUMBER;
    31     v_Bpartner VARCHAR2(32);
    32     v_Mpricelist NUMBER;
    32     v_Mpricelist VARCHAR2(32);
    33     v_Currency NUMBER;
    33     v_Currency VARCHAR2(32);
    34     v_Warehouse NUMBER;
    34     v_Warehouse VARCHAR2(32);
    35     v_SeqNo NUMBER;
    35     v_SeqNo NUMBER;
    36     v_CorderId NUMBER;
    36     v_CorderId varchar2(32);
    37     v_Client NUMBER;
    37     v_Client VARCHAR2(32);
    38     v_Org NUMBER;
    38     v_Org VARCHAR2(32);
    39     v_Createdby NUMBER;
    39     v_Createdby VARCHAR2(32);
    40     v_Dateordered DATE;
    40     v_Dateordered DATE;
    41     v_BillTo NUMBER;
    41     v_BillTo NUMBER;
    42     v_BpartnerLocation NUMBER;
    42     v_BpartnerLocation VARCHAR2(32);
    43     v_Pricelist NUMBER;
    43     v_Pricelist VARCHAR2(32);
    44     v_Pricelimit NUMBER;
    44     v_Pricelimit NUMBER;
    45     v_Pricestd NUMBER;
    45     v_Pricestd NUMBER;
    46     v_Linenetamount NUMBER;
    46     v_Linenetamount NUMBER;
    47     v_Discount NUMBER;
    47     v_Discount VARCHAR2(32);
    48     v_Tax NUMBER;
    48     v_Tax VARCHAR2(32);
    49     v_Issotrx CHAR;
    49     v_Issotrx CHAR;
    50     v_NoOfLines NUMBER:=0;
    50     v_NoOfLines NUMBER:=0;
    51     v_projectID NUMBER;
    51     v_projectID varchar2(32);
    52     -- Copy
    52     -- Copy
    53     Cur_ProductTemplate RECORD;
    53     Cur_ProductTemplate RECORD;
    54   BEGIN
    54   BEGIN
    55     --  Update AD_PInstance
    55     --  Update AD_PInstance
    56     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || PInstance_ID) ;
    56     DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || PInstance_ID) ;