Skip to main content

Vendor paid directly wrong Invoice for customer

10 years 9 months ago - 10 years 9 months ago #229283 by filiar
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

Code:
if(!empty($order->order_status) && empty($order->order_invoice_id) && empty($order->old->order_invoice_id) && $order_type == 'sale') {
By
Code:
$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: 10 years 9 months ago by filiar.

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

10 years 9 months ago #229295 by Jerome
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.
The following user(s) said Thank You: filiar

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

10 years 9 months ago #229338 by filiar
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.062 seconds
Powered by Kunena Forum