Forecast Line not validated the warehouse with Organization

https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2877525&group_id=176962

kind regards
Victor Perez
www.e-evolution.com
This commit is contained in:
vpj-cd 2009-10-13 02:42:23 +00:00
parent 7565e74cc2
commit fee1504c4e
4 changed files with 103 additions and 2 deletions

View File

@ -0,0 +1,55 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. *
* Contributor(s): Victor Perez www.e-evolution.com *
*****************************************************************************/
package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
/**
* Forecast Model
*
* @author victor.perez@e-evolution.com, www.e-evolution.com
*/
public class MForecast extends X_M_Forecast
{
/**
*
*/
private static final long serialVersionUID = 66771328316032322L;
/**
* Standard Constructor
* @param ctx context
* @param M_ForecastLine_ID id
*/
public MForecast (Properties ctx, int M_Forecast_ID, String trxName)
{
super (ctx, M_Forecast_ID, trxName);
} // MForecastLine
/**
* Load Constructor
* @param ctx context
* @param rs result set
*/
public MForecast (Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
} // MForecast
} // MForecast

View File

@ -17,6 +17,7 @@ package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.adempiere.exceptions.WarehouseInvalidForOrgException;
/**
@ -27,10 +28,14 @@ import java.util.Properties;
*/
public class MForecastLine extends X_M_ForecastLine
{
/**
*
*/
private static final long serialVersionUID = -4757137580071600111L;
private static final long serialVersionUID = -3420900505079279058L;
/** Parent */
private MForecast m_parent = null;
/**
* Standard Constructor
@ -50,5 +55,36 @@ public class MForecastLine extends X_M_ForecastLine
public MForecastLine (Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
} // MRequisitionLine
} // MForecastLine
/**************************************************************************
* Before Save
* @param newRecord
* @return true if it can be saved
*/
protected boolean beforeSave (boolean newRecord)
{
if (newRecord
|| is_ValueChanged("AD_Org_ID") || is_ValueChanged("M_Warehouse_ID"))
{
MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID());
if (wh.getAD_Org_ID() != getAD_Org_ID())
{
throw new WarehouseInvalidForOrgException(wh.getName(), MOrg.get(getCtx(), getAD_Org_ID()).getName());
}
}
return true;
}
/**
* Get Parent
* @return parent
*/
public MForecast getParent()
{
if (m_parent == null)
m_parent = new MForecast(getCtx(), getM_Forecast_ID(), get_TrxName());
return m_parent;
} // getParent
} // MForecastLine

View File

@ -0,0 +1,5 @@
-- Oct 12, 2009 9:06:07 PM CDT
-- Forecast
UPDATE AD_Column SET AD_Val_Rule_ID=189,Updated=TO_DATE('2009-10-12 21:06:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53411
;

View File

@ -0,0 +1,5 @@
-- Oct 12, 2009 9:06:07 PM CDT
-- Forecast
UPDATE AD_Column SET AD_Val_Rule_ID=189,Updated=TO_TIMESTAMP('2009-10-12 21:06:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53411
;