From 1216407472e68812129a341ea9198ceb05df8fe3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 9 Feb 2018 23:20:37 +0100 Subject: [PATCH] IDEMPIERE-3637 Invoice vendor re-price is not recalculating taxes --- .../src/org/compiere/process/OrderRePrice.java | 5 ++++- org.adempiere.base/src/org/compiere/model/MInvoiceLine.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java b/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java index 81bbf52711..410ceb7874 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderRePrice.java @@ -92,7 +92,10 @@ public class OrderRePrice extends SvrProcess for (int i = 0; i < lines.length; i++) { lines[i].setPrice(invoice.getM_PriceList_ID(), invoice.getC_BPartner_ID()); - lines[i].saveEx(); + if (lines[i].is_Changed()) { + lines[i].setTaxAmt(); + lines[i].saveEx(); + } } invoice = new MInvoice (getCtx(), p_C_Invoice_ID, null); BigDecimal newPrice = invoice.getGrandTotal(); diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index 3582e9d1e5..62b5ccff73 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -457,7 +457,7 @@ public class MInvoiceLine extends X_C_InvoiceLine BigDecimal TaxAmt = Env.ZERO; if (getC_Tax_ID() == 0) return; - // setLineNetAmt(); + setLineNetAmt(); MTax tax = MTax.get (getCtx(), getC_Tax_ID()); if (tax.isDocumentLevel() && m_IsSOTrx) // AR Inv Tax return;