public void validate() { String actionName = ""; if (parameters.get(ACTION_NAME) != null && parameters.get(ACTION_NAME)[0] != null) actionName = parameters.get(ACTION_NAME)[0]; if (!(actionName.equalsIgnoreCase(REJECT_ACTION) || actionName.equalsIgnoreCase(CANCEL_ACTION))) { if (voucherHeader.getVoucherDate() == null) addFieldError("voucherDate", getText("arf.payment.voucherdate.required")); if (!DateUtils.compareDates( voucherHeader.getVoucherDate(), advanceRequisition.getAdvanceRequisitionDate())) addFieldError( "advanceRequisitionDate", getText("arf.payment.voucherdate.lessthan.advancerequisitiondate")); if (!DateUtils.compareDates(new Date(), voucherHeader.getVoucherDate())) addFieldError( "advanceRequisitionDate", getText("arf.validate.payment.voucherdate.greaterthan.currentDate")); if (StringUtils.isBlank(commonBean.getBankId()) || commonBean.getBankId().equals("-1")) addFieldError("commonBean.bankId", getText("arf.bankbranch.required")); if (StringUtils.isBlank(commonBean.getAccountNumberId()) || commonBean.getAccountNumberId().equals("-1")) addFieldError("commonBean.accountNumberId", getText("arf.accountnumber.required")); if (StringUtils.isBlank(commonBean.getModeOfPayment())) addFieldError("commonBean.modeOfPayment", getText("arf.modeOfPayment.required")); } }
private void createMiscBill() { Miscbilldetail miscbilldetail = new Miscbilldetail(); // Since we are not creating any bill for advance payment, we are updating bill no, bill date // and bill amount from ARF miscbilldetail.setBillnumber(advanceRequisition.getAdvanceRequisitionNumber()); miscbilldetail.setBilldate(advanceRequisition.getAdvanceRequisitionDate()); miscbilldetail.setBillamount(advanceRequisition.getAdvanceRequisitionAmount()); miscbilldetail.setPassedamount(advanceRequisition.getAdvanceRequisitionAmount()); miscbilldetail.setPaidamount(advanceRequisition.getAdvanceRequisitionAmount()); miscbilldetail.setPaidto(advanceRequisition.getEgAdvanceReqMises().getPayto()); miscbilldetail.setPayVoucherHeader(paymentheader.getVoucherheader()); miscbilldetailService.persist(miscbilldetail); }