question: EgDemandDetails insertPenalty ( final BigDecimal chqBouncePenalty , final Module module ) { EgDemandDetails demandDetail = null ; if ( chqBouncePenalty != null && chqBouncePenalty . compareTo ( BigDecimal . ZERO ) > 0 ) { final Installment currInstallment = getCurrentInstallment ( module ) ; final EgDemandReasonMaster egDemandReasonMaster = demandGenericDao . getDemandReasonMasterByCode ( DEMANDRSN_CODE_CHQ_BOUNCE_PENALTY , module ) ; if ( egDemandReasonMaster == null ) throw new ApplicationRuntimeException ( " Penalty Demand reason Master is null in method  insertPenalty" ) ; final EgDemandReason egDemandReason = demandGenericDao . getDmdReasonByDmdReasonMsterInstallAndMod ( egDemandReasonMaster , currInstallment , module ) ; if ( egDemandReason == null ) throw new ApplicationRuntimeException ( " Penalty Demand reason is null in method  insertPenalty " ) ; demandDetail = EgDemandDetails . fromReasonAndAmounts ( chqBouncePenalty , egDemandReason , BigDecimal . ZERO ) ; } return demandDetail ; }
target:  Method used to insert penalty in EgDemandDetail table. Penalty Amount will be calculated depending upon the cheque Amount.