MainAccount mainAccountId = LedgerDimensionFacade::getMainAccountFromLedgerDimension(_ledgerPostingTransaction.LedgerDimension);
DimensionHierarchyId accountStructureId = DimensionHierarchy::getAccountStructure(mainAccountId.RecId);if (accountStructureId)
{
LedgerDimensionDefaultingEngine dimDefaultingEngine;
List dimensionSources;
// Validate input parameter
if (!mainAccountId.RecId|| !accountStructureId)
{
throw error(Error::wrongUseOfFunction(funcName()));
}
dimensionSources = new List(Types::Class);
dimensionSources.addEnd(LedgerDimensionDefaultingEngine::getDefaultDimensionSpecifiers(inventJournalTrans.BTCOffsetDefaultDimension));
dimDefaultingEngine = LedgerDimensionDefaultingEngine::constructForMainAccountId(mainAccountId.RecId, accountStructureId);
dimDefaultingEngine.applyDimensionSources(dimensionSources);
LedgerDimensionAccount ledgerDimensionAccountCustom = dimDefaultingEngine.getLedgerDimension();
generalJournalAccountEntry.LedgerDimension = ledgerDimensionAccountCustom;
}
else
{
throw error(strFmt("@SYS4009834", MainAccount::find(mainAccountId.RecId).MainAccountId));
}
No comments:
Post a Comment