[Bug 32928] New: Filters missing in SQL builder on Orders::filter_by_active
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Bug ID: 32928 Summary: Filters missing in SQL builder on Orders::filter_by_active Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org Since version 21.xx.xx there has been a change in the way to retrieve the data of the orders to receive. The table is built from a call to the API and then the data can be filtered. Bug_20212 has integrated this change. This is a good thing but two filters are missing on the query construction in the Koha::Acquisition::Orders::filter_by_active function Here is the query in version 20.11 : <pre> SELECT aqbasket.basketno, borrowers.surname, borrowers.firstname, biblio.*, biblioitems.isbn, biblioitems.biblioitemnumber, biblioitems.publishercode, biblioitems.publicationyear, aqbasket.authorisedby, aqbasket.booksellerid, aqbasket.closedate, aqbasket.creationdate, aqbasket.basketname, aqbasketgroups.id as basketgroupid, aqbasketgroups.name as basketgroupname, aqorders.* FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid = aqbasketgroups.id LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber WHERE (datecancellationprinted is NULL) AND ( ( aqbasket.is_standing AND aqorders.orderstatus IN ( "new", "ordered", "partial" ) ) OR ( ( quantity > quantityreceived OR quantityreceived is NULL ) AND aqorders.orderstatus IN ( "ordered", "partial" ) ) ) AND aqbasket.booksellerid = ? ORDER BY aqbasket.basketno'; </pre> The condition "datecancellationprinted is NULL" is missing as well as the quantity control to display the results only if there are still quantities to receive. And so the result on the same database between the different versions can be very different! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.co |ity.org |m -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Thibaud Guillot <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 --- Comment #1 from Thibaud Guillot <thibaud.guillot@biblibre.com> --- Created attachment 146437 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146437&action=edit Bug 32928: Add filters on Orders::filter_by_active To have the same behavior than before 21.xx.xx filters must be added to the filter_by_active function. If not you can have on your list, some orders that can be cancelled, or orders with quantity totally received. Requirements: Have instances with different Koha version (20.11 VS Master for example) Test plan: 1) Apply this patch on Master Just have the same database with pending orders, and see differences between both instances on parcel.pl receptions. You will see that total of orders will be not the same -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Severity|enhancement |normal Keywords| |regression -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Improve performance of acquisitions receive page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |jonathan.druart+koha@gmail. | |com --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Please provide tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 --- Comment #3 from Fridolin Somers <fridolin.somers@biblibre.com> --- Oups there is a typo. Backslash there : + 'quantityreceived' => { '<' => \'me.quantity' } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Fridolin Somers from comment #3)
Oups there is a typo. Backslash there : + 'quantityreceived' => { '<' => \'me.quantity' }
Forget that, it is a string ref, completely normal :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32928 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|Failed QA |RESOLVED --- Comment #5 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- *** This bug has been marked as a duplicate of bug 36018 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org