IDEMPIERE-3306 Product Type=Service Posting with price variation
This commit is contained in:
parent
b8c975b8a3
commit
c0808dd049
|
@ -402,9 +402,12 @@ public class Doc_MatchInv extends Doc
|
||||||
}
|
}
|
||||||
|
|
||||||
String costingMethod = m_pc.getProduct().getCostingMethod(as);
|
String costingMethod = m_pc.getProduct().getCostingMethod(as);
|
||||||
|
MAccount account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
||||||
|
if (m_pc.isService())
|
||||||
|
account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Expense, as);
|
||||||
if (X_M_Cost.COSTINGMETHOD_AveragePO.equals(costingMethod)) {
|
if (X_M_Cost.COSTINGMETHOD_AveragePO.equals(costingMethod)) {
|
||||||
MAccount account = zeroQty ? m_pc.getAccount(ProductCost.ACCTTYPE_P_AverageCostVariance, as) : m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
if (zeroQty)
|
||||||
|
account = m_pc.getAccount(ProductCost.ACCTTYPE_P_AverageCostVariance, as);
|
||||||
FactLine line = fact.createLine(null,
|
FactLine line = fact.createLine(null,
|
||||||
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
|
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
|
||||||
as.getC_Currency_ID(), ipv.negate());
|
as.getC_Currency_ID(), ipv.negate());
|
||||||
|
@ -413,8 +416,6 @@ public class Doc_MatchInv extends Doc
|
||||||
line = fact.createLine(null, account, as.getC_Currency_ID(), ipv);
|
line = fact.createLine(null, account, as.getC_Currency_ID(), ipv);
|
||||||
updateFactLine(line);
|
updateFactLine(line);
|
||||||
} else if (X_M_Cost.COSTINGMETHOD_AverageInvoice.equals(costingMethod) && !zeroQty) {
|
} else if (X_M_Cost.COSTINGMETHOD_AverageInvoice.equals(costingMethod) && !zeroQty) {
|
||||||
MAccount account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
|
||||||
|
|
||||||
FactLine line = fact.createLine(null,
|
FactLine line = fact.createLine(null,
|
||||||
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
|
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
|
||||||
as.getC_Currency_ID(), ipv.negate());
|
as.getC_Currency_ID(), ipv.negate());
|
||||||
|
|
Loading…
Reference in New Issue