Well, though is not possible to have negative quantities in products, here is a detail of how I've created a negative invoice I was needed for my shop to be 'legal' in Spain. I detail these steps thinking about other users may need these invoices too, and this could help them.
Is not possible to have negative quantities in products, but it's possible to have negative prices in products or new invoice lines on back end invoices. Then, you can add a product named "Negative Invoice (incl. 18% IVA) number: " (for example). I must incude '(incl. 18% IVA)' because though tax quantity appears ok in the invoice, the tax description is not showing, and only 'VAT' (in my case IVA) appears, so no VAT type is showed in the invoice. Please Nicolas, maybe Is there any way to show the tax description modifyng some code? . When an order like this has to be created, you have to go to your back end and add a new order, select a client and complete all address data. Nicolas, other question, Could be possible that when a client is selected here we could 'select' an address of that client instead of complete all address data?. Then, you can add the new product you have created and add to the product description something like 'Refund of invoice number XXX' and complete the price quantities in negative values. In this way, you can have a negative invoice of the amount ot the invoce you want to refund. It's a little hard to understand, but here in Spain, I need to do this, and this way works for me.
You have now your negative invoice created, but you need to send to the client by mail (via attachment PDF plugin) or the client can print (or see) his invoice in the front end. Then you need to modify something for the VAT quantity to appears in the invoice (I think these are minor modifications and may not affect other Hikashop parts, please Nicolas, confirm this if you can).
1. For the invoice you send to the client via attachment PDF plugin, you have to edit plugins/hikashop/attachinvoice/attachinvoice/invoice.php, look for the line if($taxes < 0) and replace by if($taxes != 0) (by the end of the file).
2. For the invoice the client can print himself in the front end you have to go to Hikashop->Display->Views and edit the file show.php of the ‘order’ view of your front end active template. Look for the line if($taxes < 0) and replace by if($taxes != 0) (by the end of the file).
3. For the invoice you can print in your back end, you must go to Hikashop->Display->Views and edit the file invoice.php of the ‘order’ view of your back end (admin) active template. Look for the line if($taxes < 0) and replace by if($taxes != 0).
Well, now it works for me. I hope these steps will help someone in the same situation.
Thanks.