| @@ -173,9 +173,11 @@ open class MailReminderService( | |||||
| var isNaughty = false | var isNaughty = false | ||||
| val missingDates = mutableListOf<LocalDate>() | val missingDates = mutableListOf<LocalDate>() | ||||
| goodStaffsList.forEach { (key, value) -> | goodStaffsList.forEach { (key, value) -> | ||||
| if (!value.contains(it.id!!)) { | |||||
| isNaughty = true | |||||
| missingDates.add(key) | |||||
| if(it.joinDate == null || it.joinDate <= key) { | |||||
| if (!value.contains(it.id!!)) { | |||||
| isNaughty = true | |||||
| missingDates.add(key) | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| if (!isNaughty) return@forEach | if (!isNaughty) return@forEach | ||||
| @@ -324,15 +326,18 @@ open class MailReminderService( | |||||
| Pair(date, matchedStaffIds) | Pair(date, matchedStaffIds) | ||||
| }.sortedBy { it.first } | }.sortedBy { it.first } | ||||
| // creating the email content | // creating the email content | ||||
| // println(goodStaffsList) | |||||
| val intro = StringBuilder("${teamLead.name}, Staffs Missing Timesheet in the Table Below: ($firstDay-$today) \n") | val intro = StringBuilder("${teamLead.name}, Staffs Missing Timesheet in the Table Below: ($firstDay-$today) \n") | ||||
| val tableData = mutableListOf<TableRow>() | val tableData = mutableListOf<TableRow>() | ||||
| teamMembers.forEach { | teamMembers.forEach { | ||||
| var isNaughty = false | var isNaughty = false | ||||
| val missingDates = mutableListOf<LocalDate>() | val missingDates = mutableListOf<LocalDate>() | ||||
| goodStaffsList.forEach { (key, value) -> | goodStaffsList.forEach { (key, value) -> | ||||
| if (!value.contains(it.id!!)) { | |||||
| isNaughty = true | |||||
| missingDates.add(key) | |||||
| if(it.joinDate == null || it.joinDate <= key){ | |||||
| if (!value.contains(it.id!!)) { | |||||
| isNaughty = true | |||||
| missingDates.add(key) | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| if (!isNaughty) return@forEach | if (!isNaughty) return@forEach | ||||