use of org.compiere.model.MAssetAcct 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;
}
use of org.compiere.model.MAssetAcct in project adempiere by adempiere.
the class CalloutA_Asset_Transfer method asset.
public String asset(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {
if (isCalloutActive())
return "";
//
I_A_Asset_Transfer model = GridTabWrapper.create(mTab, I_A_Asset_Transfer.class);
if (model.getA_Asset_ID() <= 0) {
return "";
}
MAssetAcct acct = MAssetAcct.forA_Asset_ID(ctx, model.getA_Asset_ID(), model.getPostingType(), model.getDateAcct(), null);
if (acct == null) {
return "@NotFound@ @A_Asset_Acct_ID@";
}
// Asset Acct
model.setA_Asset_Acct(acct.getA_Asset_Acct());
model.setA_Asset_New_Acct(acct.getA_Asset_Acct());
//Accumulated Depreciation Account
model.setA_Accumdepreciation_Acct(acct.getA_Accumdepreciation_Acct());
model.setA_Accumdepreciation_New_Acct(acct.getA_Accumdepreciation_Acct());
//Depreciation Account
model.setA_Depreciation_Acct(acct.getA_Depreciation_Acct());
model.setA_Depreciation_New_Acct(acct.getA_Depreciation_Acct());
//Disposal revenue
model.setA_Disposal_Revenue_Acct(acct.getA_Disposal_Revenue_Acct());
model.setA_Disposal_Revenue_New_Acct(acct.getA_Disposal_Revenue_Acct());
//Disposal Loss Account
model.setA_Disposal_Loss_Acct(acct.getA_Disposal_Loss_Acct());
model.setA_Disposal_Loss_New_Acct(acct.getA_Disposal_Loss_Acct());
return "";
}
use of org.compiere.model.MAssetAcct 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);
}
Aggregations