- Posts: 104
- Thank you received: 0
Have different invoice and order numbers
1) I want to have an order number and a different invoice number.
I read the documentation and in hikashop> Configuration> Main> Order I set order number as {automatic_code} and invoice number as {date format="Y"}{id size="5"} but when I see the pre-print invoice the invoice number is the same as order number.
How can I have different numbers?
2) I want to print the order number in the invoice, just above the invoice number, between the date and the invoice number. How?
Please Log in or Create an account to join the conversation.
What do you call "pre-print invoice" ?
The invoice id/number are generated when the order is confirmed for the first time. If the order never been confirmed, it does not have an invoice number so it can't display it: It will display the order number instead.
You can override the "invoice" views (in the front-end and in the back-end) in order to print the order number AND the invoice number.
HikaShop display the invoice number if found, otherwise it display the order number.
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.
Please Log in or Create an account to join the conversation.
Can you tell me exactly how to add the order number?
I konw where is it the file but I don't know which should be the code.
Please Log in or Create an account to join the conversation.
You have to change the way the "invoice number" is displayed.
So replace this block:
By something else like:
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.
Please Log in or Create an account to join the conversation.
Thanks
Please Log in or Create an account to join the conversation.
I, too, want to show both order number and invoice number on the invoice to avoid confusion in emails being sent out.
I have tried to do this in the file invoice in the back end, but it doesn't have the coding you mentioned in this topic that I need to replace in order to include the order number and the invoice number.
I could not find an invoice file for the front end.
Please can you advise exactly which files I need to change both at the back end and the front end and I will try again.
Thanks
Please Log in or Create an account to join the conversation.
I have now found an invoice file for the front end, but still don't know where to change the coding. coding is as follows:
ord
Please Log in or Create an account to join the conversation.
HikaShop 1.6.0 does not have such "order number / invoice number" feature.
Please update first.
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
So you have to remove your override of the view which come from HikaShop 1.6.0
Restoring the original content, you will have same code that I wrote previously. And you will be able to make the modification.
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.
Please Log in or Create an account to join the conversation.
Please advise,
Many thanks.
Please Log in or Create an account to join the conversation.
I am very confused. Looking up the files via the back end, the order/invoice.php file for bluestork (backend template I am using is still Hikashop v 1.6, but the Hathor order/invoice.php is v2.2.2.
Looking at the order/show.php file for the template I am using is Hikashop v 1.6, but for the other front end templates it is 2.2.2
Why has updating Hikashop not updated the two templates I am using but has updated the files in the templates I am not using? This is weird. I presume this applies to other files in my Hikashop system.
It may be because the joomla template I am using is for Joomla 1.6, so I am updating that to 2.5.16 and will check thereafter. This is taking a while as I am in Africa on rather slow broadband. Will come back to you when I have done this and advise if Hikashop files updated when I re-install the Hikashop update after I have updated the template.
Many thanks for your patience so far.
Please Log in or Create an account to join the conversation.
Any thoughts, please let me know.
Thanks,
Please Log in or Create an account to join the conversation.
Please advise.
Please also advise - if you can - why the backend Bluestork template is still not updating Hikashop files.
Coding in order/show.php:
Please Log in or Create an account to join the conversation.
However, I must still be doing something wrong.
In order/invoice.php I find this text:
if(!empty($this->element->order_invoice_number)) {
echo JText::_('INVOICE').': '.$this->element->order_invoice_number;
} else {
echo JText::_('INVOICE').': '.@$this->element->order_number;
}
However, if I do what you suggested and change the above to the following, it still only takes the order number as the invoice number and doesn't show both. Just INVOICE followed by the order number.
Please advise what else I should be doing.
if(!empty($this->element->order_invoice_number)) {
echo JText::_('INVOICE').': '.$this->element->order_invoice_number;
} else {
echo JText::_('ORDER_NUMBER').': '.@$this->element->order_number;
}
Or: Please advise what I am doing wrong.
Many thanks,
Please Log in or Create an account to join the conversation.
If you want both, you should use that code:
Regarding the view file edition, once you edited a file once and saved it, a copy of your modified file is saved in your template's override folder. When HikaShop updates, all the core files of HikaShop are replaced, but not template overrides. So it's nice because you keep your modifications when you update. But if you want to remove them to use the new version of a file, simply click on the "remove customization" icon of the Display>views listing and it will basically delete the override file from the template and use the core version of the file. Thus no need to change your template.
Please Log in or Create an account to join the conversation.
First of all, sorry about pasting the whole coded file in early submission.
I have tried again with the coding you gave me, but still get the same thing the title invoice with the order number following it.
I changed the order/show.php file for front end template. I couldn't find the exact text to change in the order/invoice.php file., but I changed something very similar. It didn't work so I changed it back. I still only got the wording Invoice followed by the Order number on the actual invoice, so I have changed it back again. See attached Invoice_49 pdf. It only shows Invoice followed by the order number itself. It saves itself as the order number by calling the pdf file Invoice_49.pdf. It should be called Invoice_44.pdf, as 49 is the order number and 44 the invoice number according to the actual order page itself.See attached result. I have removed items for security purposes.
The same thing happens if I change the order/invoice.php or the order/show at the back end. - see attached invoice 50, which is actually invoice 45 with the order number TEST-00050-11/2013 not the invoice number 45. in this instance, as seen in the Orders page for that order. Again it is saved using the order number not the invoice number. The file should be Invoice_45.pdf not Invoice_49.pdf
Therefore:
- Please tell me precisely which file needs to be changed.
- How to include both Order number and the Invoice Number (they are different)
- How to make sure the invoice is saved as a pdf using the invoice number not the order number.
Because by doing what you have asked me to do already, does not seem to work.
Please Log in or Create an account to join the conversation.
Thanks,
Please Log in or Create an account to join the conversation.
The PDF that you provided come from the invoice PDF plugin. So it's not a view of HikaShop that you need to edit but the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php of the plugin.
That's why you didn't see any difference. I'm sorry but if you don't provide all the necessary information for us to understand your situation, it's hard to tell you precisely what to do...
So you need to replace the code:
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';
in the file plugins/hikashop/attachinvoice/attachinvoice.php
Please Log in or Create an account to join the conversation.
Thank you so much. I will now try that.
I am so grateful for your patience and in future I will try and be much clearer on what I am trying to do.
Many thanks,
Please Log in or Create an account to join the conversation.