Line 46 of commerce_reports.blocks.inc:

<?php
  $result = db_query('SELECT SUM(amount) AS sum, AVG(amount) AS average, COUNT(*) AS count, currency_code FROM {commerce_payment_transaction} cpt WHERE created >= :start  GROUP by currency_code', array(':start' => $start));
?>

But it should be:

<?php
  $result = db_query('SELECT SUM(amount) AS sum, AVG(amount) AS average, COUNT(*) AS count, currency_code FROM {commerce_payment_transaction} cpt WHERE created >= :start AND status = :success GROUP by currency_code', array(':start' => $start, ':success' => 'success'));
?>

Patch in comments.

Comments

jessepinho’s picture

StatusFileSize
new1.04 KB

Patch attached.

mglaman’s picture

Issue summary: View changes
Status: Active » Fixed

This has been fixed a few commits ago in 4.x as I knew it was an existing issue. I didn't see your issue in the queue before, sorry! Otherwise I'd have provided authorship.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.