Jump to content
pikerr

Customise Invoice Report

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

 

Share this post


Link to post
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.

Share this post


Link to post
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 Containing for the month (2019-07), does not containing user id 10

Thank you

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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