details:   https://code.openbravo.com/erp/devel/pi/rev/71b903299dd5
changeset: 16727:71b903299dd5
user:      Javier Etxarri <javier.echarri <at> openbravo.com>
date:      Thu May 31 18:36:57 2012 +0200
summary:   Fixes issue 20440: Error without information in the P&E of Return To 
Vendor

diffstat:

 src/org/openbravo/common/actionhandler/SRMOPickEditLines.java |  31 ++++++----
 1 files changed, 17 insertions(+), 14 deletions(-)

diffs (53 lines):

diff -r 66f1b36f7b4d -r 71b903299dd5 
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Thu May 
31 18:25:48 2012 +0200
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java     Thu May 
31 18:36:57 2012 +0200
@@ -249,12 +249,14 @@
         if (isDefultPriceList) {
           throw new OBException("NoDefaultPriceList");
         } else {
-          // If pl was the Business Partner's price list, there was no fit 
price list for it so take
+          // If pl was the Business Partner's price list, there was no fit 
price list for it so
+          // take
           // the default price list.
-          pl = getDefaultPriceList(o.getClient().getId(), 
o.getOrganization().getId(), isSalesPL);
-          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
-          // There is no fit price list version.
-          if (earliestPlv == null) {
+          try {
+            pl = getDefaultPriceList(o.getClient().getId(), 
o.getOrganization().getId(), isSalesPL);
+            earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          } catch (Exception e) {
+            // There is no fit price list version.
             throw new OBException("NoDefaultPriceList");
           }
         }
@@ -267,19 +269,20 @@
         } else if (prices != null) {
           return prices;
         } else {
-          pl = getDefaultPriceList(o.getClient().getId(), 
o.getOrganization().getId(), isSalesPL);
-          earliestPlv = getEarliestPriceListVersion(pl, orderDate);
-          if (earliestPlv == null) {
+          try {
+            pl = getDefaultPriceList(o.getClient().getId(), 
o.getOrganization().getId(), isSalesPL);
+            earliestPlv = getEarliestPriceListVersion(pl, orderDate);
+          } catch (Exception e) {
             throw new OBException("NoDefaultPriceList");
+          }
+          prices = getProductPricesFromPLV(strProductId, earliestPlv);
+          if (prices == null) {
+            throw new OBException("NoProductInDefaultPriceList");
           } else {
-            prices = getProductPricesFromPLV(strProductId, earliestPlv);
-            if (prices == null) {
-              throw new OBException("NoProductInDefaultPriceList");
-            } else {
-              return prices;
-            }
+            return prices;
           }
         }
+
       }
       return null;
     } finally {

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to