How to add a cost using a trigger
Copy the link to the article
Copied

The first step is to create a trigger. After following the standard method for creating a new trigger, you will then need to select "Order change" as the event, and "Add cost" as the action. In the condition, you should specify on what under which circumstance the trigger should be executed.

For information about how to create a trigger, see the related article.

Next, you should specify the cost item that will be created by the trigger, as well as the amount. For example, a cost item could be a bonus for employees, with the amount being £100.

Note

The amount is specified as a prime number. The currency is substituted for it automatically from the one that is selected by default.

The "Date" field is for the date when the cost item was created. If the field is empty, the date of the trigger execution will be used by default.

You can use expressions in the "Amount" and "Date" fields. For example:

  • to calculate a bonus for an employee (depending on the order amount), write the following expression: order.totalSumm * 0.01;
  • the date in the cost item can be bound to any date in the order using order.createdAt.

Objects available in the trigger filter can be used in the "Comment" field. Only text without html is allowed.

Result: in our example, when creating an order, a cost with the item "Bonuses for employees" in the amount of 100 euros will be automatically created and refers to the employee "Manager 2".

How to work with finances is described in detail in the related section.

Details on triggers are also available in the related section.

Thank you for your feedback.
Was this article helpful?
No
  • Рекомендации не помогли
  • Нет ответа на мой вопрос
  • Текст трудно понять
  • Не нравится описанный функционал
Yes
Previous article
Creating costs in the system
This article describes how to create a cost correctly and how to set up automatic costs (delivery costs and purchase price of a product).
#}