IDEMPIERE-5153 Cost Adjument Line Before Save: Update current cost price (#1411)
- Fix always getting current cost from primary accounting schema.
This commit is contained in:
parent
486ae19cdc
commit
edc96cca12
|
@ -369,6 +369,20 @@ public class MInventoryLine extends X_M_InventoryLine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check currency and as
|
||||||
|
int C_Currency_ID = getParent().getC_Currency_ID();
|
||||||
|
|
||||||
|
if (as.getC_Currency_ID() != C_Currency_ID)
|
||||||
|
{
|
||||||
|
MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(getCtx(), client.get_ID());
|
||||||
|
for (int i = 0; i < ass.length ; i ++)
|
||||||
|
{
|
||||||
|
MAcctSchema a = ass[i];
|
||||||
|
if (a.getC_Currency_ID() == C_Currency_ID)
|
||||||
|
as = a ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String costingMethod = getParent().getCostingMethod();
|
String costingMethod = getParent().getCostingMethod();
|
||||||
int AD_Org_ID = getAD_Org_ID();
|
int AD_Org_ID = getAD_Org_ID();
|
||||||
MCost cost = product.getCostingRecord(as, AD_Org_ID, M_ASI_ID, costingMethod);
|
MCost cost = product.getCostingRecord(as, AD_Org_ID, M_ASI_ID, costingMethod);
|
||||||
|
|
Loading…
Reference in New Issue