We want to create a hardware device which allows employees to punch in and out of work using a RFID reader which stores the information in ERPNext.
Most of our users are not salaried but get paid by the hour. Currently the information about work times is recorded outside of ERPNext using a RFID tracker that writes to a SQL database and has closed source software for the analytics.
We will create a hardware device which will read an RFID tag and allow our employees to punch in an out which will call our ERPNext API. All data will be stored in ERPNext. The project itself will be completely open source so people can DIY or they might eventually be able to buy pre-fabricated devices with RFID chips from us if there is enough interest in this thing.
The prototype hardware will consist of an Arduino Uno, a simple display and 3 buttons (come, go, info), a buzzer and a Mifare RFID reader (RC522).
Basic function description:
User presents RFID-tag to device and presses green “come” button. Device calls ERPNext API passing the RFID tag id. ERPNext logs come and returns employee name, employee number, start date, start time.
User works his shift
When user goes into break or leaves work he presses the red “go” button. Device calls ERPNext API passing the RFID tag ID. ERPNext logs go and returns employee name, employee number, start date, start time, work time.
If user wants to know how many hours he has worked this month he can press the grey “info” button. It will give him his hours today and his ours this month.
We will develop the hardware, create BOM and schematics on how to assemble this
The devices’ software will have to be written
Make changes to ERPNext employee DocType to store RFID Tag
Create or modify DocType to store information (see Questions below)
How will we store the actual time logs start / stop and how will we analyze it? There are timesheets which are more to track specific actions instead of overall work time. Also there is employee attendance but that tracks only the days which employees were present.
we have a similar topic, where we have extended the attendence module to not only cover present on a day or not, but actual working hours; also using a sign in/out. Maybe this would be the way to go in your case as well… (actual time tracking is done on timesheet, but not all time present is actually done in projects)
I did same for biomatrix
using attendance doctype add one child table for time logs in attendance doctype and add one custom field for total hours.
make three api’s
1)For In Punch:
when employee come and punch in then one entry add in time logs for IN.
2)For Out Punch:
when employee punch for out then update child table row that have last In punch and calculate OutTime-InTime=Total Hours
(Total Hours is update only when out punched)
3)For Total Hours Today&Month:
pass date today and make api which give today total hours from “total_hours” field and current month “total hours” sum of “total_hours” field from all document of current month.
Working first prototype with Arduino Uno, LCD Display, RFID RC5522 Kit and a few resistors and buttons. It currently waits for the start button (left) or stop button (right), then gives the user 3 seconds to present the RFID tag. If tag presented it reads it.
Next step will be API calls to ERPNext to get the employee info for the tag and to make start and stop calls. I will also add a buzzer to give an audible signal on button press and RFID tag read.
Hi All, here are a few notes from our testing and our design suggestion:
In the current design in ERPNext, here is how we should do it.
We have to setup “Salary Structure” to set per Hour rate of hourly employees.
When employee Punches IN first for the day, it will create “Timesheet” record with first line Item. It will put entry in “From Time”, leaving the “To Time” empty. When it punches “Go” then it will log the “To Time” of the first line. We will create multiple lines in one timesheet basing from how many times the employee time in and out.
For the Info Button, it will just calculate the tentative time for the day and the summation of all submitted timesheet in the current month.
at the end of the month or at the end of a salary cycle, accounting personnel can create Salary Slip basing from all the timesheet it created and calculate total amount from the Salary Structure set rate
As for the current “Attendance” doctype in ERPNext, it will only log if employee is present or not regardless of the time it consumed. So once a timesheet is submitted by end of shift, it will create an entry to Attendance tagging employee as present.
This is okay but there are concerns that we need to raise:
If the attendance time is track in Timesheet and the employee tracks an Activity within his attendance duration, then this is a duplicate.
Timesheet can be manipulated unless restricted through permission.
Attendance: Maybe we can have a new doctype called “Employee Checkin” (Employee, Location, Timestamp) that can log an employee at a location multiple times. At the end of the day we can run a scheduled script to mark in-time and out-time in Attendance (min and max)
Hourly Payroll: I like @creamdory’s idea to a weekly or monthly timesheet from checkins (with each shift in the line item) and link it to payroll. So before going to payroll there, someone can verify the total hours etc. This can automatically be created from the checkins.
I think the timesheets (what billable or non billable thing did they do specifically) and the attendance (when were thy present) are two things. I also think that it should maybe go the other way that we pay per attendance and a time sheet could create attendance.
Instead of employee checkin what about attendance log?
Currently option to link Payroll to timesheets already exists and if option to link Payroll to attendance is required then that can be built. I think that is a feature many need. Payroll can feed off attendance data to get the number of working days and use it as an input to Payroll. There could be complications of half-day etc, in this method that would need to be factored into the payroll design.
I agree on Attendance Log and taking min(in-time) and max(out-time) to create the final attendance record which would serve as an input to payroll. HR settings or setting at company level should dictate what is the input for payroll.
Timesheet creating attendance is not a good idea, because timesheets are sometimes entered just to bill customers & are not related to attendance. So having payroll based on timesheet or payroll based on attendance should be mutually exclusive in my opinion.