 LeafBook ## Formula

In order to save time and avoid human error, you can create formulas that will automatically calculate the cost of your services.

## Formula

### Basic

• Min: The minimum cost of the service (none if left blank)
• Max: The maximum cost of the service (none if left blank)
• Variable: The variable that will be used to calculate the cost
• Total DBH: The formula will only be applied once, using the sum of the DBH of each tree as its variable.
• Individual DBH: The formula will be applied for each tree, using the DBH as its variable.
• Total DSH: The formula will only be applied once, using the sum of the DSH of each tree as its variable.
• Individual DSH: The formula will be applied for each tree, using the DSH as its variable.
• Custom Entry: You will be given an extra entry where you can enter the variable for the entire service.
• Individual Custom Entry: You will be given an extra entry for each tree, where you can enter the variable.
• Entry Name: Name of the extra entry (only available if Custom Entry or Individual Custom Entry is selected)

### Rates

Every formula can have multiple rates, which in turn can have multiple ranges.
The app will select the appropriate rate based on the species of tree(s) selected, and will then find the range where your variable falls, and use that value to calculate the cost.

• Type:
• Multiplied: Cost = Variable × Value
• Fixed: Cost = Value)

• Range:
• From: Lower bound of the range, this is calculated automatically based on the upper bound
• To: The upper bound of the range
• Value: The value that will be used if the variable falls within this range

### Valid Tree Types

You can assign types of trees to your rate. This will be used when you have multiple rates, or when you want to avoid human error by disabling a type of service for certain types of trees.

## Examples

### TreeAzin (Total DBH & Tree Species Restriction)

For TreeAzin, we want to offer a better rate based on the total DBH.

To do this, we will create a single rate, with multiple ranges. Since this service is only relevant to ash trees, we will disable every tree type except for the ash.

### Stump Grinding (Individual DSH & Multiple Rates)

For stump grinding, we will charge \$8 per inch based on the DSH. However, we will be charging \$12 for spruce or for trees with a DSH of 37" or greater.

In order to achieve this, we will create two rates. The first one will be for everything besides spruce, and will have 2 ranges; the default one at \$8, and the one for larger trees at \$12. The second rate will only be for spruce, and will have a single range set to \$12.