Skip to content

Commit

Permalink
Update PO_SelectOSPurchOrder.php
Browse files Browse the repository at this point in the history
MySQL 8 removes ASC/DESC qualifiers from GROUP BY clauses, replace with ORDER BY clause for the sort.

Error reported in the forums:
http://www.weberp.org/forum/showthread.php?tid=9277
  • Loading branch information
TurboPT committed Oct 5, 2022
1 parent 3e6a873 commit f418eff
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions PO_SelectOSPurchOrder.php
Expand Up @@ -389,14 +389,15 @@
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
AND purchorders.orderno='" . $OrderNumber . "'
GROUP BY purchorders.orderno ASC,
GROUP BY purchorders.orderno,
suppliers.suppname,
purchorders.orddate,
purchorders.status,
purchorders.initiator,
purchorders.requisitionno,
purchorders.allowprint,
suppliers.currcode";
suppliers.currcode
ORDER BY purchorders.orderno ASC";
} else {
//$OrderNumber is not set
if (isset($SelectedSupplier)) {
Expand Down Expand Up @@ -443,7 +444,7 @@
AND purchorders.supplierno='" . $SelectedSupplier . "'
" . $WhereStockLocation
. $StatusCriteria . "
GROUP BY purchorders.orderno ASC,
GROUP BY purchorders.orderno,
purchorders.realorderno,
suppliers.suppname,
purchorders.orddate,
Expand All @@ -452,7 +453,8 @@
purchorders.requisitionno,
purchorders.allowprint,
suppliers.currcode,
currencies.decimalplaces";
currencies.decimalplaces
ORDER BY purchorders.orderno ASC";
} else {
$SQL = "SELECT purchorders.realorderno,
purchorders.orderno,
Expand Down Expand Up @@ -480,7 +482,7 @@
AND purchorders.supplierno='" . $SelectedSupplier . "'
" . $WhereStockLocation
. $StatusCriteria . "
GROUP BY purchorders.orderno ASC,
GROUP BY purchorders.orderno,
purchorders.realorderno,
suppliers.suppname,
purchorders.orddate,
Expand All @@ -489,7 +491,8 @@
purchorders.requisitionno,
purchorders.allowprint,
suppliers.currcode,
currencies.decimalplaces";
currencies.decimalplaces
ORDER BY purchorders.orderno ASC";
}
} //isset($SelectedSupplier)
else { //no supplier selected
Expand Down Expand Up @@ -535,7 +538,7 @@
AND purchorderdetails.itemcode='" . $SelectedStockItem . "'
" . $WhereStockLocation .
$StatusCriteria . "
GROUP BY purchorders.orderno ASC,
GROUP BY purchorders.orderno,
purchorders.realorderno,
suppliers.suppname,
purchorders.orddate,
Expand All @@ -544,7 +547,8 @@
purchorders.requisitionno,
purchorders.allowprint,
suppliers.currcode,
currencies.decimalplaces";
currencies.decimalplaces
ORDER BY purchorders.orderno ASC";
} else {
$SQL = "SELECT purchorders.realorderno,
purchorders.orderno,
Expand All @@ -571,7 +575,7 @@
AND orddate<='" . $DateTo . "'
" . $WhereStockLocation .
$StatusCriteria . "
GROUP BY purchorders.orderno ASC,
GROUP BY purchorders.orderno,
purchorders.realorderno,
suppliers.suppname,
purchorders.orddate,
Expand All @@ -580,7 +584,8 @@
purchorders.requisitionno,
purchorders.allowprint,
suppliers.currcode,
currencies.decimalplaces";
currencies.decimalplaces
ORDER BY purchorders.orderno ASC";
}
} //end selected supplier
} //end not order number selected
Expand Down

0 comments on commit f418eff

Please sign in to comment.