why this check is required... if required then both debit and credit JournalEntry should be under this check... or you can consider calling  createCashBasedJournalEntriesAndReversalsForLoan like createJournalEntriesForRefund