Jump to content

(SOLVED) version 1.6.1.17 statistics in the control panel


overbags

Recommended Posts

To track it down is quickly looked at the getTotalSales in AdminStatsController. This function - as just one example - executes this kind of SQL:
 

            $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
            SELECT LEFT(`date_upd`, 10) as date, SUM(total_paid_tax_excl / o.conversion_rate) as sales
            FROM `'._DB_PREFIX_.'orders` o
            LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state
            WHERE `date_upd` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 AND os.paid = 1
            '.Shop::addSqlRestriction(false, 'o').'
            GROUP BY LEFT(`date_upd`, 10)');

If might check your order states table with the column logable. These is one condition for order states to show up in the statistics. Which means: order state must contain 1 in field os_logable and the order must have been paid.

Link to comment
Share on other sites

Also note  date_upd is the field for last updated time for an order. If your order(s) haven't been updated in the time range selected, they won't shop up as well.

If you consider the stats as bug, open a forge request - which is the correct way of sending error requests to the PrestaShop Team.

Link to comment
Share on other sites

I quote myself:
 

Also note  date_upd is the field for last updated time for an order.

 

 

This was an change with newer prestashop releases. At least up to 1.6.1.13 the date was checked against invoice_date. Now it is checked against last updated field.

If you wish to get the old behavior, you have to change the AdminStatsController.php or try to use the one from a previous version.

Link to comment
Share on other sites

You have to be "solved" if you have ...

1) tested and older version of the controller file which works according your wish OR

2) you take your existing controller file and replace all SQL selects which use date_upd with invoice_date OR

3) you place forge request

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...