Search in sources :

Example 1 with I_C_Project

use of org.compiere.model.I_C_Project in project adempiere by adempiere.

the class Doc_AssetAddition method getP_Asset_Acct.

private MAccount getP_Asset_Acct(MAcctSchema as) {
    MAssetAddition assetAdd = getAssetAddition();
    // Source Account
    MAccount pAssetAcct = null;
    if (MAssetAddition.A_SOURCETYPE_Project.equals(assetAdd.getA_SourceType())) {
        I_C_Project prj = assetAdd.getC_Project();
        return getProjectAcct(prj, as);
    } else if (MAssetAddition.A_SOURCETYPE_Manual.equals(assetAdd.getA_SourceType()) && // backward compatibility: only if charge defined; if not fallback to product account 
    getC_Charge_ID() > 0) {
        pAssetAcct = MCharge.getAccount(getC_Charge_ID(), as, null);
        return pAssetAcct;
    } else if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType()) && assetAdd.getC_InvoiceLine().getC_Project_ID() > 0) {
        I_C_Project prj = assetAdd.getC_InvoiceLine().getC_Project();
        return getProjectAcct(prj, as);
    } else {
        pAssetAcct = getP_Expense_Acct(assetAdd.getM_Product_ID(), as);
    }
    //
    return pAssetAcct;
}
Also used : MAssetAddition(org.compiere.model.MAssetAddition) MAccount(org.compiere.model.MAccount) I_C_Project(org.compiere.model.I_C_Project)

Aggregations

I_C_Project (org.compiere.model.I_C_Project)1 MAccount (org.compiere.model.MAccount)1 MAssetAddition (org.compiere.model.MAssetAddition)1