Jump to content

View username in transaction reports?


Recommended Posts

43 minutes ago, ROQ said:

I'd like to see my recent transactions list but with an extra column displaying the customers username as listed in their products/services section. Is this possible?

with great difficulty, if you mean the transactions list page at admin/transactions.php; if you mean the Transactions Report, then it would be easier to add custom columns there...

that transaction report is basically a SQL query of tblaccounts - but if you want usernames, then that's going to involve travelling conditionally through multiple linked tables to get the value you want (tblaccounts -> tblinvoiceitems -> tblhosting)... so it's possible, but would need some work.

Link to comment
Share on other sites

19 minutes ago, ROQ said:

Thank you brian for the reply, the transaction report would be perfect.  Where can I edit this to get the results I'm after?

the transaction report in not encrypted and can be found in /modules/reports/transactions.php - but don't edit that file (as I think the WHMCS updater will replace it with the original), so create a new .php file in that folder, copy & paste the transactions.php report code into it and then start editing that duplicate file.

you basically need to do upto 4 things:-

  1. enable Capsule if you're going to use that for the additional queries.
  2. add "username"=>"Username" to the $filterfields array (doesn't matter where, just where you want its checkbox to show in the output).
  3. add SQL query to get the username value in the $filters array.
  4. add SQL query to get the username value in the $incfields array.

the first two are easy; the next two will contain the same SQL query, but it's a complete pain because it's both conditional and optional, e.g you don't want this query to apply to all transactions, nor can you guarantee that username will exist anyway... hence why I said it would need some work. 😓

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.

  • 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