Function #60: Automatically generate invoices for unbilled timesheets at regular intervals

Function #60: Automatically generate invoices for unbilled timesheets at regular intervals



Hello everyone, and welcome back to our series!

In the Time Tracking section of Zoho Books, you can set up projects to track services provided to your clients and log timesheets to record the time spent completing them. These timesheets can be billed to your clients, helping you recognize revenue from the services. Today’s function aims to automate the billing process using a daily Scheduler that checks for any unbilled timesheets and generates invoices automatically. 

There's an option called "Associate Projects Hours" for Recurring Invoices. If you select this option, any unbilled timesheets up to the date of the child invoice will be included in that invoice. This is a way to automate the billing of timesheets at specific intervals. However, when creating Recurring Invoices, it's mandatory to select an item. If you prefer to skip this and only want to include timesheets in the invoices, then today's function is ideal for you.

Here's how it works:


Let’s take the example of Mr. John Hector, who provides corporate training services through both short workshops and long-term programs. He charges his clients based on the type of program, with billing done on a daily, weekly, or monthly basis. For instance, one of his clients is participating in his "Corporate Communication Skills" program, and John has arranged to bill them at the end of each month for the total hours of training provided.

To handle this in Zoho Books, John would normally create a time-based project, log the training hours using timesheets, and at the end of the month, manually review the unbilled hours to generate an invoice.

However, with today's scheduler, the billing process can be automated. By specifying key billing details—such as the Billing Date, Cycle, and Frequency—in the project’s custom fields, the scheduler will automatically generate invoices for any unbilled timesheets on the specified billing date. It will continue to raise invoices for each billing cycle, eliminating the need for John to manually consolidate timesheets and raise invoices. 



Prerequisites: 

1. Create a Connection named "zbooks" to successfully execute the scheduler. You can watch the GIF attached below to know how to create the connection. 



2. Create a Dropdown-type custom field called "Billing Cycle" for projects. This field should include the options: Daily, Weekly, and Monthly. The selected option will determine how often invoices are generated.



3. Create a Number-type custom field called "Billing Frequency" for projects. If you want to bill timesheets every 2 weeks, select "Weekly" in the "Billing Cycle" field and enter 2 here. If the "Billing Cycle" is set to "Daily," enter 1 in this field.



4. Create a Date-type custom field called "Billing Date" for projects. This field allows you to select the date on which invoices should be generated for each billing frequency. 



5. Create a Checkbox-type custom field called "Automate Billing?" for projects. The scheduler will run only for those projects where the field is ticked. If a project has ended and you no longer want to generate invoices, simply edit the project and uncheck the box.

Note: If "Automate Billing?" is ticked without specifying the billing cycle, frequency, or date, the system will automatically generate invoices daily for the projects.



Setting up the Scheduler:

Navigate to Settings -> Automation -> Schedules -> +New Schedule -> Set up the schedule as shown in the screenshot -> Add the code from this GitHub link -> Save. 



Give this scheduler a try and let us know what you think! If you need assistance with implementation, feel free to contact our Support team at support[at]zohobooks[dot]com. We are happy to help.

Regards,
Shireen Farhana
Zoho Books