Automated Night Audit
Last updated
Last updated
When you set up miniCal, it will mark the current date as the date you register on the miniCal. In other words, if you set up miniCal and get registered on 12th Jan 2022 so in the booking calendar, the current date (selling date) will be 12th Jan 2022 forever. It will not change the current date (selling date) every day.
So for this miniCal has provided "Manual Night Audit" or "Automatic Night Audit"
For this particular scenario, miniCal has provided an excellent extension for night audits. Check the Automatic Night Audit extension at miniCal Marketplace. This extension will run a cron every day so that the current date on the calendar will change automatically, and you can manage everyday charges with this. If you use the Automatic Night Audit extension, then For miniCal hosted service this cron will run automatically. But for miniCal local (hosted on your local server), you need to set up cron.
In the above screenshot, you will find various options so let's have a look one by one.
Automatically Change Date To The Next Day After:- This will run a cron at your given time every day. You can change the time in the dropdown.
Apply Night Audit Charges To Checked-in Bookings Regardless Of Their Check-out Date:- This checkbox determines that the same charges will be applied for a booking as the day booking is created.
Apply Night Audit Charges To Checked-in Bookings Only (Not Reservations):- This will apply the charges on the booking that already checked-in.
The syntax is:
Where,
1: Minute (0-59)
2: Hours (0-23)
3: Day (0-31)
4: Month (0-12 [12 == December])
5: Day of the week(0-7 [7 or 0 == sunday])
/path/to/command – Script or command name to schedule
To run cron for night audit you need to run this command
0 * * * * wget path/cron/hourly > /dev/null 2>&1
As you see in the above command there are many things so let's check what is what
0:- Run at 0th minute (this cron will run at the 0th minute of an hour)
*:- This operator specifies all possible values for a field.
wget:- Wget is the non-interactive network downloader is used to download files from the server.
path/cron/hourly:- This is the domain path you have set for miniCal for example, "http://localhost/minical/public/cron/hourly" or "http://customdomin/cron/hourly".
/dev/nul l 2>&1:- To stop default output from crontab you need to append >/dev/null 2>&1.