Search in sources :

Example 1 with MDepreciationEntry

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;
}
Also used : MDepreciationEntry(org.compiere.model.MDepreciationEntry)

Example 2 with MDepreciationEntry

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;
}
Also used : MDepreciationEntry(org.compiere.model.MDepreciationEntry) MAccount(org.compiere.model.MAccount) ArrayList(java.util.ArrayList) MDepreciationExp(org.compiere.model.MDepreciationExp) BigDecimal(java.math.BigDecimal)

Aggregations

MDepreciationEntry (org.compiere.model.MDepreciationEntry)2 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 MAccount (org.compiere.model.MAccount)1 MDepreciationExp (org.compiere.model.MDepreciationExp)1