With material costs (*Materialkosten*) you charge a client for material consumed in your warehouse, for example cartons, filling material or pallet wrap. The charge is based on the material consumption recorded for the client in the billing period.

## Before you start
- Your user needs the permissions for the order costs and the material costs in the cost settings – ask your administrator. The list of material cost templates requires the order cost permission as well.
- Your materials and packaging units are maintained in the [Warehouse settings](/warehouse-setup/warehouse-settings.md). They appear in the fields **Material** and **Unit**.
- A **Billing Category** is required, see [Service categories](/billing/service-categories.md).

## Step by step
1. Open **WMS › Settings › Cost settings › Material costs** (*WMS › Einstellungen › Kosteneinstellungen › Materialkosten*).
2. Click **Create template** (*Vorlage anlegen*).
3. Section **Base information** (*Basisdaten*): choose the **Client** (*Mandant*) and optionally a **Module** (*Modul*), enter a **Name** (*Name*) and optionally a **Custom Name** (*Individueller Name*) and a **Detailed description** (*Detailbeschreibung*). Choose the **Billing Category** (*Abrechnungs-Kategorie*) and the **Itemized statement on the invoice** (*Detail-Darstellung auf Rechnung*), tick **Active** (*Aktiv*).

![Screenshot: Section "Base information" of the material cost template form](/billing/images/material-costs-form-basics.png)

4. Section **Materials & Billing** (*Material & Abrechnung*): choose the **Material** (*Material*) and the **Unit** (*Einheit*), enter the **Costs** (*Kosten*), choose the **Billing Type** (*Abrechnungs-Typ*) and **Calculate from** (*Ermitteln aus*). For **History** also choose the **Action** (*Aktion*).

![Screenshot: Section "Materials & Billing" with Material, Unit, Costs and Action](/billing/images/material-costs-form-material.png)

5. Section **Filter** (*Filter*): optionally choose the **Order Status Filter** (*Auftragsstatus Filter*) and the **Packaging Filter** (*Verpackungs-Filter*).
6. Section **Conditions** (*Bedingungen*): optionally restrict the template with **Add a condition** (*Bedingung hinzufügen*), field **Bin location** (*Lagerplatz*) or **Item** (*Artikel*).
7. Optionally set a [validity period](/billing/validity-period.md) and click **Save** (*Speichern*).

![Screenshot: Sections "Filter" and "Conditions" with an order status filter and a condition on an article](/billing/images/material-costs-form-filters.png)

## Fields and options
| Field | Meaning | Required |
|---|---|---|
| **Client** (*Mandant*) | The client you are billing. | yes |
| **Module** (*Modul*) | Only consumption for orders from this sales channel. Empty = all modules. | no |
| **Name** (*Name*) | Name of the item on the statement. | yes |
| **Custom Name (Optional)** (*Individueller Name (Optional)*) | Text per line in the detailed breakdown, e.g. with `#Auftragsnummer#` (order number), `#Menge#` (quantity), `#Artikelnummer#` (SKU) or `#Avisierungsnummer#` (advance notice number). | no |
| **Detailed description** (*Detailbeschreibung*) | Appears line by line on the invoice. | no |
| **Billing Category** (*Abrechnungs-Kategorie*) | Groups the item on the statement. | yes |
| **Itemized statement on the invoice** (*Detail-Darstellung auf Rechnung*) | **No details** (*Keine Details*), **As subheadings** (*Als Unterpunkte*, default) or **Detailed breakdown in the appendix** (*Einzelnachweis auf Anlage*). | no |
| **Material** (*Material*) | The material this template is for. | yes |
| **Unit** (*Einheit*) | The packaging unit, shown in the description of the item. | yes |
| **Costs** (*Kosten*) | Price per billed unit. | yes |
| **Billing Type** (*Abrechnungs-Typ*) | **Flat rate** (*Pauschal*, default): 1 per stock movement or order. **Per unit** (*Pro Einheit*): booked quantity of the stock movement or number of packages of the order. | no |
| **Calculate from** (*Ermitteln aus*) | **History (warehouses_history)**: stock movements of the client with the selected action (e.g. carton booked out at the packing station). **Orders (orders + orders_products)** (*Aufträge (orders + orders_products)*): orders with a delivery date in the billing period. Default: History. | no |
| **Action** (*Aktion*) | Only stock movements booked with this action are charged. | for History |
| **Settlement period** (*Abrechungszeitraum*) | Daily, weekly, monthly or annual. Currently not used in the calculation. | no |
| **Order Status Filter (Optional)** (*Auftragsstatus Filter*) | Only consumption for orders with these statuses. | no |
| **Packaging Filter (Optional)** (*Verpackungs-Filter*) | Only consumption for orders packed with these packaging types. | no |
| **Conditions (Optional)** (*Bedingungen (Optional)*) | Field **Bin location** (*Lagerplatz*) or **Item** (*Artikel*), an operator (equal, not equal, contains, in list, not in list, greater/less …) and a **Value** (*Wert*). | no |
| **Active** (*Aktiv*) | Only active templates are charged. | – |

## How the charge is calculated
- When you open the [client statement](/billing/client-billing.md), X-Sitter takes the stock movements with the template's action (**History**) or the orders with a delivery date in the billing period (**Orders**).
- Module, status filter, packaging filter, conditions and the [validity period](/billing/validity-period.md) (per date) are checked.
- **Flat rate:** each matching movement or order is charged once. **Per unit:** the booked quantity of the movement or the number of packages of the order (with a packaging filter only the matching packages) is charged.
- When a picklist is deleted, the material consumption recorded for it is removed as well.

![Screenshot: Client statement with a material cost item and its detailed breakdown by date and order number](/billing/images/material-costs-statement.png)

## Good to know / Troubleshooting
| Message | Cause | Solution |
|---|---|---|
| The entry has been saved / updated / removed | The action was successful. | – |
| "No permission" when opening the list | Your user lacks the order cost permission. | Ask your administrator to grant it. |
| No material costs on the statement | No material consumption recorded for the client in the period, or a filter does not match. | Check the filters. If you are unsure whether material consumption is recorded in your warehouse, contact X-Sitter support. |

- Use **Duplicate** (*Duplizieren*) in the list to copy a template. The copy is inactive until you activate it.
