src-db/database/model/functions/MA_MAINTENANCE_SCHEDULE.xml
changeset 1605 8a0fe0193bef
parent 1528 bb5e4393b32c
child 6701 690d2af86089
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="FUNCTION MA_MAINTENANCE_SCHEDULE">
     2   <database name="FUNCTION MA_MAINTENANCE_SCHEDULE">
     3     <function name="MA_MAINTENANCE_SCHEDULE" type="NULL">
     3     <function name="MA_MAINTENANCE_SCHEDULE" 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       <parameter name="p_ma_maintenance_id" type="NUMERIC" mode="in">
     7       <parameter name="p_ma_maintenance_id" type="VARCHAR" mode="in">
     8         <default/>
     8         <default/>
     9       </parameter>
     9       </parameter>
    10       <parameter name="p_initdate" type="TIMESTAMP" mode="in">
    10       <parameter name="p_initdate" type="TIMESTAMP" mode="in">
    11         <default/>
    11         <default/>
    12       </parameter>
    12       </parameter>
    13       <parameter name="p_enddate" type="TIMESTAMP" mode="in">
    13       <parameter name="p_enddate" type="TIMESTAMP" mode="in">
    14         <default/>
    14         <default/>
    15       </parameter>
    15       </parameter>
    16       <parameter name="p_client_id" type="NUMERIC" mode="in">
    16       <parameter name="p_client_id" type="VARCHAR" mode="in">
    17         <default/>
    17         <default/>
    18       </parameter>
    18       </parameter>
    19       <parameter name="p_org_id" type="NUMERIC" mode="in">
    19       <parameter name="p_org_id" type="VARCHAR" mode="in">
    20         <default/>
    20         <default/>
    21       </parameter>
    21       </parameter>
    22       <parameter name="p_user_id" type="NUMERIC" mode="in">
    22       <parameter name="p_user_id" type="VARCHAR" mode="in">
    23         <default/>
    23         <default/>
    24       </parameter>
    24       </parameter>
    25       <body><![CDATA[/*************************************************************************
    25       <body><![CDATA[/*************************************************************************
    26 * The contents of this file are subject to the Openbravo  Public  License
    26 * The contents of this file are subject to the Openbravo  Public  License
    27 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
    27 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
    39 * Contributor(s):  ______________________________________.
    39 * Contributor(s):  ______________________________________.
    40 ************************************************************************/
    40 ************************************************************************/
    41   --  Logistice
    41   --  Logistice
    42   v_ResultStr VARCHAR2(2000):='';
    42   v_ResultStr VARCHAR2(2000):='';
    43   v_Message VARCHAR2(2000):='';
    43   v_Message VARCHAR2(2000):='';
    44   v_Client_ID NUMBER;
    44   v_Client_ID VARCHAR2(32);
    45   v_Org_ID NUMBER;
    45   v_Org_ID VARCHAR2(32);
    46   v_Record_ID NUMBER;
    46   v_Record_ID VARCHAR2(32);
    47   v_Result NUMBER:=1; --  Success
    47   v_Result NUMBER:=1; --  Success
    48   v_AD_User_ID NUMBER;
    48   v_AD_User_ID VARCHAR2(32);
    49   v_InitDate DATE;
    49   v_InitDate DATE;
    50   v_EndDate DATE;
    50   v_EndDate DATE;
    51   v_Date DATE;
    51   v_Date DATE;
    52   v_DateInt DATE;
    52   v_DateInt DATE;
    53   v_Int NUMBER;
    53   v_Int NUMBER;
    57     --  Record Info
    57     --  Record Info
    58     Cur_Periodicity RECORD;
    58     Cur_Periodicity RECORD;
    59     Cur_Machine RECORD;
    59     Cur_Machine RECORD;
    60     v_Count NUMBER;
    60     v_Count NUMBER;
    61     v_InsertCount NUMBER:=0;
    61     v_InsertCount NUMBER:=0;
    62     v_MA_Maint_Scheduled NUMBER;
    62     v_MA_Maint_Scheduled VARCHAR2(32);
    63     v_Maint MA_Maintenance%ROWTYPE;
    63     v_Maint MA_Maintenance%ROWTYPE;
    64     v_InitDay NUMBER;
    64     v_InitDay NUMBER;
    65   BEGIN
    65   BEGIN
    66     IF(p_PInstance_ID IS NOT NULL) THEN
    66     IF(p_PInstance_ID IS NOT NULL) THEN
    67       --  Update AD_PInstance
    67       --  Update AD_PInstance