diff --git a/base/src/org/compiere/model/MProduct.java b/base/src/org/compiere/model/MProduct.java index 5a1dbab244..6ca2b5b846 100644 --- a/base/src/org/compiere/model/MProduct.java +++ b/base/src/org/compiere/model/MProduct.java @@ -89,6 +89,20 @@ public class MProduct extends X_M_Product } // 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 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 * @param ctx context