Sonu2007 Posted August 17, 2017 Share Posted August 17, 2017 (edited) 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 August 17, 2017 by Prahost 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 17, 2017 Share Posted August 17, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.