First check the Invoice distributions, whether all the lines are accounted or not.
If all the lines are accounted, then do the below step, otherwise never try this.
update ap_invoice_distributions_all
set MATCH_STATUS_FLAG ='A'
where invoice_id = :invoice_id
and MATCH_STATUS_FLAG is null