Skip to content

Commit

Permalink
Attendance Controller Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharjeel007305 committed May 13, 2022
1 parent 839c6ca commit fa40186
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/controllers/attendance_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports.report = (req, res) => {
const aggr = [
{
$match: {
'TakenIn': {
'ActionDetails.ActionTakenOn': {
'$gte': new Date(req.body.StartDate),
'$lte': new Date(new Date(req.body.EndDate).setHours(23, 59, 59))
}
Expand Down Expand Up @@ -157,7 +157,12 @@ module.exports.report = (req, res) => {
},
'Leave': {
'$sum': {

$cond: [{ $eq: ['$TransactionType', "Leave"] }, 1, 0]

$cond: [{ $eq: ['$TransactionType', "Leave",'$ApprovedDetails', true
] }, 1, 0]

}
},
}
Expand Down

0 comments on commit fa40186

Please sign in to comment.