title: Init Ledger Journal Trans offset account
body: <p>I am trying to create (and post) ledger journals from data received via AIF inbound service. The data is written in a custom staging table with all necessary fields.</p>
  
  <p>Now, I need to create journals and journal trans records from this staging table. I am able to create <code>LedgerJournalTable</code> record with multiple <code>LedgerJournalTrans</code> records.</p>
  
  <p>Here is a code snippet for creating <code>LedgerJournalTrans</code>:</p>
  
  <pre><code> ledgerJournalTrans = this.initJournalTransFromStaging(ledgerJournalStaging);
   ledgerJournalTrans.initValue();
   ledgerJournalTrans.JournalNum   = ledgerJournalTable.JournalNum;
   ledgerJournalTrans.Voucher      = numberSeq.voucher();
  
   if (ledgerJournalTrans.validateWrite())
   {
       ledgerJournalTrans.insert();
   }
   // After that comes voucher validation using JedgerJournalCheckPost, which issues error that the voucher does not balance
  </code></pre>
  
  <p>Where <code>this.initJournalTransFromStaging</code> initializes some standard fields like <code>AccountNum</code>, <code>AmountCurDebit</code> and so on.</p>
  
  <p>My problem is that <code>OffsetAccount</code> is not populated from default settings (in my particular case, it should be defaulted from Ledger Journal Name, but it can also be taken from main account settings), that leads to error when validating voucher (does not balance). </p>
  
  <p>It would be great make use of some standard functionality to correctly initialize offset account.</p>
  
  <p>Thanks!</p>