I like to set ‘Mark invoices as sent when PDF is generated’ to ‘yes’, so that the status goes from Draft to Sent when I generate a PDF for the first time.
I would like to combine this with setting ‘Generate the invoice number for draft invoices’ to ‘no’
What happens in this case it that first the PDF is generated without having an invoice number. And then the invoice is set to ‘Sent’ but the invoice number is never set. No invoice number appears in the PDF. In the GUI it shows only the ‘id’ of the invoice instead of the invoice number that normally gets generated as per the ‘identifier formatting’ settings (which in my case is year-id).
What I expect when generating a PDF in this case is that first the invoice is set to ‘Sent’, gets an invoice number (according to the specified pattern), and then the PDF is generated correctly.