With client billing (*Mandanten Abrechnungen*) you bill a client for your warehouse services in a period. X-Sitter automatically calculates all active cost templates of the client – storage space, articles, orders, material, unloading, fixed invoice items, shipping according to the matrix, VAS and pallets – groups them by service category and creates a statement of services (*Leistungsnachweis*) that is saved as a PDF.

![Screenshot: Page "Clients" under Client Billing with the list of active clients and the money button per row](/billing/images/client-billing-clients.png)

## Before you start
- Your user needs the permissions for **Client Billing** and for the billing page – ask your administrator.
- The client is an active client of yours, see [Clients](/company/clients.md).
- The right warehouse is selected in the warehouse drop-down at the top right. All cost templates belong to a warehouse.
- Cost templates for the client are created and **active**: [Storage space costs](/billing/storage-space-costs.md), [Article costs](/billing/article-costs.md), [Order costs](/billing/order-costs.md), [Material costs](/billing/material-costs.md), [Unloading costs](/billing/unloading-costs.md), [Pallet costs](/billing/pallet-costs.md), [Shipping cost matrix](/billing/shipping-cost-matrix.md), [Invoice items](/billing/invoice-items.md), plus [recorded VAS](/billing/record-vas.md). Without templates the statement stays empty.
- [Service categories](/billing/service-categories.md) for grouping.
- The **Billing number** (*Abrechnungs-Nummer*) is set in the [Warehouse settings](/warehouse-setup/warehouse-settings.md), tab **configurations** (*Konfigurationen*). Default: 10001.

## Step by step
1. Open **WMS › Storage › Client Billing** (*WMS › Lager › Mandanten Abrechnungen*). The page **Clients** (*Mandanten*) lists all active clients alphabetically (column **Company**, *Firma*).
2. Click the money button next to the client. The page **Storage costs billing** (*Lagerkosten Abrechnung*) opens.
3. At the top left, choose the period: **this month** (*dieser Monat*), **last month** (*letzter Monat*) or a custom range (*Eigener Bereich*). The default is the current month.
4. At the right, choose **Net** (*Netto*) or **Gross** (*Brutto*). This controls the total lines (see below).

![Screenshot: Storage costs billing page with the period selector (this month, last month, custom range) and the Net/Gross switch](/billing/images/client-billing-period.png)

5. The statement is loaded. The header shows **Invoice No.** (*Rechnung-Nr*), **Customer no.** (*Kunden-Nr*), **Date** (*Datum*) and **service period** (*Leistungszeitraum*), followed by the text "We will invoice you for our services as follows." Each service category has one total line with "See the detailed list in the appendix".

![Screenshot: Statement of services with header data and one total line per service category](/billing/images/client-billing-statement.png)

6. Optional: add lines with **New position** (*Neue Position*). Select a saved invoice item of the client (see [Invoice items](/billing/invoice-items.md)) or type your own name and press `Enter`. `Esc` cancels. You can change the quantity and price of a line and remove lines; the totals are recalculated.

![Screenshot: "New position" field opened with the list of saved invoice items and a manually typed line](/billing/images/client-billing-new-position.png)

7. Below follows the **Itemized list** (*Einzelaufstellung*) per category (name, quantity, unit €, total €) and, if applicable, the **Appendix: Detailed itemized list** (*Anhang: Detaillierte Einzelnachweise*) with date, order number / reference and quantity.

![Screenshot: Itemized list of the category "Handling" and the appendix with the detailed breakdown](/billing/images/client-billing-itemized.png)

8. Click **Preview** (*Vorschau*) to see the PDF in a window. The billing number is not increased.
9. Click **Save** (*Speichern*) to save the statement for good. You see "The invoice has been saved", and the billing number of the warehouse is increased by 1.

![Screenshot: PDF preview window of the statement of services](/billing/images/client-billing-preview.png)

## Fields and options
| Field | Meaning | Required |
|---|---|---|
| Period | Service period (start and end, both inclusive). | yes (default: current month) |
| **Net** / **Gross** (*Netto* / *Brutto*) | **Net**: "Subtotal (net)", "plus sales tax 19%", "Total". **Gross**: "incl. sales tax 19%", "Total amount". The tax rate is 19 %. | yes |
| **New position** (*Neue Position*) | Additional line with name, description, quantity and unit price (default quantity 1, price 1). | no |
| Itemized statement (from the template) | **No details**, **As subheadings** or **Detailed breakdown in the appendix** – set in each cost template; decides whether the item appears in the appendix. | – |

## How the statement is built
- The costs are calculated live when the page loads, in this order: storage space costs, article costs, order costs, material costs, unloading costs, fixed invoice items ("Insert on each invoice" = Yes), shipping costs (matrix), VAS, pallet costs.
- Items with the same name, unit price and itemized display are combined. Items without a category appear under **Other** (*Sonstiges*).
- Only **Save** increases the billing number, **Preview** does not. If you save again with the same invoice number, the existing statement is overwritten.
- Each cost template only counts within its [validity period](/billing/validity-period.md).

## Good to know / Troubleshooting
| Message | Cause | Solution |
|---|---|---|
| The client ID is missing! (*Die Client-Id fehlt!*) | The billing page was opened without selecting a client. | Open it via **Client Billing** and the money button. |
| The PDF could not be generated (*Das PDF konnte nicht erzeugt werden*) | Creating the PDF failed. | Start the preview again; check the lines. |
| Error during PDF generation (*Fehler bei der PDF-Erzeugung*) | The preview did not receive a valid PDF. | As above. |
| The statement is empty | No active template for the client in the selected warehouse, the period is outside the validity periods, or the wrong warehouse is selected. | Check the templates, **Active**, **Valid from / until** and the warehouse selection. |
| Storage space costs are missing | No daily occupancy snapshots for the period. | See [Storage space costs](/billing/storage-space-costs.md#the-daily-occupancy-snapshot). |

!!!
Tip: test new cost templates with a short period (e.g. one day) before you create the first real statement.
!!!
