You can apply Journal to invoice or bill without any customization..you just need to select the account and the customer in the entity column in journal. In the invoice, click Edit then in the apply tab in the credit section you'll see the Journal - select it and Save