Jump to content

Credit reoprt


EZi

Recommended Posts

Hi,

I'm trying to find out how much credit is allocated to any of our clients.

Ie, a total amount of credit in WHMCS so we can put this amount on our balance sheet as a liability.

I have been told that this is the query:

SELECT * FROM tblclients WHERE tblclients.credit > 0

Not sure how to put this in the custom report?

Any advice would be appreciated...

Rene

 

Link to comment
Share on other sites

This.

SELECT
    tblclients.id AS client_id,
    CONCAT(tblclients.firstname, " ", tblclients.lastname) AS client_name,
    tblclients.companyname AS client_company_name,
    SUM(tblcredit.amount) AS current_credit_balance
FROM
    tblclients
LEFT JOIN
    tblcredit ON tblclients.id = tblcredit.clientid
GROUP BY
    tblclients.id

 

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