// }
@Override
public String updateApproval(Approval approval) {
List<Approvalchain> chainList = appcfl.findAll();
Approvalchain chain = null;
for (Approvalchain each : chainList) {
if (approval.getApplicationIdapplication().equals(each.getApplicationid())) {
chain = each;
}
}
daoApproval.edit(approval);
String nextAcc = "";
if (chain != null) {
if (chain.getSchooladmincomplete() != 1) {
chain.setSchooladmincomplete(1);
nextAcc = chain.getHod().getUsername();
} else if (chain.getHodcomplete() != 1) {
chain.setHodcomplete(1);
nextAcc = chain.getFinance().getUsername();
} else if (chain.getFinancecomplete() != 1) {
chain.setFinancecomplete(1);
nextAcc = chain.getPvc().getUsername();
} else if (chain.getPvccomplete() != 1) {
chain.setPvccomplete(1);
nextAcc = chain.getFinalfinance().getUsername();
} else if (chain.getFinalcomplete() != 1) {
chain.setFinalcomplete(1);
nextAcc = chain.getApplicationid().getAccountIdaccount().getUsername();
}
}
return nextAcc;