@Transactional public long createPreApprovedVoucherFromBillForPJV(final int billId,final List<PreApprovedVoucher> voucherdetailList,final List<PreApprovedVoucher> subLedgerList) throws ApplicationRuntimeException {
  String voucherStatus=null;
  long vh=-1;
  try {
    final List vStatusList=appConfigValuesService.getConfigValuesByModuleAndKey("EGF","PREAPPROVEDVOUCHERSTATUS");
    if (!vStatusList.isEmpty() && vStatusList.size() == 1) {
      final AppConfigValues appVal=(AppConfigValues)vStatusList.get(0);
      voucherStatus=appVal.getValue();
    }
 else     throw new ApplicationRuntimeException("PREAPPROVEDVOUCHERSTATUS" + MISSINGMSG);
    vh=createVoucher.createVoucherFromBillForPJV(billId,voucherStatus,voucherdetailList,subLedgerList);
  }
 catch (  final Exception e) {
    LOGGER.error(e.getMessage());
    throw new ApplicationRuntimeException(e.getMessage());
  }
  return vh;
}

@ Transactional public long createPreApprovedVoucherFromBillForPJV ( final int billId , final List < PreApprovedVoucher > voucherdetailList , final List < PreApprovedVoucher > subLedgerList ) throws ApplicationRuntimeException { String voucherStatus = null ; long vh = - 1 ; try { final List vStatusList = appConfigValuesService . getConfigValuesByModuleAndKey ( "EGF" , "PREAPPROVEDVOUCHERSTATUS" ) ; if ( ! vStatusList . isEmpty ( ) && vStatusList . size ( ) == 1 ) { final AppConfigValues appVal = ( AppConfigValues ) vStatusList . get ( 0 ) ; voucherStatus = appVal . getValue ( ) ; } else throw new ApplicationRuntimeException ( "PREAPPROVEDVOUCHERSTATUS" + MISSINGMSG ) ; vh = createVoucher . createVoucherFromBillForPJV ( billId , voucherStatus , voucherdetailList , subLedgerList ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) ) ; throw new ApplicationRuntimeException ( e . getMessage ( ) ) ; } return vh ; }
api to create voucher in pre approved status
