Skip to content

Commit

Permalink
fix bug etpt 0,5 and action 99 100% extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJimmyChevallier committed Feb 18, 2025
1 parent 2163b5c commit df368ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/src/utils/extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,12 @@ export const computeExtractDdg = async (
nbOfDays(human.dateStart, dateStop)) /
nbOfDays(dateStart, dateStop) -
(refObj[key] || 0);
} else
} else {
reelEtp =
sumBy(reelEtpObject, "etp") /
sumBy(reelEtpObject, "countNbOfDays") -
(refObj[key] || 0);
}
}

if (isCa()) {
Expand Down Expand Up @@ -541,7 +542,7 @@ export const computeExtractDdg = async (
? null
: setTimeToMidDay(human.dateEnd).toISOString().split("T")[0],
["ETPT sur la période absentéisme non déduit (hors action 99)"]:
reelEtp,
reelEtp < 0 ? 0 : reelEtp,
["Temps ventilés sur la période (hors action 99)"]: totalEtpt,
["Ecart → ventilations manquantes dans A-JUST"]:
reelEtp - totalEtpt > 0.0001 ? reelEtp - totalEtpt : "-",
Expand Down Expand Up @@ -935,7 +936,8 @@ export const computeExtract = async (
human.dateEnd === null
? null
: setTimeToMidDay(human.dateEnd).toISOString().split("T")[0],
["ETPT sur la période (absentéisme et action 99 déduits)"]: reelEtp,
["ETPT sur la période (absentéisme et action 99 déduits)"]:
reelEtp < 0 ? 0 : reelEtp,
["Temps ventilés sur la période (absentéisme et action 99 déduits)"]:
totalEtpt,
...refObj,
Expand Down

0 comments on commit df368ef

Please sign in to comment.