Skip to main content

Business logic — basics

Business logic is where you tell a tariff (or tariff group) when it applies and how its amount is worked out. It's the brain behind the price. You'll find it on the Business logic card when you open a tariff or group, organised into tabs:

  • Conditions — decide whether the tariff applies.
  • Calculations — decide how much it is.
  • Dependencies — link it to other tariffs/groups (advanced).
  • VAT conditions — vary VAT (advanced).
  • Tariff metadata — tag the result for export (see Metadata).

To add a rule, open a tab and click Add.

Logic type

Every rule starts with a logic type:

  • Custom — you build the rule yourself by choosing a field type (the specific kind of condition or calculation) and filling in its fields. This is the usual choice.
  • Customer filter — a shortcut to limit the rule to a particular customer, customer financial, or debtor number. Use it for "this only applies to debtor X".

Conditions

A condition checks a value and decides if the tariff applies. The everyday pieces are:

  • Source fieldwhich value to look at, written as a path into the data (the same kind of field path you use in templates, e.g. the ship's GT or type).
  • Operatorhow to compare (equals, greater than, contains, and so on — the available operators depend on the condition kind).
  • Valuewhat to compare against.

The common condition kinds are:

  • Numeric — compare a number (e.g. GT greater than 10,000).
  • String — compare text (e.g. ship type equals "Tanker").
  • Boolean — a yes/no check (e.g. ISPS is true).
  • Date — compare a date.

If a tariff has several conditions, they all need to be satisfied (grouping them with or logic is an advanced topic).

Calculations

A calculation works out the amount. The two basic kinds are:

  • Price per unit — multiply the tariff's amount by a quantity taken from a source field (e.g. €0.93 per GT).
  • Bracket — the amount applies only between a min value and max value of a source field (a simple band; for full tables use a matrix).

A worked idea

"Harbour dues are €0.93 per GT, but only for sea-going vessels" becomes:

  1. a condition (string): source field = ship type, operator = equals, value = sea-going; and
  2. a calculation (price per unit): source field = GT, with the tariff's amount set to 0.93.

Once you're comfortable with these, see Business logic — advanced for evaluation sets, periods, schedules, dependencies, and more.