add this code below to LedgerJournalDP\InsertLedgerJournalTmp
if(_accountOffsetAccount == AccountOffsetaccount::Account)
{
switch(_ledgerJournalTrans.AccountType)
{
case LedgerJournalACType::Ledger :
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(_ledgerJournalTrans.LedgerDimension).MainAccount).MainAccountId;
break;
case LedgerJournalACType::Bank :
select * from dimAttrValueCombo
join Name from bankAccountTable
where bankAccountTable.AccountID == dimAttrValueCombo.DisplayValue
&& dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(bankAccountTable.LedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue, bankAccountTable.Name);
break;
case LedgerJournalACType::Vend :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
VendLedgerAccounts = VendLedgerAccounts::find(_ledgerJournalTrans.PostingProfile,TableGroupAll::GroupId,VendTable::find(dimAttrValueCombo.DisplayValue).VendGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(VendLedgerAccounts.SummaryLedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue,VendTable::find(dimAttrValueCombo.DisplayValue).name());
break;
case LedgerJournalACType::Cust :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
CustLedgerAccounts = CustLedgerAccounts::find(_ledgerJournalTrans.PostingProfile,TableGroupAll::GroupId,VendTable::find(dimAttrValueCombo.DisplayValue).VendGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(CustLedgerAccounts.SummaryLedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue,CustTable::find(dimAttrValueCombo.DisplayValue).name());
break;
case LedgerJournalACType::FixedAssets :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
selecT firstOnly ledgerJournalTrans_asset where ledgerJournalTrans_asset.RefRecId == _ledgerJournalTrans.RecId;
assetLedgerAccounts = AssetLedgerAccounts::find(ledgerJournalTrans_asset.BookId,_ledgerJournalTrans.PostingProfile,enum2int(ledgerJournalTrans_asset.TransType),TableGroupAll::GroupId,AssetTable::find(dimAttrValueCombo.DisplayValue).AssetGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(assetLedgerAccounts.LedgerDimension).MainAccount).MainAccountId;
break;
}
}
else
{
switch(_ledgerJournalTrans.AccountType)
{
case LedgerJournalACType::Ledger :
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(_ledgerJournalTrans.LedgerDimension).MainAccount).MainAccountId;
break;
case LedgerJournalACType::Bank :
select * from dimAttrValueCombo
join Name from bankAccountTable
where bankAccountTable.AccountID == dimAttrValueCombo.DisplayValue
&& dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(bankAccountTable.LedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue, bankAccountTable.Name);
break;
case LedgerJournalACType::Vend :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
VendLedgerAccounts = VendLedgerAccounts::find(VendParameters::find().PostingProfile,TableGroupAll::GroupId,VendTable::find(dimAttrValueCombo.DisplayValue).VendGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(VendLedgerAccounts.SummaryLedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue,VendTable::find(dimAttrValueCombo.DisplayValue).name());
break;
case LedgerJournalACType::Cust :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
CustLedgerAccounts = CustLedgerAccounts::find(CustParameters::find().PostingProfile,TableGroupAll::GroupId,VendTable::find(dimAttrValueCombo.DisplayValue).VendGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(CustLedgerAccounts.SummaryLedgerDimension).MainAccount).MainAccountId;
ledgerJournalTmp.AccountName = strFmt("%1 : %2",dimAttrValueCombo.DisplayValue,CustTable::find(dimAttrValueCombo.DisplayValue).name());
break;
case LedgerJournalACType::FixedAssets :
select firstOnly dimAttrValueCombo where dimAttrValueCombo.RecId == _ledgerJournalTrans.LedgerDimension;
selecT firstOnly ledgerJournalTrans_asset where ledgerJournalTrans_asset.RefRecId == _ledgerJournalTrans.RecId;
assetLedgerAccounts = AssetLedgerAccounts::find(ledgerJournalTrans_asset.BookId,AssetParameters::find().PostingProfile,enum2int(ledgerJournalTrans_asset.TransType),TableGroupAll::GroupId,AssetTable::find(dimAttrValueCombo.DisplayValue).AssetGroup);
ledgerJournalTmp.TIDMainAccountId = MainAccount::find(DimensionAttributeValueCombination::find(assetLedgerAccounts.LedgerDimension).MainAccount).MainAccountId;
break;
}
}