diff --git a/CHANGELOG.md b/CHANGELOG.md index b0559aa162..be413fbe3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] - 2026-03-04 + +### Fixed + +- Fix SQL syntax error in `getAllPrices()` function causing orders total amount calculation to fail + ## [2.11.4] - 2026-02-23 ### Fixed diff --git a/inc/order_item.class.php b/inc/order_item.class.php index 56b33c0651..f9d485c82a 100644 --- a/inc/order_item.class.php +++ b/inc/order_item.class.php @@ -1379,11 +1379,9 @@ public function getAllPrices($orders_id) $criteria = [ 'SELECT' => [ - 'SUM' => [ - '`price_ati` AS priceTTC', - '`price_discounted` AS priceHT', - '`price_ati` - `price_discounted` AS priceTVA' - ] + new \QueryExpression('SUM(`price_ati`) AS priceTTC'), + new \QueryExpression('SUM(`price_discounted`) AS priceHT'), + new \QueryExpression('SUM(`price_ati` - `price_discounted`) AS priceTVA') ], 'FROM' => self::getTable(), 'WHERE' => ['plugin_order_orders_id' => $orders_id]