# KPI EUR Conversion - User Guide

## What this does
This command fills EUR KPI values (for selected indicators) using FX rates from the internal `exchange_rates` table.

## Prerequisite
Make sure exchange rates are up to date (ECB import):

```bash
php artisan lnc:sync-ecb-exchange-rates
```

## Run (standard)

Fill missing EUR KPI fields (does not overwrite existing `*_EURO` values):

```bash
php artisan tko:convert-kpis-euro --progress
```

## Run for one company

```bash
php artisan tko:convert-kpis-euro --company=<company-uuid> --progress
```

## Rebuild mode (overwrite)

Rebuild mode removes all configured `*_EURO` KPI keys first, then recalculates them:

```bash
php artisan tko:convert-kpis-euro --rebuild --progress
```

If FX is missing for a KPI date (even after a short lookback), the EUR keys may remain empty for those rows.

## What you’ll see
At the end, the command prints a summary (rows scanned/updated, fields written, and skip counters).

Logs are also written to `storage/logs/job_logs.log`.

