Added Invoice function to find and fix duplicates