From b3862d3aac564693423cd5056f414cd7d06d8d73 Mon Sep 17 00:00:00 2001 From: phib Date: Thu, 27 May 2010 05:50:32 +0000 Subject: [PATCH] Changing quantity on invoice line with charge resets price Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=3007770 --- .../src/org/compiere/model/CalloutInvoice.java | 18 ++++++++++++++++-- base/src/org/compiere/model/CalloutOrder.java | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/base/src/org/compiere/model/CalloutInvoice.java b/base/src/org/compiere/model/CalloutInvoice.java index 7abda9e8cf..fbad12afe3 100644 --- a/base/src/org/compiere/model/CalloutInvoice.java +++ b/base/src/org/compiere/model/CalloutInvoice.java @@ -520,8 +520,22 @@ public class CalloutInvoice extends CalloutEngine log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual);// + ", Discount=" + Discount); - // Qty changed - recalc price - if ((mField.getColumnName().equals("QtyInvoiced") + // No Product + if ( M_Product_ID == 0 ) + { + // if price change sync price actual and entered + // else ignore + if (mField.getColumnName().equals("PriceActual")) + { + mTab.setValue("PriceEntered", value); + } + else if (mField.getColumnName().equals("PriceEntered")) + { + mTab.setValue("PriceActual", value); + } + } + // Product Qty changed - recalc price + else if ((mField.getColumnName().equals("QtyInvoiced") || mField.getColumnName().equals("QtyEntered") || mField.getColumnName().equals("M_Product_ID")) && !"N".equals(Env.getContext(ctx, WindowNo, "DiscountSchema"))) diff --git a/base/src/org/compiere/model/CalloutOrder.java b/base/src/org/compiere/model/CalloutOrder.java index a43c75e12e..b3d63a73f5 100644 --- a/base/src/org/compiere/model/CalloutOrder.java +++ b/base/src/org/compiere/model/CalloutOrder.java @@ -972,8 +972,22 @@ public class CalloutOrder extends CalloutEngine log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); - // Qty changed - recalc price - if ((mField.getColumnName().equals("QtyOrdered") + // No Product + if (M_Product_ID == 0) + { + // if price change sync price actual and entered + // else ignore + if (mField.getColumnName().equals("PriceActual")) + { + mTab.setValue("PriceEntered", value); + } + else if (mField.getColumnName().equals("PriceEntered")) + { + mTab.setValue("PriceActual", value); + } + } + // Product Qty changed - recalc price + else if ((mField.getColumnName().equals("QtyOrdered") || mField.getColumnName().equals("QtyEntered") || mField.getColumnName().equals("M_Product_ID")) && !"N".equals(Env.getContext(ctx, WindowNo, "DiscountSchema")))