Added convenience method for reading a product using UPC/EAN.

This commit is contained in:
usrdno 2008-12-05 15:19:08 +00:00
parent d4031c9ea6
commit c371504f00
1 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,20 @@ public class MProduct extends X_M_Product
} // get } // get
/**
* Get MProduct using UPC/EAN (case sensitive)
* @param ctx Context
* @param upc The upc to look for
* @return List of MProduct
*
*/
public static List<MProduct> getByUPC(Properties ctx, String upc, String trxName) {
String whereClause = "AD_Client_ID=? AND UPC=?";
Query q = new Query(ctx, Table_Name, whereClause, trxName);
q.setParameters(new Object[]{Env.getAD_Client_ID(ctx), upc});
return(q.list());
}
/** /**
* Is Product Stocked * Is Product Stocked
* @param ctx context * @param ctx context