📍 Where can I find this module?
Main menu > Catalog
Introduction #
Kafinea's units of measurement go beyond a simple list of names: they allow you to manage unit categories, perform automatic conversions using ratios, enter custom attributes in document rows, and calculate attributes using mathematical formulas. The module is accessible via Catalog > Units of Measure.
1. Unit categories #
Each unit of measurement belongs to a category (accessible via Catalog > Unit Categories). Categories group together units that measure the same quantity.
Example: The "Weight" category includes the units kilogram, gram, and ton. The "Length" category includes meter, centimeter, and millimeter.
Automatic conversions are only possible between units in the same category.
Tip: Create your categories before creating your units of measurement.
2. Create a unit of measurement #
Click on Add a unit from the module list Catalog > Units of Measure.
Information to provide:
| Field | Description |
|---|---|
| Name | The full name of the unit (required), e.g., “kilogram,” “linear meter” |
| Category | The category to which the unit belongs (required) |
| Ratio | The conversion factor relative to the category's base unit (required). Can be a number or a mathematical expression using product fields |
| Base unit | Check this box if this unit is the benchmark for its category (ratio = 1). Only one base unit per category |
Important: Only one unit can be designated as the "Base Unit" per category. This is the reference unit for conversions.
The ratio: number or formula #
The ratio can be:
- A fixed number : for example
1000for the gram, since the kilogram is the base unit (1 kg = 1000 g) - A mathematical expression that uses product fields: for example, if the "Pallet" unit has a ratio that depends on the number of items per pallet specified in the record
Example: If the base unit is "Piece" (ratio = 1) and a "Box" unit has a ratio of
12, so 1 carton = 12 pieces. When entering a document, changing the unit from “Piece” to “Carton” will automatically convert the quantity.
3. The three components of a product #
Each record includes a " Units of Measure " section containing three fields:
| Field | Role |
|---|---|
| Base unit | The product's unit of measure (used by default for inventory) |
| Sales unit | The unit automatically suggested in sales documents (quotes, sales orders, customer invoices, delivery notes, credit memos) |
| Purchasing Unit | The unit automatically suggested in purchasing documents (purchase orders, supplier invoices, goods receipts, supplier credit memos) |
Note: When a product is added to a document, Kafinea automatically selects the sales or purchase unit based on the document type. The user can then change the unit to any other unit within the same category.
4. Custom attributes #
Attributes are additional fields associated with a unit of measure. They appear in the detail rows of documents and allow the user to enter dimensions or characteristics specific to each row.
To add an attribute, open record unit of measure record and use the associated list Unit Attributes.
Information to provide:
| Field | Description |
|---|---|
| Name | The labels displayed to the user, e.g., "Length," "Width" |
| Internal code | A technical identifier used in formulas and print templates |
| Default value | The value that is pre-filled when adding a row |
| Visible | If the attribute is displayed in the document rows |
| Editable | If the user can edit the value in the document rows |
Example: For the "Square Meter" unit, you can create two attributes: "Length" (code
longueur, editable) and "Width" (codelargeur(editable). The user will enter these dimensions in each line of the quote or invoice.
Note: An attribute that is not visible but is present can be used as a variable in calculated attribute formulas.
5. Calculated attributes #
Calculated attributes are values determined automatically by a mathematical formula. They can use the following as variables:
- Custom attributes of the unit (via their internal code)
- The fields in the record
To add a calculated attribute, open the record unit of measurement and use the associated list Calculated Attributes.
Information to provide:
| Field | Description |
|---|---|
| Name | The displayed text, e.g., "Total area" |
| Internal code | A technical identifier for print templates |
| Expression | The calculation formula, e.g.: longueur * largeur * nb_panneaux |
| Visible | If the result is displayed in the document rows |
| Show the expression | If the formula is displayed below the result (for informational purposes) |
| Change the quantity | If the result of the calculation is to replace the quantity in the row |
Example: For a "Square Meter" unit with the attributes "Length," "Width," and "Number of panels," a calculated attribute "Total Area" using the expression
longueur * largeur * nb_panneauxwill automatically calculate the area. If "Replace quantity" is checked, the quantity in the row will be replaced with the result of the calculation.
Tip: Expressions can reference fields in the record . For example, if the product has a field
poids_unitaire, you can create a calculated attribute called "Total Weight" using the expressionpoids_unitaire * nb_colis.
6. Use in documents #
When a product is added to a document line (quote, order, invoice, etc invoice):
- The unit is selected automatically based on the document type (sales or purchase unit)
- A unit selector allows you to switch between units within the same category
- The quantity is automatically converted when the unit is changed, using conversion factors
- Custom attributes appear below the unit selector
- Calculated attributes are automatically recalculated whenever a change is made
Note: Units of measurement and their attributes are also available in print templates via dedicated variables.
7. Implementation Examples #
Carpentry: sold by the square meter #
A lumberyard sells wood panels whose price is based on surface area. The operator must be able to enter the length, width, and number of panels directly into the quote, and the calculated surface area should be used as the quantity for the line item.
Configuration:
- Create the category Surface (via Catalog > Unit Categories)
- Build unity Square meter in this category, with the ratio
1and check Base unit - In the "Square Meter" record , add three attributes:
| Attribute | Internal code | Visible | Editable | Default value |
|---|---|---|---|---|
| Length | longueur |
✅ | ✅ | (empty) |
| Width | largeur |
✅ | ✅ | (empty) |
| Number of panels | nb_panneaux |
✅ | ✅ | 1 |
- Still on this record, add a calculated attribute:
| Field | Value |
|---|---|
| Name | Total area |
| Internal code | surface |
| Expression | longueur * largeur * nb_panneaux |
| Visible | ✅ |
| Change the quantity | ✅ |
- On the "Wood Panel" record , enter the three units using Square meter
Result in a quote:
- The operator adds "Wood panel" to the quote
- The Length, Width, and Number of Panels fields appear in the row
- He grabs
Longueur = 2.5,Largeur = 1.2,Nombre de panneaux = 3 - Kafinea automatically calculates: 2.5 × 1.2 × 3 = 9 m²
- The quantity in the row is replaced with 9, and the total amount = unit price × 9
Note: The "Replace quantity" option is key to this functionality. Without it, the calculation would be displayed for informational purposes only and would not change the amount on the line.
Store: multi-packs of water bottles #
A store buys cases of bottled water from its supplier, stocks them in packs of six, and sells them either by the pack or by the bottle. The system must automatically convert the quantities when the unit of measurement changes.
Configuration:
- Create the category Water Packaging (via Catalog > Unit Categories)
- Create the following units:
| Unit | Ratio | Base unit |
|---|---|---|
| Bottle | 1 |
✅ |
| Pack of 6 | 6 |
|
| Pallet (84 packs) | 504 |
- On the record "1.5L Mineral Water":
| Field | Value |
|---|---|
| Base unit | Bottle |
| Sales unit | Pack of 6 |
| Purchasing Unit | Palette |
Result upon purchase:
- In a supplier order, the operator adds "1.5L bottled water"
- Unity Pallet is selected automatically (purchase document)
- He ordered two pallets
Sale result:
- In a quote, the unit Pack of 6 is selected automatically (sales document)
- The operator picks up 10 packs
- If he changes the unit to Bottle using the selector, the quantity is automatically converted: 10 × 6 = 60 bottles
- If it then moves to Pallet, the quantity becomes: 60 / 504 ≈ 0.119 pallet
Tip: The unit selector in the document rows displays all units in the same category. The sales or purchase unit is only the default selection—the user can always choose a different unit.
Note: The ratio can also be a formula that uses a product field. For example, if the number of packs per pallet varies by product, create a field
packs_par_paletteon the record and use the ratiopacks_par_palette * 6for the Palette unit.
8. Frequently Asked Questions #
How do unit conversions work?
Conversions between units within the same category are automatic, thanks to conversion factors. For example, if “kilogram” (conversion factor 1) is the base unit and “gram” has a conversion factor of 1000, converting from 5 kg to grams will automatically display 5000 g.
Can I use different units for selling and buying the same product?
Yes. Each product has separate units for selling and buying. For example, you can buy in "Boxes of 12" and sell by the "Piece."
Can I edit a unit of measure that has already been used?
You can edit the name, conversion rate, and attributes. Changing the conversion rate will affect future conversions but not document lines that have already been saved.
Which units are created by default?
Kafinea comes with the most common units. You can add as many as you need and create your own categories based on your business.
Glossary #
| Term | Definition |
|---|---|
| Unit category | Grouping of units that measure the same quantity (e.g., weight, length) |
| Base unit | The reference unit for a category, with a ratio of 1 |
| Ratio | The conversion factor between a unit and the base unit of its category |
| Attribute | A custom field associated with a unit, which can be entered in the document rows |
| Calculated attribute | A value calculated automatically using a mathematical formula |