Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions modules/report/includes/commerce_pos_report.pages.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we continue here is so we don't add extra currencies or payment methods that shouldn't be here. I just wonder if we should watchdog or set a message here somehow.

}

if ($row->status == COMMERCE_PAYMENT_STATUS_SUCCESS) {
Expand Down