use of org.compiere.model.MDepreciationEntry in project adempiere by adempiere.
the class Doc_DepreciationEntry method loadDocumentDetails.
protected String loadDocumentDetails() {
MDepreciationEntry entry = (MDepreciationEntry) getPO();
m_PostingType = entry.getPostingType();
m_C_AcctSchema_ID = entry.getC_AcctSchema_ID();
return null;
}
use of org.compiere.model.MDepreciationEntry in project adempiere by adempiere.
the class Doc_DepreciationEntry method createFacts.
// getBalance
public ArrayList<Fact> createFacts(MAcctSchema as) {
ArrayList<Fact> facts = new ArrayList<Fact>();
// Other Acct Schema
if (as.getC_AcctSchema_ID() != m_C_AcctSchema_ID)
return facts;
// create Fact Header
Fact fact = new Fact(this, as, m_PostingType);
MDepreciationEntry entry = (MDepreciationEntry) getPO();
Iterator<MDepreciationExp> it = entry.getLinesIterator(false);
while (it.hasNext()) {
MDepreciationExp depexp = it.next();
DocLine line = createLine(depexp);
BigDecimal expenseAmt = depexp.getExpense();
//
MAccount dr_acct = MAccount.get(getCtx(), depexp.getDR_Account_ID());
MAccount cr_acct = MAccount.get(getCtx(), depexp.getCR_Account_ID());
FactUtil.createSimpleOperation(fact, line, dr_acct, cr_acct, as.getC_Currency_ID(), expenseAmt, false);
}
//
facts.add(fact);
return facts;
}
Aggregations