MPPProductPlanning: minor bug fix, reported by Victor

This commit is contained in:
teo_sarca 2008-08-26 20:20:16 +00:00
parent 2655b35b6a
commit 8b28e6b139
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ public class MPPProductPlanning extends X_PP_Product_Planning
if(m_M_Warehouse_ID <= 0)
return null;
final String sql = "SELECT MAX(S_Resource_ID) FROM S_Resource"
// Get plant resource for warehouse. If more than one resource is found, first will be used
final String sql = "SELECT MIN(S_Resource_ID) FROM S_Resource"
+" WHERE IsManufacturingResource=? AND ManufacturingResourceType=?"
+" AND AD_Client_ID=? AND M_Warehouse_ID= ?";
int m_S_Resource_ID = DB.getSQLValue(trxname, sql, "Y", MResource.MANUFACTURINGRESOURCETYPE_Plant, ad_client_id, m_M_Warehouse_ID);