# Billing Overview

Understand the billing cycle in BlueRockTEL: from CDR collection and consumption rating through pre-production preview to final invoice production and delivery.

## The Billing Cycle

BlueRockTEL processes billing in a structured cycle. Understanding each step helps you know where you are at any point and what to check before moving forward.

1. **CDR collection**: usage records are ingested from your switch, SIP server, or carrier
2. **Consumption rating** (valorization), each CDR is matched against rate plans and assigned a cost
3. **Pre-production**: a preview of all invoices for validation before they become final
4. **Production**: final invoice generation with sequential numbering
5. **Delivery**: invoices are sent to clients by email and deposited in the client portal
6. **Collection**: payment via SEPA direct debit, bank transfer, or other methods

Each step builds on the previous one. The key checkpoint is **pre-production**: this is your opportunity to review everything before invoices become official.

## Pre-Production

Pre-production generates a complete set of preview invoices without committing them. Think of it as a dry run.

### Launching a pre-production

1. Navigate to **Main menu → Events**
2. Choose the appropriate **pre-production formula** from the dropdown
3. Click **"Schedule"**

Processing time depends on your billing volume, a few hundred folders may take a couple of minutes, while several thousand may take longer. Refresh the page periodically to check progress.

> **Tip:** When the pre-production completes, you receive an email with a **.csv file** attached. Open this file in a spreadsheet application for a quick sanity check, you can sort by amount, scan for zeros, or filter by client to catch obvious issues before reviewing individual invoices.

### Valorization options

When scheduling pre-production, you will see a valorization option:

- Select **"With valorization"** for the **first** pre-production of the billing cycle. This triggers the CDR rating engine to calculate consumption charges.
- For **subsequent** pre-production runs within the same cycle (e.g. after correcting a folder), you can reuse the existing valorization to save time.

### Reviewing pre-production invoices

1. Navigate to **Main menu → Documents → Pre-production**
2. Use the sortable columns and search field to find specific clients, invoice numbers, or sales representatives
3. Click an **invoice number** to open a full preview in a new window

Review the preview carefully. If anything needs correction, go back to the relevant folder, make the change, and re-run pre-production.

## Production

Once you are satisfied with the pre-production results, you are ready to produce final invoices.

Production works the same way as pre-production, schedule it from **Main menu → Events**: but the invoices generated are final: they receive official sequential numbers and cannot be modified after the fact.

By default, production triggers a **notification email** to each client. Invoices are also deposited in the **client portal** where clients can download them at any time.

## Batch-Based Billing

If you have configured billing batches (see [Folders & Configuration](/content/en/docs/folders-configuration/index.html)), you can run pre-production and production for each batch independently.

This is useful when:

- Different service types are billed at different times of the month
- One batch needs a longer validation cycle than another
- You want to stagger invoice delivery to spread out support inquiries

Select the target batch when scheduling a pre-production or production run from the Events page.

## Term Billing

BlueRockTEL supports both billing in advance (terme echoir) and billing in arrears (terme echu):

- **Terme echoir**: bill at the beginning of the service period (e.g. bill in January for January)
- **Terme echu**: bill at the end of the service period (e.g. bill in February for January)

Choose the appropriate option in the **Events dropdown** when scheduling a production run. No additional configuration is needed in the folders themselves.

## Billing Frequency

Each folder can have its own billing frequency:

- **Monthly**: most common for telecom and subscription services
- **Quarterly**: billed every three months
- **Annual**: billed once per year

Configure the frequency in the folder's edit page. Different folders for the same client can use different frequencies.

> **Important:** Do not mix different billing frequencies within a single folder. If a client has both monthly telecom services and a quarterly IT support contract, create separate folders for each. This prevents prorata calculation errors and keeps invoices clean.

## Next Steps

- **[Working with Invoices](/content/en/docs/billing-invoices/index.html)**: view, download, resend, and correct invoices after production
- **[Payments & Collections](/content/en/docs/billing-payments/index.html)**: track payments, generate SEPA files, and manage debt recovery
