We can perform GL Journal using the Invoices. If we want to adjust two Accounts.One account say salary Expense and other is Accounts Receivables. The Accounts receivables is created by using AR Invoices.If we want to adjust both accounts by using invoice as reference .  Select the invoice number as reference number in JournalLine  window . Select the Salary expense A/C and Accounts receivables Accounts with BPartner name in Account Combination as specified in the Invoices. After completion we see the changes in the Opening Balance of BPartner , ie reduced or add the journal amount to the Opening Balance and we can also see the changes in Open items report. ie the Journaling is Affects the particular invoices.

Create method In MJournal.java and it is executed at the time of completeit() method.