Explore the usage of special value sets and see if you can use $FLEX$ inside the special value set to check the condition based on the other parameter and modify the where condition accordingly
you can create value set like this...
select 'All' from dual
select invoice_num from ap_invoices_all
now you can select All in LOV while submitting the program.
In Query you can write like below.