Commit 384ce8a8 authored by didonet's avatar didonet
Browse files

Updated the calculation of the grants near to expiration date

parent fa4294de
......@@ -106,8 +106,8 @@ public class Configuration {
return entityManager().createNativeQuery("select * from student_grant sg, registration r, person p" +
" where sg.registration = r.id and r.student = p.id and sg.end_date IS NULL and" +
" ((r.reg_kind = 'Mestrado' and (CURRENT_DATE - (sg.start_date + integer '"+master.toString()+"')) <= '"+expiring.toString()+"') OR" +
" (r.reg_kind = 'Doutorado' and (CURRENT_DATE - (sg.start_date + integer '"+phd.toString()+"')) <= '"+expiring.toString()+"'))" +
" ((r.reg_kind = 'Mestrado' and ( (sg.start_date + integer '"+master.toString()+"') - CURRENT_DATE) <= '"+expiring.toString()+"') OR" +
" (r.reg_kind = 'Doutorado' and ( (sg.start_date + integer '"+phd.toString()+"') - CURRENT_DATE) <= '"+expiring.toString()+"'))" +
" order by p.name", StudentGrant.class).getResultList();
/*"select * from student_grant sg where (CURRENT_DATE - (sg.start_date + integer '"+master+"')) <= '"+expiring+"'"*/
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment