diff -r 7cfa97da1280 src/org/openbravo/retail/posterminal/POSUtils.java
--- a/src/org/openbravo/retail/posterminal/POSUtils.java	Mon May 06 11:55:33 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/POSUtils.java	Tue May 07 18:08:27 2013 +0200
@@ -6,11 +6,13 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.hibernate.Query;
 import org.hibernate.SQLQuery;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.client.kernel.KernelUtils;
+import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -21,6 +23,7 @@
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.enterprise.Warehouse;
 import org.openbravo.model.pricing.pricelist.PriceList;
+import org.openbravo.model.pricing.pricelist.PriceListVersion;
 import org.openbravo.retail.config.OBRETCOProductList;
 
 /**
@@ -213,6 +216,47 @@
     return null;
   }
 
+  public static PriceListVersion getPriceListVersionForPriceList(String priceListId) {
+
+    try {
+      OBContext.setAdminMode(true);
+      Query priceListVersionQuery = OBDal
+          .getInstance()
+          .getSession()
+          .createQuery(
+              "from PricingPriceListVersion AS plv "
+                  + "where plv.priceList.id ='"
+                  + priceListId
+                  + "' and plv.validFromDate = (select max(pplv.validFromDate) "
+                  + "from PricingPriceListVersion as pplv where pplv.active=true and pplv.priceList.id = '"
+                  + priceListId + "')");
+      for (Object plv : priceListVersionQuery.list()) {
+        return (PriceListVersion) plv;
+      }
+
+    } catch (Exception e) {
+      log.error("Error getting PriceList by Terminal id: " + e.getMessage(), e);
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+
+    return null;
+  }
+
+  public static PriceListVersion getPriceListVersionByTerminalId(String terminalId) {
+
+    PriceList priceList = POSUtils.getPriceListByTerminalId(terminalId);
+    String priceListId = (String) DalUtil.getId(priceList);
+    return POSUtils.getPriceListVersionForPriceList(priceListId);
+  }
+
+  public static PriceListVersion getPriceListVersionByOrgId(String orgId) {
+
+    PriceList priceList = POSUtils.getPriceListByOrgId(orgId);
+    String priceListId = (String) DalUtil.getId(priceList);
+    return POSUtils.getPriceListVersionForPriceList(priceListId);
+  }
+
   public static OBRETCOProductList getProductListByOrgId(String orgId) {
     try {
       OBContext.setAdminMode();
diff -r 7cfa97da1280 src/org/openbravo/retail/posterminal/master/Category.java
--- a/src/org/openbravo/retail/posterminal/master/Category.java	Mon May 06 11:55:33 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/master/Category.java	Tue May 07 18:08:27 2013 +0200
@@ -14,7 +14,7 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.dal.core.OBContext;
-import org.openbravo.model.pricing.pricelist.PriceList;
+import org.openbravo.model.pricing.pricelist.PriceListVersion;
 import org.openbravo.retail.config.OBRETCOProductList;
 import org.openbravo.retail.posterminal.POSUtils;
 import org.openbravo.retail.posterminal.ProcessHQLQuery;
@@ -28,7 +28,7 @@
 
     final OBRETCOProductList productList = POSUtils.getProductListByOrgId(orgId);
 
-    final PriceList priceList = POSUtils.getPriceListByOrgId(orgId);
+    final PriceListVersion priceListVersion = POSUtils.getPriceListVersionByOrgId(orgId);
     if (productList == null) {
       throw new JSONException("Product list not found");
     }
@@ -45,16 +45,9 @@
             + "WHERE pCat=pli.product.productCategory and (pli.obretcoProductlist = '"
             + productList.getId()
             + "') "
-            + "AND ("
-            + "pplv.priceList.id = '"
-            + priceList.getId()
-            + "' AND "
-            + "pplv.validFromDate = (select max(a.validFromDate) "
-            + "  FROM PricingPriceListVersion a "
-            + "  WHERE a.priceList.id = '"
-            + priceList.getId()
-            + "')"
-            + ") AND ("
+            + "AND (pplv.id='"
+            + priceListVersion.getId()
+            + "') AND ("
             + "ppp.priceListVersion.id = pplv.id"
             + ") AND ("
             + "pli.product.id = ppp.product.id"
diff -r 7cfa97da1280 src/org/openbravo/retail/posterminal/master/Product.java
--- a/src/org/openbravo/retail/posterminal/master/Product.java	Mon May 06 11:55:33 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/master/Product.java	Tue May 07 18:08:27 2013 +0200
@@ -15,6 +15,7 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.model.pricing.pricelist.PriceList;
+import org.openbravo.model.pricing.pricelist.PriceListVersion;
 import org.openbravo.retail.config.OBRETCOProductList;
 import org.openbravo.retail.posterminal.POSUtils;
 import org.openbravo.retail.posterminal.ProcessHQLQuery;
@@ -27,6 +28,7 @@
     final OBRETCOProductList productList = POSUtils.getProductListByOrgId(orgId);
 
     final PriceList priceList = POSUtils.getPriceListByOrgId(orgId);
+    final PriceListVersion priceListVersion = POSUtils.getPriceListVersionByOrgId(orgId);
 
     if (productList == null) {
       throw new JSONException("Product list not found");
@@ -53,14 +55,9 @@
             + productList.getId()
             + "') "
             + "AND ("
-            + "pplv.priceList.id = '"
-            + priceList.getId()
-            + "' AND "
-            + "pplv.validFromDate = (select max(a.validFromDate) "
-            + "  FROM PricingPriceListVersion a "
-            + "  WHERE a.priceList.id = '"
-            + priceList.getId()
-            + "')"
+            + "pplv.id='"
+            + priceListVersion.getId()
+            + "'"
             + ") AND ("
             + "ppp.priceListVersion.id = pplv.id"
             + ") AND ("
diff -r 7cfa97da1280 src/org/openbravo/retail/posterminal/term/PriceListVersion.java
--- a/src/org/openbravo/retail/posterminal/term/PriceListVersion.java	Mon May 06 11:55:33 2013 +0200
+++ b/src/org/openbravo/retail/posterminal/term/PriceListVersion.java	Tue May 07 18:08:27 2013 +0200
@@ -21,14 +21,10 @@
 
   @Override
   protected List<String> getQuery(JSONObject jsonsent) throws JSONException {
-    String priceListId = POSUtils.getPriceListByTerminalId(
+    String priceListVersionId = POSUtils.getPriceListVersionByTerminalId(
         RequestContext.get().getSessionAttribute("POSTerminal").toString()).getId();
-    return Arrays
-        .asList(new String[] { "select plv.id AS id " + "from PricingPriceListVersion AS plv "
-            + "where plv.$readableCriteria and plv.priceList.id ='" + priceListId
-            + "' and plv.validFromDate = (select max(pplv.validFromDate) "
-            + "from PricingPriceListVersion as pplv where pplv.priceList.id = '" + priceListId
-            + "')" });
+    return Arrays.asList(new String[] { "select plv.id AS id "
+        + "from PricingPriceListVersion AS plv " + "where plv.id ='" + priceListVersionId + "'" });
   }
 
   @Override
