From a13781d57d69e0e56218cf027f8e7695c5df1998 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 11 Dec 2025 12:30:36 +0530 Subject: [PATCH] Fixed: notices in the admin stats (Sales and orders tab ) while trying to export the data using the CSV export. --- modules/statssales/statssales.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php index 0b89b0d0d..de828d507 100644 --- a/modules/statssales/statssales.php +++ b/modules/statssales/statssales.php @@ -310,10 +310,14 @@ class StatsSales extends ModuleGraph { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate().$this->query_group_by.$this->query_having_filter); foreach ($result as $row) { + $days = (int)substr($row['invoice_date'], 8, 2); + if (!isset($this->_values[$days])) { + $this->_values[$days] = 0; + } if ($this->option == 1) { - $this->_values[(int)substr($row['invoice_date'], 8, 2)] += 1; + $this->_values[$days] += 1; } else { - $this->_values[(int)substr($row['invoice_date'], 8, 2)] += $row['total_revenue']; + $this->_values[$days] += $row['total_revenue']; } } }