public void createAccrualBasedJournalEntriesAndReversalsForLoan(final Office office,final String currencyCode,final Integer accountTypeToBeDebited,final Integer accountTypeToBeCredited,final Long loanProductId,final Long paymentTypeId,final Long loanId,final String transactionId,final Date transactionDate,final BigDecimal amount,final Boolean isReversal){
  int accountTypeToDebitId=accountTypeToBeDebited;
  int accountTypeToCreditId=accountTypeToBeCredited;
  if (isReversal) {
    accountTypeToDebitId=accountTypeToBeCredited;
    accountTypeToCreditId=accountTypeToBeDebited;
  }
  createJournalEntriesForLoan(office,currencyCode,accountTypeToDebitId,accountTypeToCreditId,loanProductId,paymentTypeId,loanId,transactionId,transactionDate,amount);
}

public void createAccrualBasedJournalEntriesAndReversalsForLoan ( final Office office , final String currencyCode , final Integer accountTypeToBeDebited , final Integer accountTypeToBeCredited , final Long loanProductId , final Long paymentTypeId , final Long loanId , final String transactionId , final Date transactionDate , final BigDecimal amount , final Boolean isReversal ) { int accountTypeToDebitId = accountTypeToBeDebited ; int accountTypeToCreditId = accountTypeToBeCredited ; if ( isReversal ) { accountTypeToDebitId = accountTypeToBeCredited ; accountTypeToCreditId = accountTypeToBeDebited ; } createJournalEntriesForLoan ( office , currencyCode , accountTypeToDebitId , accountTypeToCreditId , loanProductId , paymentTypeId , loanId , transactionId , transactionDate , amount ) ; }
convenience method that creates a pair of related debits and credits for accrual based accounting . the target accounts for debits and credits are switched in case of a reversal
