Commit df121f6b authored by didonet's avatar didonet

Correct the way grant expirations are calculated. The base date is the

registration start date, not anymore the grant start date.
parent e06f7cac
......@@ -178,6 +178,7 @@ public class Configuration {
}
//- mostrar perto da data final de bolsa
// a data de final de bolsa é calculada a partir da data de ingresso
public static Object findNearEndGrants() {
Integer phd, master, expiring;
......@@ -190,8 +191,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 ( (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()+"'))" +
" ((r.reg_kind = 'Mestrado' and ( (r.start_date + integer '"+master.toString()+"') - CURRENT_DATE) <= '"+expiring.toString()+"') OR" +
" (r.reg_kind = 'Doutorado' and ( (r.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+"'"*/
}
......
......@@ -106,6 +106,7 @@
<page:list id="pl_br_ufpr_c3sl_sapos_models_people_Staff" items="${endGrant}" emptyLabels="true" z="user-managed">
<table:table data="${endGrant}" id="l_br_ufpr_c3sl_sapos_models_scholar_StudentGrant" path="/studentgrants" create="false" z="user-managed">
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_name" property="registration.student.name" z="user-managed" navigation="true"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Registration" property="registration.startDate" z="user-managed" navigation="true"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_StudentGrant_startDate" property="startDate" z="m3Es7QJrs3CN06km6IRmGRPHdXQ="/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_StudentGrant_endDate" property="endDate" z="m3Es7QJrs3CN06km6IRmGRPHdXQ="/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_StudentGrant_grantKind" property="grantKind" z="user-managed" navigation="true"/>
......
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