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.

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 …