Fix a useless group by
This commit is contained in:
parent
7aeaaab7f0
commit
98cc40ac8d
@ -373,7 +373,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$notrigger && !$error) {
|
||||
if (!$error) {
|
||||
global $conf, $langs, $user;
|
||||
// Call trigger
|
||||
|
||||
@ -682,7 +682,8 @@ if ($id > 0 || !empty($ref)) {
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,";
|
||||
//$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,";
|
||||
$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
|
||||
$sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse";
|
||||
|
||||
// Enable hooks to alter the SQL query (SELECT)
|
||||
@ -718,7 +719,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " GROUP BY p.ref, p.label, p.tobatch, p.fk_default_warehouse, l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
|
||||
//$sql .= " GROUP BY p.ref, p.label, p.tobatch, p.fk_default_warehouse, l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
|
||||
$sql .= " ORDER BY l.rang, p.ref, p.label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user