Bug 20144: [sql_modes] Fix GROUP BY clause in GetInvoices
Need to be tested from the interface! Fix for: 'koha_kohadev.aqinvoices.invoicenumber' isn't in GROUP BY Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
2e35da4f6b
commit
39b0b5909c
1 changed files with 3 additions and 2 deletions
|
@ -2518,7 +2518,8 @@ sub GetInvoices {
|
|||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $query = qq{
|
||||
SELECT aqinvoices.*, aqbooksellers.name AS suppliername,
|
||||
SELECT aqinvoices.invoiceid, aqinvoices.invoicenumber, aqinvoices.booksellerid, aqinvoices.shipmentdate, aqinvoices.billingdate, aqinvoices.closedate, aqinvoices.shipmentcost, aqinvoices.shipmentcost_budgetid, aqinvoices.message_id,
|
||||
aqbooksellers.name AS suppliername,
|
||||
COUNT(
|
||||
DISTINCT IF(
|
||||
aqorders.datereceived IS NOT NULL,
|
||||
|
@ -2604,7 +2605,7 @@ sub GetInvoices {
|
|||
}
|
||||
|
||||
$query .= " WHERE " . join(" AND ", @bind_strs) if @bind_strs;
|
||||
$query .= " GROUP BY aqinvoices.invoiceid ";
|
||||
$query .= " GROUP BY aqinvoices.invoiceid, aqinvoices.invoicenumber, aqinvoices.booksellerid, aqinvoices.shipmentdate, aqinvoices.billingdate, aqinvoices.closedate, aqinvoices.shipmentcost, aqinvoices.shipmentcost_budgetid, aqinvoices.message_id, aqbooksellers.name";
|
||||
|
||||
if($args{order_by}) {
|
||||
my ($column, $direction) = split / /, $args{order_by};
|
||||
|
|
Loading…
Reference in a new issue