I have a problem with a search script. On a list of all invoices (my companies'), I want to filter all invoices which match the following parameters:
- on a specific search date ("deadline date"), I want to know, which invoices are:
- already printed (line 5/6)
- creation date of the invoice is younger than the deadline date (line 8/9)
- invoice_printed date is younger/equal than the deadline date (line 11/12)
- invoice_paid/closed date is older than the deadline date OR is EMPTY (line 14-18)
- omit all invoices which are marked as "unpaid"
Somehow, this script does not give me the number of invoices (and their total open bill amount), what am I doing wrong?
THANK you for some help!
Best regards, Edward