BF [ 1892920 ] Locators fieldshould be ordered by Warehouse/Value

This commit is contained in:
teo_sarca 2008-02-13 17:31:11 +00:00
parent c2d086291d
commit 50b33b8f53
1 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,9 @@ import org.compiere.util.NamePair;
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: MLocatorLookup.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ * @version $Id: MLocatorLookup.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1892920 ] Locators fieldshould be ordered by Warehouse/Value
*/ */
public final class MLocatorLookup extends Lookup implements Serializable public final class MLocatorLookup extends Lookup implements Serializable
{ {
@ -321,6 +324,10 @@ public final class MLocatorLookup extends Lookup implements Serializable
.append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND p.M_Product_ID=?)") .append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND p.M_Product_ID=?)")
.append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator .append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator
.append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))"); .append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))");
sql.append(" ORDER BY ");
if (local_only_warehouse_id == 0)
sql.append("(SELECT wh.Name FROM M_Warehouse wh WHERE wh.M_Warehouse_ID=M_Locator.M_Warehouse_ID),");
sql.append("M_Locator.Value");
String finalSql = MRole.getDefault(m_ctx, false).addAccessSQL( String finalSql = MRole.getDefault(m_ctx, false).addAccessSQL(
sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
if (isInterrupted()) if (isInterrupted())