See the attached image. Yet the SQL query when executed directly does not return any zero rows:

    SELECT MIN(commerce_order.created) AS commerce_order_created_granularity, COUNT(commerce_order.order_id) AS order_id, MIN(commerce_order.order_id) AS order_id_1, 'commerce_order' AS field_data_commerce_order_total_commerce_order_entity_type, SUM(field_data_commerce_order_total.commerce_order_total_amount) AS field_data_commerce_order_total_commerce_order_total_amount, SUM(field_data_commerce_order_total.commerce_order_total_currency_code) AS field_data_commerce_order_total_commerce_order_total_currenc, AVG(field_data_commerce_order_total.commerce_order_total_amount) AS field_data_commerce_order_total_commerce_order_total_amount_1, AVG(field_data_commerce_order_total.commerce_order_total_currency_code) AS field_data_commerce_order_total_commerce_order_total_currenc_1
    FROM 
    commerce_order commerce_order
    LEFT JOIN field_data_commerce_order_total field_data_commerce_order_total ON commerce_order.order_id = field_data_commerce_order_total.entity_id AND (field_data_commerce_order_total.entity_type = 'commerce_order' AND field_data_commerce_order_total.deleted = '0')
    WHERE (( (commerce_order.created BETWEEN 1322179200 AND 1354320000) )AND(( (commerce_order.status IN  ('pending', 'processing', 'completed')) )))
    GROUP BY DATE_FORMAT((DATE_ADD('19700101', INTERVAL commerce_order.created SECOND) + INTERVAL 39600 SECOND), 'o-%v'), field_data_commerce_order_total_commerce_order_entity_type
    ORDER BY commerce_order_created_granularity DESC

Comments

aidanlis’s picture

I see the bug is in the commerce_reports_handler_field_date:post_execute method. Disabling this method and the zeroes disappear. Nice handler btw ;)

summit’s picture

Hi, how to change this in code please?
greetings, Martijn

pjcdawkins’s picture

Status: Active » Closed (duplicate)

See #1781572: The sales overview is off by a month. Both threads refer to the same bug.