Jump to content

Numerical sorting out of order - can't sort by invoice number


Recommended Posts

Perhaps elsewhere, but at least on the invoices page, when you sort by invoice #, they are out of order. "5, 3, 192, 187, 290…" This is NOT a "feature request," as anything created sequentially with sequential numbers should obviously be able to be displayed sequentially.


This is one of those really annoying things about WHMCS where I just stare dumbly and go, "Really? ..... Really?"

Link to comment
Share on other sites

Hi John,


I think there is something to what swinghosting is saying with this as i've seen this with our whmcs setup too.


posted below is a merged screenshot of two different client accounts - the top half is sorted by invoice number descending (high->low), the lower is again sorted by invoice number but in ascending order (low->high).


as you can see, neither are sorted purely in invoice number order - i'm not sure of the SQL query the page is using, but it looks to be sorting on "status" and then "id", rather than just on "id"...


the screenshot below is using the latest "default" template (but same thing happens on any custom theme I use)... i'm sure this problem has existed for a long while - sorting the invoices on the admin side seems fine, so I assume that's not using the same SQL query.


we did change our invoice numbering when we took WHMCS live, but that shouldn't matter - they're just numbers in the database and I can't see any issues when looking at the tblinvoices table... e.g if #1070 and #1154 are sorted correctly, why isn't #1133 ?




for my custom template, I can slightly get around the issue by removing the sort option from the "Invoice Number" field - sorting by invoice date generally sorts the invoice numbers correctly - although if there are a few invoices generated on the same day, they might not be shown in the correct order... thankfully, i've never had a client comment about this yet! :idea:


even so, it might be worth taking a closer look at to see if there is an issue.

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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • 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