diff --git a/modules/report/includes/commerce_pos_report.pages.inc b/modules/report/includes/commerce_pos_report.pages.inc index 40f1a9c..792f85e 100644 --- a/modules/report/includes/commerce_pos_report.pages.inc +++ b/modules/report/includes/commerce_pos_report.pages.inc @@ -395,8 +395,9 @@ function commerce_pos_report_get_totals($date_filter, $register_id) { // Default to a single currency based off of the default commerce currency. $currency_code = commerce_default_currency(); + // Build a list of default totals. foreach ($pos_methods as $pos_method) { - if (!empty($pos_method['status']) && intval($pos_method['status']) === COMMERCE_POS_PAYMENT_METHOD_STATUS_ENABLED) { + if (empty($pos_method['status']) || intval($pos_method['status']) === COMMERCE_POS_PAYMENT_METHOD_STATUS_ENABLED) { $totals[$currency_code][$pos_method['id']] = array( CommercePosService::TRANSACTION_TYPE_SALE => 0, CommercePosService::TRANSACTION_TYPE_RETURN => 0, @@ -411,13 +412,8 @@ function commerce_pos_report_get_totals($date_filter, $register_id) { $statuses = commerce_payment_transaction_statuses(); foreach ($query->execute() as $row) { - if (!isset($totals[$row->commerce_order_total_currency_code][$row->payment_method])) { - $totals[$row->commerce_order_total_currency_code][$row->payment_method] = array( - CommercePosService::TRANSACTION_TYPE_SALE => 0, - CommercePosService::TRANSACTION_TYPE_RETURN => 0, - CommercePosService::TRANSACTION_TYPE_EXCHANGE => 0, - ); + continue; } if ($row->status == COMMERCE_PAYMENT_STATUS_SUCCESS) {