src-db/database/model/functions/MA_GLOBALUSE_DISTRIBUTE.xml
changeset 9916 389534944830
parent 9072 79e55dfc8af0
equal deleted inserted replaced
9915:b12ddee9c95c 9916:389534944830
    23 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    23 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    24 * License for the specific  language  governing  rights  and  limitations
    24 * License for the specific  language  governing  rights  and  limitations
    25 * under the License.
    25 * under the License.
    26 * The Original Code is Openbravo ERP.
    26 * The Original Code is Openbravo ERP.
    27 * The Initial Developer of the Original Code is Openbravo SLU
    27 * The Initial Developer of the Original Code is Openbravo SLU
    28 * All portions are Copyright (C) 2001-2006 Openbravo SLU
    28 * All portions are Copyright (C) 2001-2013 Openbravo SLU
    29 * All Rights Reserved.
    29 * All Rights Reserved.
    30 * Contributor(s):  ______________________________________.
    30 * Contributor(s):  ______________________________________.
    31 ************************************************************************/
    31 ************************************************************************/
    32   --  Logistice
    32   --  Logistice
    33   v_ResultStr VARCHAR2(2000):='';
    33   v_ResultStr VARCHAR2(2000):='';
   114         WHERE pp.MA_WRPHASE_ID=wp.MA_WRPHASE_ID
   114         WHERE pp.MA_WRPHASE_ID=wp.MA_WRPHASE_ID
   115           AND wp.MA_WRPHASE_ID=wpp.MA_WRPHASE_ID
   115           AND wp.MA_WRPHASE_ID=wpp.MA_WRPHASE_ID
   116           AND pp.M_PRODUCTIONPLAN_ID=Cur_ProductionPlan.M_ProductionPlan_ID
   116           AND pp.M_PRODUCTIONPLAN_ID=Cur_ProductionPlan.M_ProductionPlan_ID
   117           AND wp.GROUPUSE='Y'
   117           AND wp.GROUPUSE='Y'
   118           AND wpp.M_PRODUCT_ID=Cur_GlobalUse.M_Product_ID;
   118           AND wpp.M_PRODUCT_ID=Cur_GlobalUse.M_Product_ID;
   119         IF(v_Factor<>0) THEN
   119 
       
   120         SELECT COUNT(*)
       
   121         INTO v_Count
       
   122         FROM M_PRODUCTIONLINE
       
   123         WHERE M_PRODUCTIONPLAN_ID=Cur_ProductionPlan.M_ProductionPlan_ID
       
   124         AND M_PRODUCT_ID=Cur_GlobalUse.M_Product_ID;
       
   125         
       
   126         IF(v_Factor<>0 AND v_Count = 0) THEN
   120           SELECT MAX(Line) +10
   127           SELECT MAX(Line) +10
   121           INTO v_Line
   128           INTO v_Line
   122           FROM M_PRODUCTIONLINE
   129           FROM M_PRODUCTIONLINE
   123           WHERE M_ProductionPlan_ID=Cur_ProductionPlan.M_ProductionPlan_ID;
   130           WHERE M_ProductionPlan_ID=Cur_ProductionPlan.M_ProductionPlan_ID;
   124           Ad_Sequence_Next('M_ProductionLine', p_Client_ID, v_ProductionLine_ID) ;
   131           Ad_Sequence_Next('M_ProductionLine', p_Client_ID, v_ProductionLine_ID) ;