Jump to content

Customise Invoice Report


pikerr

Recommended Posts

Dear Team,

Im trying to customise the invoice report.

Is there a way to filter User ID is not equal ( for example is 10), the rest will be generated. The middle option is Exact Match and Containing which will list the User ID 10 for this scenario.

image.png.30eeda5b9e451c2fba30ff35b2f9522a.png

 

Thank you

 

Link to comment
Share on other sites

a quick hack would be to edit the report code and change...

? $val . " LIKE '%" . db_escape_string($filterq[$i]) . "%'"

to...

? $val . " NOT LIKE '%" . db_escape_string($filterq[$i]) . "%'"

that then makes the "Containing" filter into a "Does Not Contain" filter (you can edit the title in the dropdown if you want to)... you could then choose Userid, enter the value 10 and it should show you invoices for all users apart from userid #10

the longer solution would be to have all three options - but that coding is a little more involved.

I should also add that if you're editing a core WHMCS report, that you should rename it, because during a WHMCS automatic update, it will probably get overwritten with the core original report file again and your customisation will be lost... and there's nothing to stop you having a separate negative report that uses this "does not contain" option, and leaving the default invoices report as is.

Link to comment
Share on other sites

Hi Brian,

Thanx for your advise, is it possible to retain Exact Match and Containing, meanwhile add one more option does not containing?

As I require

Exact Match for Status Paid

Containing for the month (2019-07)

 Does not containing user id 10

Thank you

Link to comment
Share on other sites

7 hours ago, pikerr said:

Thanx for your advise, is it possible to retain Exact Match and Containing, meanwhile add one more option does not containing?

yes - personally, i'd have done it outside of WHMCS and just queried the table directly, but what you want to do can be done in WHMCS.

to save time, I won't bother posting the code changes, but you'll know where to look when you see the attached file - only the filters and the dropdown selection fields have been changed.

7 hours ago, pikerr said:

Exact Match for Status Paid

Containing for the month (2019-07)

 Does not containing user id 10

k0ZOOgz.png

invoices_enhanced.php

Link to comment
Share on other sites

  • 1 month later...

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