use of org.compiere.model.MAssetReval in project adempiere by adempiere.
the class Doc_AssetReval method createFacts.
public ArrayList<Fact> createFacts(MAcctSchema as) {
MAssetAcct assetAcct = getAssetAcct();
MAssetReval assetRe = getAssetReval();
ArrayList<Fact> facts = new ArrayList<Fact>();
Fact fact = new Fact(this, as, assetAcct.getPostingType());
facts.add(fact);
MAccount dr = MAccount.get(getCtx(), assetAcct.getA_Asset_Acct());
MAccount cr = MAccount.get(getCtx(), assetAcct.getA_Reval_Cost_Offset_Acct());
FactUtil.createSimpleOperation(fact, null, dr, cr, as.getC_Currency_ID(), assetRe.getA_Asset_Cost_Change().subtract(assetRe.getA_Asset_Cost()), false);
MAccount drd = MAccount.get(getCtx(), assetAcct.getA_Reval_Cost_Offset_Acct());
MAccount crd = MAccount.get(getCtx(), assetAcct.getA_Accumdepreciation_Acct());
FactUtil.createSimpleOperation(fact, null, drd, crd, as.getC_Currency_ID(), assetRe.getA_Change_Acumulated_Depr().subtract(assetRe.getA_Accumulated_Depr()), false);
return facts;
}
Aggregations