Aaxsys Notes
  More articles

Nov 20 2013

The Aaxsys Rates Engine

(How client rates are calculated in Aaxsys)

Introduction. Client billing ranges from a simple rental charge to complex cases that require prorating, special charges, discounts and taxes on multiple levels. Using an automated system to handle all billing, including the most complex situations involves a trade-off. The more complex and individual the billing, the more time is spent in creating rules specific to that billing. At the end, in a really complicated situation, it may just be faster simply to manually enter the charges one by one. Why to spend hours trying to figure out how to program the software to give out the correct invoice, when it could be done manually in less than 5 minutes?

How much automation should be used? Aaxsys employs a "rates engine" that tries to find a balance between full programmability and simple manual entry. The so-called boilerplate approach gives a list of premade solutions that require no or little adjustments to fit the individual billing at hand. The approach adopted by Aaxsys is more like the "Swiss Army Knife" of client billing, providing a set of tools that can be selected to tackle the problem with the combined effect.

Rate details. Property rate details are "lines" (records) that each provide a step in the calculation of a client's invoice. Each line has a number of freely selectable features that together determine how the line participates in the calculation. In addition to calculating client invoices, property rate details are used for calculating revenue distributions, in other words dividing up client payments into amounts paid into various vendors.

In the above image, most lines are of the type "RE" (revenue), because for this particular property, only one line of type "IX" (one-time charge) is used to invoicing the client. In its simplest form, no IN ("invoice") lines are needed at all. The client record itself includes fields for the rent, a fixed fee and a fixed tax, and in some cases, this is already sufficient. However, the user may add as many invoicing instructions as needed, or also move the rent, fixed fee and tax to be done entirely under rate detail lines, whenever desired.

Each rate detail line is a Swiss Army Knife. The following picture only shows a part of the many features available in the toolbox that is a rate detail record:

Some of the available tools are filters such as "Valid from" and "Valid until". Once activated, the particular rate line only applies to the dates that fall within the valid period. Aaxsys determines the interval that represents the intersection of the billing period and the valid rate period, and uses prorating (if necessary) to calculate the proper charge for this intersection.

In addition to the filters, each rate line has instructions that tell how this line operates on previous lines generated so far. The rate engine goes through each line, one by one, and decides whether the line is applicable to the billing. In case the line is to be applied, the engine goes through each instruction, one by one, and applies it either by generating a new line for the invoice or modifying an earlier calculation.

Rate Line 1

Rate Line 2

Rate Line 3

(etc)
For example, Aaxsys keeps a record of rent accummulated so far. An instruction such as Add amount to rent with a separate line takes care that the amount calculated by applying all the instructions in the current line will be included in the final amount considered "the rent". (For example, tax ("TX") lines always automatically apply to rent, so it is important to tell Aaxsys what should be included in the rent.) While TX records automatically apply to (and only to) rent, the user can tell Aaxsys to apply any IN record to apply to the rent calculated so far in the process. This feature is called "Apply to", and having "$RENT" in that field precisely achieves this end. But how does Aaxsys decide in which order the lines are to be processed?

The order of calculation. Aaxsys does not follow the "physical" order (as seen in the first image) of the rate lines, but orders them using the following three principles:
  • the lines are ordered with respect to their type, so TX lines always come last. This rule has one exception:
  • revenue lines that are applied to the "$REST" come last.
  • After having been ordered by type, the lines are ordered by their label.
Aaxsys Notes, Nov 20, 2013