# Reconciliation

Source: `input.md` (unchanged). Outputs: `cleaned.csv`, `exceptions.csv`, this note. `build.py` is the script that produced them. IDs are kept as text (e.g. `001001`). Nothing was written to a live system or sent anywhere.

## Row counts
| Item | Count |
|---|---|
| Input rows | 14 |
| Rows in cleaned.csv (same order, none deleted or merged) | 14 |
| Difference | 0 |
| Rows included in scoped totals | 7 |
| Rows excluded from scoped totals | 7 (7 + 7 = 14) |
| Exception log entries | 8 (6 need a decision, 2 are informational) |

## Transformations applied (original fields never altered)
- `person_clean`: whitespace trimmed (row 1).
- `cost_center_clean`: uppercased (row 2).
- `date_iso`: set only for YYYY-MM-DD dates; blank for row 9.
- `amount_value`: grouping commas removed (row 1); parentheses read as a negative USD refund (row 11, -45.00). Blank for rows 13 and 14.
- `record_flag` / `conflict_flag`: duplicates and conflicts are flagged separately.

## Scoped totals (not a final accounting total)
Rule: first occurrence of a fully clear record (known-format date, currency and amount; no conflict). No currency conversion.

| Currency | Rows included | Total |
|---|---|---|
| USD | 1, 2, 4, 5, 11 | 1,250.00 + 85.50 + 19.99 + 65.00 - 45.00 = **1,375.49** |
| EUR | 3, 12 | 240.00 + 180.00 = **420.00** |

## Excluded rows
| Row | Reason |
|---|---|
| 6 | Exact duplicate of row 5 (second occurrence); retained and flagged |
| 7, 8 | Same expense_id 001006, amounts 120.00 vs 140.00 (conflict); both retained |
| 9 | Date `03/04/2026` has unknown locale (amount 49.00 USD is otherwise clear) |
| 10 | Currency missing (95.00); not assumed |
| 13 | Amount `TBC`; not treated as zero |
| 14 | Amount `1.234,50` has unknown locale |

## Unresolved decisions
1. Row 6: confirm it is a duplicate of row 5, and whether to remove it later.
2. Rows 7/8: which amount is correct, or are they separate expenses?
3. Row 9: is `03/04/2026` 3 April or 4 March?
4. Row 10: what currency is the 95.00?
5. Row 13: final invoice amount.
6. Row 14: number locale of `1.234,50`.
7. A combined figure needs an authorized conversion rule.
