Hi,
OK, I didn't thought filtering orders by state, but filtering by 'Confirmed' can solve me the problem.
I've added a column to display the invoice number next to the order number following the steps you gave me to modify the listing view and all is ok.
I've created a custom field named 'invoice_date' in the table 'orders' that appears in my back end, and now I have only one question: Can I add some code to the attach invoice plugin to set this field? I've thought that the plugin could set this field with the current date, ONLY if the field is empty, so I can change the state to created->confirmed later to resend the invoice to my client and don't lose the invoice date. if it's possible, Can you give me this code, please? If this could be possible I think that the invoice number procedure will be finally solved for me and legal in Spain.
Or maybe easier doing the same procedure (setting the field value) at the same time that the order is changed to 'Confirmed', and then this option is valid also if you don't have the attach plugin installed. Maybe a few lines of code.
Thanks for your help.
PD: Regarding to reset the invoice number, Is the auto field in a table that is used only for this purpose? If so, Can we truncate this table manually to get the number '1' each beginnig of a new year? Thanks.