TimeAttendanceRemoveEmptyTimeLines
This document was generated using Claude.ai
Overview
Removes attendance lines that have no time information. Cleans up time attendance documents by deleting any lines where both check-in (from time) and check-out (to time) are empty, helping maintain clean and meaningful attendance data.
When This Action Runs
Manual execution during attendance data cleanup. Typically used after data imports, bulk updates, or when preparing attendance documents for processing to remove incomplete or placeholder records.
How It Works
- Iterates backwards through lines - Processes from last to first to avoid index issues
- Checks time fields - Examines both from time and to time for each line
- Identifies empty lines - Finds lines where both times are null or empty
- Removes empty lines - Deletes lines with no time information
- Preserves valid lines - Keeps any line with at least one time value
Parameters
No Parameters - This action does not require any input parameters
Database Tables Affected
- TimeAttendanceLine - Removes records with empty time values from the collection
Important Warnings
⚠️ Permanent Deletion
- Deleted lines cannot be recovered
- Removed from document immediately
- No undo functionality available
⚠️ Date Information Lost
- Lines may have valid dates but empty times
- Date information is lost when line is deleted
- Consider if dates alone have value before running
⚠️ Employee Association Lost
- Deleted lines remove employee attendance records
- May affect attendance completeness reports
- Employee linkage cannot be restored
⚠️ Partial Records Preserved
- Lines with only from time OR to time are kept
- Does not remove incomplete attendance records
- Only removes completely empty time records
⚠️ Backward Iteration Logic
- Processes from end to beginning of list
- Prevents index shifting issues during deletion
- Ensures all lines are properly evaluated
⚠️ No Filtering Options
- Removes ALL lines with empty times
- No way to exclude specific employees
- No date range filtering available
⚠️ Common Scenarios
- Post-import cleanup of failed records
- Removing placeholder entries
- Cleaning up after bulk data operations
⚠️ Document State
- Works on current document state
- Changes not automatically saved
- Remember to save/commit after cleanup
⚠️ Related Data Impact
- May affect attendance calculations
- Could impact payroll if not recalculated
- Review dependent processes after cleanup
⚠️ Validation Considerations
- No validation of remaining data
- May leave document with no lines
- Check document validity after cleanup
Module: hr
Full Class Name: com.namasoft.modules.humanresource.utils.TimeAttendanceRemoveEmptyTimeLines