Skip to content

Commit ec7ebe7

Browse files
authored
FIX / Fix MySQL when calculating amounts (#555)
* fix backticks issue in getAllPrices() * update CHANGELOG.md
1 parent c05b878 commit ec7ebe7

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [Unreleased] - 2026-03-04
9+
10+
### Fixed
11+
12+
- Fix SQL syntax error in `getAllPrices()` function causing orders total amount calculation to fail
13+
814
## [2.11.4] - 2026-02-23
915

1016
### Fixed

inc/order_item.class.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,11 +1379,9 @@ public function getAllPrices($orders_id)
13791379

13801380
$criteria = [
13811381
'SELECT' => [
1382-
'SUM' => [
1383-
'`price_ati` AS priceTTC',
1384-
'`price_discounted` AS priceHT',
1385-
'`price_ati` - `price_discounted` AS priceTVA'
1386-
]
1382+
new \QueryExpression('SUM(`price_ati`) AS priceTTC'),
1383+
new \QueryExpression('SUM(`price_discounted`) AS priceHT'),
1384+
new \QueryExpression('SUM(`price_ati` - `price_discounted`) AS priceTVA')
13871385
],
13881386
'FROM' => self::getTable(),
13891387
'WHERE' => ['plugin_order_orders_id' => $orders_id]

0 commit comments

Comments
 (0)