[FIX] Smart Invoices migration - category mapping & deduplication

Resolved 💬 2 comments Opened Jan 25, 2026 by arwoxb24 Closed Feb 12, 2026

Problem / Проблема

  • Smart invoices: SOURCE=50, TARGET=48 (2 LOST!)
  • Category duplicates: 6 duplicates instead of 1
  • Mapping empty: smart_category_31 in SQLite is empty
  • Files not migrated

Solution / Решение

  1. Fix category mapping in migrateCategoriesBySmart()
  2. Add duplicate cleanup before migration
  3. Add STAGE_ID validation
  4. Implement file migration for smart_invoices

Files to change

  • src/Commands/MigrateCommand.php
  • src/Utils/EntityTransformer.php

Success criteria

  • SOURCE count = TARGET count (50 = 50)
  • 1 category on TARGET (not 6 duplicates)
  • Mapping saved in SQLite
  • STAGE_ID transforms correctly

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗