details:   https://code.openbravo.com/erp/devel/pi/rev/85cf00e297e8
changeset: 17496:85cf00e297e8
user:      Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
date:      Tue Jul 17 16:37:50 2012 +0200
summary:   Related to issue 21077.Recalculate net prices and amount after 
discount change.

diffstat:

 src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 90c03ab79c8d -r 85cf00e297e8 
src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Tue Jul 17 
12:50:47 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java Tue Jul 17 
16:37:50 2012 +0200
@@ -105,6 +105,7 @@
     String strPriceActual = _strPriceActual;
     boolean isTaxIncludedPriceList = OBDal.getInstance().get(PriceList.class, 
data[0].mPricelistId)
         .isPriceIncludesTax();
+    boolean isGrossUnitPriceChanged = strChanged.equals("inpgrossUnitPrice");
 
     if (data1 != null && data1.length > 0) {
       strStockSecurity = data1[0].stock;
@@ -289,6 +290,7 @@
             new BigDecimal("100"), pricePrecision, BigDecimal.ROUND_HALF_UP));
         if (isTaxIncludedPriceList) {
           grossUnitPrice = unitPrice;
+          isGrossUnitPriceChanged = true;
           resultado.append("new Array(\"inpgrossUnitPrice\", " + 
grossUnitPrice.toString() + "),");
         } else {
           // checks if rounded discount has changed
@@ -356,7 +358,7 @@
     }
 
     // if taxinclusive field is changed then modify net unit price and gross 
price
-    if (strChanged.equals("inpgrossUnitPrice")) {
+    if (isGrossUnitPriceChanged) {
       BigDecimal grossAmount = 
grossUnitPrice.multiply(qtyOrdered).setScale(stdPrecision,
           RoundingMode.HALF_UP);
 

------------------------------------------------------------------------------
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