Jump to content

Reports by PAyment method


Sonu2007

Recommended Posts

How i can modify "Annual Income Report" or "Monthly Transactions Report" by payment method.

Currently it show totals considering all payment modes.

 

$reportdata["currencyselections"] = true;

$reportdata["paymentmethodselections"] = true;

$reportdata["monthspagination"] = true;

 

 

 

$reportvalues = array();

$query = "SELECT date_format(date, '%e'),SUM(amountin),SUM(fees),SUM(amountout) FROM tblaccounts INNER JOIN tblclients ON tblclients.id=tblaccounts.userid WHERE date LIKE '". $year . "-" . $month . "-%' AND tblclients.currency=" . (int)$currencyid . " AND tblclients.paymentmethod= "paypal" GROUP BY date_format(date, '%e') ORDER BY date ASC";

$result = full_query($query);

while ($data = mysql_fetch_array($result)) {

$reportvalues[$data[0]] = array(

'amountin' => $data[1],

'fees' => $data[2],

'amountout' => $data[3],

);

Edited by Prahost
Link to comment
Share on other sites

for something like this, you might be better off posting in Service Offers & Requests and getting the time & help of a developer - if only because you need to think about what it is you want to query and how you want to output it... and whether modifying an existing report is the best way to do it.

 

but with regards to your two changes...

 

$reportdata["paymentmethodselections"] = true;

you can't just make up functions like that and expect them to work... the other two are functions defined within WHMCS to do specific tasks if enabled... yours has no function behind it and therefore is meaningless.

 

and with regards to tblclients.paymentmethod, that's just the default payment method for that client - they may have paid through an alternate gateway (if your system allows it) - tblaccounts.payment would tell you the gateway used.

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