Vendor paid directly wrong Invoice for customer

  • Posts: 134
  • Thank you received: 6
8 years 2 months ago #229283

Hi, Jerome.

I really don't want to imagine the whole bunch of topics you go through every day. So I will do my best to be clear enough.

After implementin the two patches and testing:
1. Extra Invoice issue - still not fixed by the patch
2. Wrong Invoice number - FIXED (by the last code change)


About the extra Invoice number patch what I did: I replaced the code bellow in Admin/HM/order.php

Jerome wrote: You have to modify HikaShop to not generate the invoice id when it already have an invoice number.
Replacing

if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id) && $order_type == 'sale') {
By
$already_invoice_number = ((!empty($order->order_invoice_number) && !empty($order->order_invoice_created)) || (!empty($order->old->order_invoice_number) && !empty($order->old->order_invoice_created)));
if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id) && $order_type == 'sale' && !$already_invoice_number) {
Then, you can see to copy the "order_invoice_number" and "order_invoice_created" from the HikaMarket subsale into the HikaShop sale (I don't have yet the code for HikaMarket ; I'll need more time for that).
Only in that case, you can stop HikaShop to generate invoice number for all "sales".




Test Result: Generating of invoice for suborder in HM still leads to generating of Invoice Number in HS.


HM Configuration:
- One Vendor
- Vendor paid directly


The process:
1. Customer buys directly from Vendor (he receives money, not we)
2. Order in HS and suborder in HM are generated
3. Changing the suborder status in HM to "shipped" leads to:
- Generating suborder Invoice in HM - That's OK
- Generating of main order Invoice - That is Not OK (as we don't sell here)

I hope it is well structured this time.

Regards!

Last edit: 8 years 2 months ago by filiar.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
8 years 2 months ago #229295

Hi,

I guess that you missed one part of my message :

Then, you can see to copy the "order_invoice_number" and "order_invoice_created" from the HikaMarket subsale into the HikaShop sale (I don't have yet the code for HikaMarket ; I'll need more time for that).

That message indicates what you have to do to fix the issue and I also add that I cannot provide any code for the moment.
Which also mean that I'm working on it and that I hope that it will be include in the next release.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: filiar

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

  • Posts: 134
  • Thank you received: 6
8 years 2 months ago #229338

Hi, Jerome.

I really missed that. I thought it was for the other issue.

Thank you again!

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

Moderators: Obsidev
Time to create page: 0.051 seconds
Powered by Kunena Forum