There are multiple factors for an invoice to be flagged, unfortunately 'Flagged Invoices' will always be present to a degree. Check out this article for more information, Why Invoices flag?
1) In [Invoices] check the [Flagged Invoice lines] tab. This will show line by line why the Invoice has flagged.
For example, see below:
2) The product on the Invoice is not on the Purchase Order, or the lines didn't link automatically and were linked after the Invoice was created.
To rectify this case, click [Park], these below button are shown at the bottom right-hand side of the screen in the Invoice body.
3) Then Reopen the Invoice by clicking the [Reopen] button, and click [Complete].
The Invoice will then move to [Reconciled Invoices] stage, ready for Processing.