@Transactional public void createVoucherfromPreApprovedVoucher(final long vouhcerheaderid) throws ApplicationRuntimeException {
  String voucherStatus=null;
  try {
    final List vStatusList=appConfigValuesService.getConfigValuesByModuleAndKey("EGF","APPROVEDVOUCHERSTATUS");
    if (!vStatusList.isEmpty() && vStatusList.size() == 1) {
      final AppConfigValues appVal=(AppConfigValues)vStatusList.get(0);
      voucherStatus=appVal.getValue();
    }
 else     throw new ApplicationRuntimeException("APPROVEDVOUCHERSTATUS" + MISSINGMSG);
    createVoucher.createVoucherFromPreApprovedVoucher(vouhcerheaderid,voucherStatus);
  }
 catch (  final ApplicationRuntimeException e) {
    LOGGER.error(e.getMessage());
    throw new ApplicationRuntimeException(e.getMessage());
  }
}

@ Transactional public void createVoucherfromPreApprovedVoucher ( final long vouhcerheaderid ) throws ApplicationRuntimeException { String voucherStatus = null ; try { final List vStatusList = appConfigValuesService . getConfigValuesByModuleAndKey ( "EGF" , "APPROVEDVOUCHERSTATUS" ) ; if ( ! vStatusList . isEmpty ( ) && vStatusList . size ( ) == 1 ) { final AppConfigValues appVal = ( AppConfigValues ) vStatusList . get ( 0 ) ; voucherStatus = appVal . getValue ( ) ; } else throw new ApplicationRuntimeException ( "APPROVEDVOUCHERSTATUS" + MISSINGMSG ) ; createVoucher . createVoucherFromPreApprovedVoucher ( vouhcerheaderid , voucherStatus ) ; } catch ( final ApplicationRuntimeException e ) { LOGGER . error ( e . getMessage ( ) ) ; throw new ApplicationRuntimeException ( e . getMessage ( ) ) ; } }
api to change the status of preapproved voucher
