Jump to content

Can I print an order number on an invoice?


Recommended Posts

Forgive me for a newbie but I have been reading documentation and this community community all day without an answer.

I want to print the order number as reported in the customer order confirmation email on the customer's invoice and the invoice email.

Seems a natural enough thing to want but the order_number seems not to exist in the context of invoices.  Why?

Is this a bug or a feature?

 

Thanks,

Hank Cohen

Link to comment
Share on other sites

OK I've done more reading in the community and find that this is a fairly common request that has been dismissed by the developers for over 10 years so I guess it ain't gonna get fixed.

Perhaps someone could suggest an alternative.  Going back to first principles I will state my requirements from a user interface point of view.

I have a product line with multiple products and my customer may want to buy multiple instances at the same or different times.

Let's keep it simple.  Customer A orders a Silver Widget and pays with her credit card.  Thank you I say, I have your order and I give him the order number by email.

Customer loves the Silver Widget so she orders another, again paying with the same credit card.  Thank very much, here's your new order number.

Meanwhile the customer has received two credit card payment confirmations and two invoices.  Both for one silver widget but she has absolutely no way of knowing which invoice is for which widget.

What's more, there is no way to differentiate between these two products in the WHMCS Client Area. I will see two identical rows "Silver Widget"

Let's put it into programmer speak, The product name Silver Widget is a Class, the Alice and Bob Widgets are instances of the class.  What I need is an instance identifier that I can use with my customer to track the things they have purchased.  Obviously I was not the first that assumed that this was the $order_number.

Any suggestions would be appreciated.

Link to comment
Share on other sites

Hi Hank,

On 25/03/2021 at 05:57, Hank Cohen said:

Forgive me for a newbie but I have been reading documentation and this community community all day without an answer.

you might need to get out more! 😎

On 25/03/2021 at 05:57, Hank Cohen said:

I want to print the order number as reported in the customer order confirmation email on the customer's invoice and the invoice email.

the simplest way, although untested, might be an action hook that applies a custom invoice number to the invoice - which when applicable includes the order number (bearing in mind that not all invoices will be related to an order e.g renewals).

the hook would have to check to see if there is an order existing in the database for the current invoice, and if so, update the invoices table to add the custom invoice number - this custom invoice number should be used on the client area, invoices and emails... whether that causes layout/design issues might depend on your theme... by default, the hook would only be applied to new invoices/orders, and wouldn't be retrospective.

if that happens, then you might need to look at manually editing the invoice PDF template and then addressing the issues elsewhere with other hooks.

On 25/03/2021 at 05:57, Hank Cohen said:

Seems a natural enough thing to want but the order_number seems not to exist in the context of invoices.  Why?

possibly as they're stored in separate tables - off-hand, I can't recall a lot of posts asking for order numbers to be shown on invoices...

On 25/03/2021 at 05:57, Hank Cohen said:

Is this a bug or a feature?

by WHMCS' definition, neither - it doesn't do it out of the box, so it's not a feature; and the fact it hasn't been designed to do this, and it isn't, means they won't consider it a bug - it would only be a bug if they intend to have the order number shown, but for some reason, it wasn't being added... or the opposite, they didn't intend to add it, but something was adding it.... long story short, it's not a bug or feature - welcome to using WHMCS! 🙄

On 25/03/2021 at 06:43, Hank Cohen said:

OK I've done more reading in the community and find that this is a fairly common request that has been dismissed by the developers for over 10 years so I guess it ain't gonna get fixed.

https://requests.whmcs.com/topic/add-an-indication-to-an-invoice-created-by-an-order-with-the-relevant-order-number

that request only got two votes - so it's unlikely WHMCS are going to do anything about it (though i've seen requests completed with 1 vote, and requests with three figures not - either way, they take years to get completed and I assume you want a shorter time-frame than the usual WHMCS development pace! 🐌

On 25/03/2021 at 06:43, Hank Cohen said:

Any suggestions would be appreciated.

with a modified invoice number, then the invoice would show the Order No in the admin area...

iFwQjLH.png

... it would be shown on the PDF invoice...

BS8DJYp.png

and in the client area...

lznRGTV.png

and on the invoice email...

ouKHVBQ.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated