BF [ 2268355 ] Invoice price variance doesn't use transactional currency

Which lead to generate unnecessary suspense and currency balancing
http://sourceforge.net/tracker/index.php?func=detail&aid=2268355&group_id=176962&atid=879332
This commit is contained in:
bayucahya 2008-11-13 03:50:36 +00:00
parent a76b71719d
commit 76f79e7a1f
1 changed files with 9 additions and 2 deletions

View File

@ -46,6 +46,8 @@ import org.compiere.util.Env;
* FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual
* Avoid posting if both accounts Not Invoiced Receipts and Inventory Clearing are equal * Avoid posting if both accounts Not Invoiced Receipts and Inventory Clearing are equal
* *
* @author Bayu Cahya, Sistematika
* <li>BF [ 2268355 ] Invoice price variance doesn't use transactional currency
*/ */
public class Doc_MatchInv extends Doc public class Doc_MatchInv extends Doc
{ {
@ -259,12 +261,16 @@ public class Doc_MatchInv extends Doc
// Invoice Price Variance difference // Invoice Price Variance difference
BigDecimal ipv = cr.getAcctBalance().add(dr.getAcctBalance()).negate(); // Bayu, Sistematika
// BF [ 2268355 ] Invoice price variance doesn't use transactional currency
BigDecimal ipv = cr.getSourceBalance().add(dr.getSourceBalance()).negate();
if (ipv.signum() != 0) if (ipv.signum() != 0)
{ {
MInvoice m_invoice = m_invoiceLine.getParent();
int C_Currency_ID = m_invoice.getC_Currency_ID();
FactLine pv = fact.createLine(null, FactLine pv = fact.createLine(null,
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as), m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
as.getC_Currency_ID(), ipv); C_Currency_ID, ipv);
pv.setC_Activity_ID(m_invoiceLine.getC_Activity_ID()); pv.setC_Activity_ID(m_invoiceLine.getC_Activity_ID());
pv.setC_Campaign_ID(m_invoiceLine.getC_Campaign_ID()); pv.setC_Campaign_ID(m_invoiceLine.getC_Campaign_ID());
pv.setC_Project_ID(m_invoiceLine.getC_Project_ID()); pv.setC_Project_ID(m_invoiceLine.getC_Project_ID());
@ -273,6 +279,7 @@ public class Doc_MatchInv extends Doc
pv.setUser2_ID(m_invoiceLine.getUser2_ID()); pv.setUser2_ID(m_invoiceLine.getUser2_ID());
} }
log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance()); log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance());
// end Bayu
// Elaine 2008/6/20 // Elaine 2008/6/20
/* Source move to MInvoice.createMatchInvCostDetail() /* Source move to MInvoice.createMatchInvCostDetail()
// Cost Detail Record - data from Expense/IncClearing (CR) record // Cost Detail Record - data from Expense/IncClearing (CR) record