details:   https://code.openbravo.com/erp/devel/pi/rev/c385f03ea176
changeset: 21925:c385f03ea176
user:      Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
date:      Thu Feb 06 11:27:59 2014 +0100
summary:   fixed issue 25441: Price is set fine using unit price when qty is 
changed in orderline

diffstat:

 src/org/openbravo/common/hooks/OrderLineQtyChangedHookObject.java |  20 
++++++++++
 src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java         |  11 +++--
 2 files changed, 27 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r 8b7a6ede079c -r c385f03ea176 
src/org/openbravo/common/hooks/OrderLineQtyChangedHookObject.java
--- a/src/org/openbravo/common/hooks/OrderLineQtyChangedHookObject.java Thu Feb 
06 09:53:55 2014 +0100
+++ b/src/org/openbravo/common/hooks/OrderLineQtyChangedHookObject.java Thu Feb 
06 11:27:59 2014 +0100
@@ -2,6 +2,8 @@
 
 import java.math.BigDecimal;
 
+import org.openbravo.model.pricing.pricelist.PriceList;
+
 public class OrderLineQtyChangedHookObject {
 
   private String productId;
@@ -10,6 +12,8 @@
   private BigDecimal price;
   private String changed;
   private int pricePrecision;
+  private PriceList priceList;
+  private BigDecimal listPrice;
 
   public int getPricePrecision() {
     return pricePrecision;
@@ -63,4 +67,20 @@
     this.price = price;
   }
 
+  public PriceList getPriceList() {
+    return priceList;
+  }
+
+  public void setPriceList(PriceList priceList) {
+    this.priceList = priceList;
+  }
+
+  public BigDecimal getListPrice() {
+    return listPrice;
+  }
+
+  public void setListPrice(BigDecimal listPrice) {
+    this.listPrice = listPrice;
+  }
+
 }
diff -r 8b7a6ede079c -r c385f03ea176 
src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Thu Feb 06 
09:53:55 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Thu Feb 06 
11:27:59 2014 +0100
@@ -110,8 +110,8 @@
     String strStockNoAttribute;
     String strStockAttribute;
     String strPriceActual = _strPriceActual;
-    boolean isTaxIncludedPriceList = OBDal.getInstance().get(PriceList.class, 
data[0].mPricelistId)
-        .isPriceIncludesTax();
+    PriceList currentPriceList = OBDal.getInstance().get(PriceList.class, 
data[0].mPricelistId);
+    boolean isTaxIncludedPriceList = currentPriceList.isPriceIncludesTax();
     boolean isGrossUnitPriceChanged = strChanged.equals("inpgrossUnitPrice");
     boolean forceSetPriceStd = false;
     if (data1 != null && data1.length > 0) {
@@ -158,10 +158,13 @@
         hookObject.setQty(qtyOrdered);
         hookObject.setOrderId(strCOrderId);
         hookObject.setPricePrecision(pricePrecision);
+        hookObject.setPriceList(currentPriceList);
         if (isTaxIncludedPriceList) {
-          hookObject.setPrice(grossPriceList);
+          hookObject.setListPrice(grossPriceList);
+          hookObject.setPrice(grossBaseUnitPrice);
         } else {
-          hookObject.setPrice(netPriceList);
+          hookObject.setListPrice(netPriceList);
+          hookObject.setPrice(priceStd);
         }
 
         hookObject.setChanged(strChanged);

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to