[Koha-bugs] [Bug 21725] New: Incorrect HAVING in group by in Acquisitions.pm

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 30 12:59:04 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21725

            Bug ID: 21725
           Summary: Incorrect HAVING in group by in Acquisitions.pm
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Acquisitions
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: nick at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org

prove -v t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t

DBD::mysql::st execute failed: Non-grouping field 'expected_items' is used in
HAVING clause [for Statement "
        SELECT aqbasket.basketno, aqbasket.basketname, aqbasket.note,
aqbasket.booksellernote, aqbasket.contractnumber, aqbasket.creationdate,
aqbasket.closedate, aqbasket.booksellerid, aqbasket.authorisedby,
aqbasket.booksellerinvoicenumber, aqbasket.basketgroupid,
aqbasket.deliveryplace, aqbasket.billingplace, aqbasket.branch,
aqbasket.is_standing, aqbasket.create_items,
          SUM(aqorders.quantity) AS total_items,
          SUM(
            IF ( aqorders.orderstatus = 'cancelled', aqorders.quantity, 0 )
          ) AS total_items_cancelled,
          COUNT(DISTINCT aqorders.biblionumber) AS total_biblios,
          SUM(
            IF(aqorders.datereceived IS NULL
              AND (aqorders.datecancellationprinted IS NULL OR
aqorders.datecancellationprinted='0000-00-00')
            , aqorders.quantity
            , 0)
          ) AS expected_items
        FROM aqbasket
          LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
        WHERE booksellerid = ? GROUP BY aqbasket.basketno, aqbasket.basketname,
aqbasket.note, aqbasket.booksellernote, aqbasket.contractnumber,
aqbasket.creationdate, aqbasket.closedate, aqbasket.booksellerid,
aqbasket.authorisedby, aqbasket.booksellerinvoicenumber,
aqbasket.basketgroupid, aqbasket.deliveryplace, aqbasket.billingplace,
aqbasket.branch, aqbasket.is_standing, aqbasket.create_items HAVING (closedate
IS NULL OR (expected_items > 0))" with ParamValues: 0='359'] at
/home/vagrant/kohaclone/C4/Acquisition.pm line 719.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list