Have different invoice and order numbers

  • Posts: 105
  • Thank you received: 0
11 years 1 month ago #133442

OK. I went to that file and searched for the code you gave me, (plugins/hikashop/attachinvoice/attachinvoice/invoice.php of the plugin), but...

1. I could not find the code:

<?php if(!isset($order->order_invoice_number)) $order->order_invoice_number = $order->order_number; ?>
.

2. I could only find the code:
<div class="invoicetitle"><?php echo JText::_('INVOICE').' '.$order->order_invoice_number; ?></div>

3. I therefore substituted that code which I could find in the file with the new code you gave me, but all that did was change the Text Invoice Number to the Order number, but failed to insert any numbers at all - see attached.

The Order Number should read: TEST-00045-11/2013
The Invoice Number should read: B3Q7

4. See attached screenshot of the order page itself.

5. The other thing that is happening is the Shipping Invoice is not being produced any more, when I set the order on another TEST order to shipped.

I am beginning to wonder if Hikashop update loaded properly or if I did something wrong somewhere. So I reuploaded the update but the same thing is still happening.

Any ideas?

Kind regards



Kind regards.

Attachments:

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

  • Posts: 105
  • Thank you received: 0
11 years 1 month ago #133449

Hello,

OK. I did the following to change the file name as you suggested in the attachinvoice.php file:

Regarding the file name, you can change the line:
$invoiceFile = JText::_('INVOICE').'-'.$orderid.'_'.time().'.pdf';

to:
$invoiceFile = JText::_('INVOICE').'-'.$data->data->order_invoice_id.'_'.time().'.pdf';

1. This did not change the file name of the invoice pdf file that was downloaded to invoice_49.pdf. That stayed as Invoice_51, which is from the Order Number: TEST-00051-11/2013. Incidentally, the Invoice only downloads, it does not appear in the pop-up window on screen - that pop-up window appears, but remains blank white.

2. What changing the InvoiceFile text did do though was add the text "Invoice 49" to the Shipping Invoice - see attached.

I checked if it had added anything to the Invoice itself once it had downloaded, but no it had not.

Any further ideas? I am sure you are just as frustrated as I am with this, but I do very much appreciate your help. I need to sort this out before I train up the person using the system.

Kind regards

Attachments:

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 1 month ago #133583

Hi,

My copy/paste was a bit fast. Of course, you need to change the names of the variables as they are not the same between the backend invoice and the pdf plugin.
It should be:

<div class="invoicetitle"><?php 
if(!empty($order->order_invoice_number)) {
echo JText::_('INVOICE').': '.$order->order_invoice_number;
}
echo JText::_('ORDER_NUMBER').': '.@$order->order_number;
?></div>


The modification I provided for the invoice name was only for the invoice that is included in the email notifications.
For the invoices that you print in the backend, you will have to change the line:
if(count($orderIds) == 1) $fileName.= '_'.reset($orderIds);
to:
if(count($orderIds) == 1) $fileName.= '_'.$order->order_invoice_id;


Please remember that what we're doing here is waaayyy outside standard support. That's clearly code customization which is not included in the standard support of HikaShop commercial editions.

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

  • Posts: 105
  • Thank you received: 0
11 years 1 month ago #133600

Thank you so much. I am very grateful - I will try that and if that doesn't work, I will adapt. The only reason I got on to this was because someone else was asking the same question a while back on your forum, so I tried to do what you had suggested to them, but it didn't work.

The company is based in Zimbabwe, and paypal, banks, etc., do not pay in to Zimbabwean bank accounts, so it has to be done by bank transfer on an individual case by case basis not through paypal, etc.. Also there are so many different variables for each order, as we need export certificates, etc., and couriers like UPS are not able to supply the service online here that the rest of the world has. Therefore, we have had to adapt so that we can send out invoices after adding the extra costs, and not streamline the process so it is all done in one step online.

We thank you for your understanding and will try to keep to a minimum future requests for support.

Kind regards

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

Time to create page: 0.057 seconds
Powered by Kunena Forum