only generate pdf for finalized invoices