use of org.compiere.model.MAssetDisposed in project adempiere by adempiere.
the class Doc_AssetDisposed method getAccount.
private MAccount getAccount(String accountName) {
MAssetDisposed assetDisp = (MAssetDisposed) getPO();
MAssetAcct assetAcct = MAssetAcct.forA_Asset_ID(getCtx(), assetDisp.getA_Asset_ID(), assetDisp.getPostingType(), assetDisp.getDateAcct(), null);
int account_id = (Integer) assetAcct.get_Value(accountName);
return MAccount.get(getCtx(), account_id);
}
use of org.compiere.model.MAssetDisposed in project adempiere by adempiere.
the class Doc_AssetDisposed method createFacts.
public ArrayList<Fact> createFacts(MAcctSchema as) {
MAssetDisposed assetDisp = (MAssetDisposed) getPO();
ArrayList<Fact> facts = new ArrayList<Fact>();
Fact fact = new Fact(this, as, assetDisp.getPostingType());
facts.add(fact);
//
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Asset_Acct), as.getC_Currency_ID(), Env.ZERO, assetDisp.getA_Disposal_Amt());
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Accumdepreciation_Acct), as.getC_Currency_ID(), assetDisp.getA_Accumulated_Depr_Delta(), Env.ZERO);
fact.createLine(null, getAccount(MAssetAcct.COLUMNNAME_A_Disposal_Loss_Acct), as.getC_Currency_ID(), assetDisp.getExpense(), Env.ZERO);
//
return facts;
}
Aggregations