📋 Upload Policy
- ALL records are inserted - nothing is skipped
- 🔴 EXACT DUPLICATE (same Order + Invoice in same month) → Flagged with is_duplicate=1
- 🟡 POTENTIAL DUPLICATE (same Order, different Invoice) → Flagged with is_duplicate=1
- 🔵 CROSS-MONTH DUPLICATE (same Order + Invoice in different month) → Flagged with is_duplicate=1
- ✅ CLEAN RECORD → is_duplicate=0
- Duplicate flags stored in is_duplicate and duplicate_reason columns
🔍 Duplicate Classification
- 🔴 EXACT DUPLICATE: Same ord_no + invoice_no in the SAME month → Flagged
- 🔵 CROSS-MONTH: Same ord_no + invoice_no in DIFFERENT month → Flagged
- 🟡 POTENTIAL: Same ord_no but different invoice_no → Flagged
- ✅ CLEAN: No duplicate detected → is_duplicate=0