All was going perfectly fine. Punches from biometric device have been fetched to ERPnext using the biometric-attendance-sync-tool and all the Last Sync Checkin Fields for 9 Shift Types were getting updated automatically.
Recently the Last Sync Checkin Fields of 9 Shift Types suddenly stopped getting updated automatically. We updated those fields manually and marked the attendance. Now those Fields are not getting updated automatically.
Our ERPNext Instance is hosted on Local Server in LAN network with all biometric devices.
Our local_config.py script is as below.
GNU nano 6.2 local_config.py
ERPNext related configs
ERPNEXT_API_KEY = ‘834217b9c816cf1’
ERPNEXT_API_SECRET = ‘847b0ca2cd0d412’
ERPNEXT_URL = ‘http://127.0.0.1’
ERPNEXT_VERSION = 15
operational configs
PULL_FREQUENCY = 1 # in minutes
LOGS_DIRECTORY = ‘logs’ # logs of this script is stored in this directory
IMPORT_START_DATE = ‘20240201’ # format: ‘20190501’
Biometric device configs (all keys mandatory)
#- device_id - must be unique, strictly alphanumerical chars only. no space allowed.
#- ip - device IP Address
#- punch_direction - 'IN'/'OUT'/'AUTO'/None
#- clear_from_device_on_fetch: if set to true then attendance is deleted after fetch is successful.
#(Caution: this feature can lead to data loss if used carelessly.)
devices = [
{‘device_id’:‘Machine1’,‘ip’:‘192.168.2.52’, ‘punch_direction’: ‘AUTO’, ‘clear_from_device_on_fetch’: False},
{‘device_id’:‘Machine2’,‘ip’:‘192.168.2.59’, ‘punch_direction’: ‘AUTO’, ‘clear_from_device_on_fetch’: False},
{‘device_id’:‘Machine3’,‘ip’:‘192.168.2.61’, ‘punch_direction’: ‘AUTO’, ‘clear_from_device_on_fetch’: False},
{‘device_id’:‘Machine4’,‘ip’:‘192.168.2.202’, ‘punch_direction’: ‘AUTO’, ‘clear_from_device_on_fetch’: False}
]
Configs updating sync timestamp in the Shift Type DocType
please, read this thread to know why this is necessary V-12 [HR] [Auto Attendance] Purpose of last_sync_of_checkin in Shift Type - Frappe HR - Frappe Forum
shift_type_device_mapping = [
{‘shift_type_name’: [‘Management 8’,‘Management 8 OT’,‘Staff Shift 8’,‘Staff Shift 8 OT’,‘Staff Shift 8 OT Y’,‘Staff Shift 8.5’,‘Staff Shift 9’,‘Staff Shift 9 OT’,‘Worker Shift 8.5’], ‘related_device_id’: [‘Machine1’,‘Machine2’, ‘Machine3’,‘Machine4’]}
]
Ignore following exceptions thrown by ERPNext and continue importing punch logs.
Note: All other exceptions will halt the punch log import to erpnext.
1. No Employee found for the given employee User ID in the Biometric device.
2. Employee is inactive for the given employee User ID in the Biometric device.
3. Duplicate Employee Checkin found. (This exception can happen if you have cleared the logs/status.json of this script)
Use the corresponding number to ignore the above exceptions. (Default: Ignores all the listed exceptions)
allowed_exceptions = [1,2,3]