Implementing Tasks Billing in Bitrix24 (part 1)

12.09.2017
How to implement billing on tasks with an hourly rate wage in Bitrix24?

If :

  • you render services to customers or perform works;
  • payment for your services/works depends on the amount of time spent by your employees;
  • the cost of services/works depends on the qualification level of employees and the level of difficulty of the solved tasks;

then, having read our article, you are going to learn how Bitrix24 can help you:

  • make automatic billing depending on the actual amount of time spent;
  • calculate planned and actual costs for the performance of works or rendering services which have different hourly costs and qualification level of specialists.

This is going to facilitate the processes of cost analysis and billing to your customers.

  1. Initial Data
  2. Setting the Data Structure
  3. Setting templates for the DocDesigner
  4. Run the time tracker
  5. Now we get the ready document

Let us consider two different types of hourly wage rate:

  • simple hourly wage rate, when the hourly rate is a fixed amount to be applied to all tasks;
  • normative hourly wage rate, when the employee receives his/her wage for completing the task according to his/her qualification level or the level of difficulty of the task.

Let us assume that we have four tasks under the project: Implementing Tasks Billing in Bitrix24.


And we, according to our classification of the hourly wage rate, would like to receive the document as follows below:


To make it more visually comprehensible, let us place two variants on one page.

If this is just what you need, than arm yourself with patience and read on…

1. Initial Data.

To implement the project, you are going to need Bitrix24, if you haven’t yet registered before, you may do it just now. Registration is absolutely free. If Bitrix24 is ready, let us install the application DocDesigner.

2. Setting the Data Structure.

After installing the DocDesigner application, you should do a very important thing: switch on the support of connection between the tasks and CRM.


Please open the DocDesigner, Settings. Open the "Documents", find the option "Use connection of tasks with CRM" and mark it. The saving will take place automatically. It is important to do that before starting work with tasks. All those tasks saved before switching this setting on will not be taken into account by the billing system.

If you are planning to use a simple hourly wage rate scheme, you may now turn to setting the templates. If you are planning to use a normative hourly wage rate system, this option is available under the tariff rates "Standard" and "Proffesional".

To implement a normative wage system, the User field box should be added to the tasks.


Please open the task in the editing mode, find the link "Add field", and press it. In the drop-down list, please select the type "Number".


Please give a name to the field box and press "Save".

And now this is a very important moment! You need to get to know the name of the field box to be created. As of the moment of writing the article, the only way to do so is to right click on the created field box and select "Inspect" in the drop-down menu.


The field code beginning with UF_AUTO_ and ending with figures is just what we need. Please memorize it and even better, write down somewhere :)

This method depends on the browser type, but in most cases, the steps are the same. Presented in the picture is the Google Chrome browser.

3. Setting templates for the DocDesigner.

Since the DocDesigner application supports two types of templates, HTML and DOCX, let us consider the creation of a template for these two formats. Just looking, for now :) To download the ready-built templates, you may follow the below links: HTML-template, DOCX-template.

HTML - template.



DOCX - template.

As you may see, both templates have a similar structure. The templates represent two types of an hourly wage rate: simple and normative.

Let us review each of these tables separately.

The upper table is the implementation of simple logic. For the cost of one hour, the following things may be used:

  • a constant to be defined by only a number in a formula. For instance, [CALC] 35*{Task.TotalTIME_ESTIMATE} [/CALC]
  • a user field from the deal. In this case, you will have the option to define the hourly cost within this project.
  • template parameter. 

We have decided to demonstrate this setting option.

In the event of a simple hourly wage rate, we are showing planned and actual hours per each task. Then we calculate the total number of hours and multiply it by the hourly cost. It is just as simple as that.

To make it more visually comprehensible, we decided to show the task description in a separate line and in a smaller font. To do so in a DOCX template is very easy, but for a HTML template, a couple of tricks are required.

Two attributes should be added to the table heading, class="crm_tasks_table" multi_row="1". Everything else is as usual. The task lines should be within the tag <tbody> </tbody>. In our example, we use two lines for showing one task; more of them may be used.

Now to the normative hourly wage rate. Here you will need the name of the user task field created at the settings stage.

The Identifier of Hour Cost field should filled in manually. In each line of the template table, we use the formula for calculation of planned and actually accrued amount. The actual amount is calculated according to the similar formula, you may make sure of that by setting the template within your own DocDesigner.

The formula is very simple: the number of planned (actual) hours to be multiplied by the hourly wage rate according to the task. Please do not forget to replace UF_AUTO_184785722711 with your own value.

Now all we have left to do is to calculate the final value of two sums: planned and actual ones. To do that, we add a new structure [TOTAL] [/TOTAL]. Please note that at the time of writing this article, only multiplying parameters are supported and {} in the HTML template and $$ in DOCX template are not used.

HTML - template: [TOTAL] Task.UF_AUTO_184785722711*Task.TIME_ESTIMATE [/TOTAL]
DOCX - template: $[TOTAL] Task.UF_AUTO_184785722711*Task.TIME_ESTIMATE [/TOTAL]$

4. Run the time tracker.

Create a task. Specify:

  • a group if necessary
  • switch on Time Recording and set the planned number of hours, if you need to evaluate the planned costs.
  • connect the task to the deal. This is mandatory.
  • set the hourly cost, if necessary and if the Bitrix24 tariff rate makes it possible to do so.


The actual costs are recorded by the standard Bitrix24 time management tool.

5. Now we get the ready document.

Find the deal we need in the list of CRM deals, launch the built-in DocDesigner, select a template and form a ready document.


Please note that, apart from tasks, you may use all available deal fields: the goods, and the company. For your own purposes, you may analyze the planned and actual costs, and then send any calculation option to the customer.

P.S. Tasks billing at Bitrix24. Version 2 – the automation enthusiasts are going to love it …

ОПУБЛИКОВАТЬ В СОЦ.СЕТЯХ