Need negative quantities in back end new orders

  • Posts: 107
  • Thank you received: 3
11 years 9 months ago #59044

Hi. Is it possible to insert negative quantities in back end new orders? In Spain, when an order is cancelled, the shop creates a reverse order to the client with the same products as the original order, but with negative quantities. On the other hand, a client could buy some products and could change one of them (some days later), then I could make a new order in back end, with a negative quantity in the product he is changing and a positive one in the new product he is buying me.

Is it possible or is there any way to do this without any modification?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
11 years 9 months ago #59093

Hi,

That's not possible. You can't have negative quantities of products.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
11 years 9 months ago #59128

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? :unsure: . 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.

Last edit: 11 years 9 months ago by lanzanet.

Please Log in or Create an account to join the conversation.

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
11 years 9 months ago #59220

Please Nicolas, maybe Is there any way to show the tax description modifyng some code?

That can be added with a translation override:
www.hikashop.com/en/download/languages.html#modify

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?

That's something that we've been working on. It will be in next version.

1. & 2. & 3. We'll add these minor changes for next version. It won't cause any issue and could help in cases similar to you so I think that they are good modifications to have by default.

The following user(s) said Thank You: lanzanet

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum