Skip to content

Commit

Permalink
changed counting methods in export onglet 2 : WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgirard committed Mar 15, 2017
1 parent 067c5cb commit a558a11
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions server/export/hceres.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ const SHEETS = [
(
gradeStatus === 'appuiadministratif' ||
gradeStatus === 'appuitechnique'
) &&
position && position.jobType === 'CDI'
)
//&&
//position && position.jobType === 'CDI'
) {
sheetData.B7++;
}
Expand Down Expand Up @@ -251,8 +252,9 @@ const SHEETS = [
(
gradeStatus === 'appuiadministratif' ||
gradeStatus === 'appuitechnique'
) &&
position && position.jobType === 'CDI'
)
//&&
//position && position.jobType === 'CDI'
) {
sheetData.F7++;
}
Expand Down Expand Up @@ -283,16 +285,22 @@ const SHEETS = [
gradeStatus === 'appuiadministratif' ||
gradeStatus === 'appuitechnique'
) &&
position && position.jobType === 'CDD'
(position && (!position.jobType || position.jobType === 'CDD'))
) {
sheetData.H11++;

}

// Stagiaires avec une date de présence dans l'unité comprise entre 01/01/12 et 30/06/17
if (
/stage/i.test(grade) &&
overlap(relevantGrade, {startDate: '2012-01-01', endDate: '2017-06-30'})
person.grades.some(grade =>
// grade de stagiaire ?
/stage/i.test(grade) &&
// sur la période HCERES ?
overlap(grade, {startDate: '2012-01-01', endDate: '2017-06-30'})
)
) {
console.log(` found a stagiaire ${person.name}`);
sheetData.H19++;
}
});
Expand Down Expand Up @@ -704,8 +712,11 @@ const SHEETS = [
);
})
.map(activity => {
const person = activity.people.find(p => p.role === 'visiting').people;

let person = activity.people.find(p => p.role === 'visiting')
if (person)
person = person.people;
else
return undefined
const info = {
name: person.name,
firstName: person.firstName,
Expand All @@ -717,7 +728,8 @@ const SHEETS = [
};

return info;
});
})
.filter(i => i);
return callback(null, postDocs.concat(invited));
});
}
Expand Down

0 comments on commit a558a11

Please sign in to comment.