shipping invoice shows invoicenumber after payment

  • Posts: 506
  • Thank you received: 21
  • Hikashop Business
3 years 3 months ago #327991

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4

Hi,

At least until version Hikashop 4.2 when printing an shipping invoice the ordernumber was used. I use the shipping invoice as an orderform, I suppose as most users do.

Now I recently removed some customcode from the invoice view, so now it's the 4.4 version. While printing the shipping invoice now when the order is paid the invoicenumber is used instead of the ordernumber. That's not logical, as the invoicenumber should only be used for the invoice itself?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 3 months ago #327994

Hi,

Whether it is the invoice or the shipping invoice, in both cases, the system will try to use the invoice number if available, and if not, it will use the order number.
So if you display the shipping invoice before the invoice number is generated, you will get the order number on it.
I don't believe this has changed in the last few years.
This is handled by the code:

if(!empty($this->element->order_invoice_number)) {
						echo JText::_('INVOICE').': '.$this->element->order_invoice_number;
					} else {
						echo JText::_('INVOICE').': '.@$this->element->order_number;
					}
in the file order / invoice.php that you can edit via the menu Display>Views.

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

  • Posts: 506
  • Thank you received: 21
  • Hikashop Business
3 years 3 months ago #328035

Hi,

I understand the code, but if I alter that code the only option is to never show the order_invoice_number. But what if I want to have the order_number on the shipping invoice, also when the order is paid immediately at ordering (and thus an invoicenumber is generated)? Now the order_number will never be used when the client pays at ordering?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 3 months ago #328044

Hi,

Well, if you want to display the order number for shipping invoices, you just need to adapt the code for that.
Nothing crazy. For example :

if($this->invoice_type == 'full') {
if(!empty($this->element->order_invoice_number)) {
						echo JText::_('INVOICE').': '.$this->element->order_invoice_number;
					} else {
						echo JText::_('INVOICE').': '.@$this->element->order_number;
					}
} else {
					echo JText::_('ORDER').': '.$this->element->order_number;
}

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

  • Posts: 506
  • Thank you received: 21
  • Hikashop Business
3 years 3 months ago #328082

Thank you!

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

Time to create page: 0.062 seconds
Powered by Kunena Forum