[Koha-bugs] [Bug 16219] New: Runreport.pl should allow sql paramters to be passed on the command line.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 6 22:51:56 CEST 2016


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

            Bug ID: 16219
           Summary: Runreport.pl should allow sql paramters to be passed
                    on the command line.
 Change sponsored?: ---
           Product: Koha
           Version: 3.18
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Command-line Utilities
          Assignee: gmcharlt at gmail.com
          Reporter: barton at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org
                CC: robin at catalyst.net.nz

Runreport.pl has a major limitation in that it is not capable of running
reports that use sql parameters:

Runreport will run this:

SELECT p.surname, p.firstname, p.email, p.cardnumber, 
       h.waitingdate AS 'hold date', i.barcode, b.title
FROM reserves h 
LEFT JOIN borrowers p USING (borrowernumber) 
LEFT JOIN items i USING (itemnumber) 
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) 
WHERE h.waitingdate IS NOT NULL AND h.branchcode='ABC'


but if your report looks like this:

SELECT p.surname, p.firstname, p.email, p.cardnumber, 
       h.waitingdate AS 'hold date', i.barcode, b.title
FROM reserves h 
LEFT JOIN borrowers p USING (borrowernumber) 
LEFT JOIN items i USING (itemnumber) 
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) 
WHERE h.waitingdate IS NOT NULL AND h.branchcode=<<Waiting at|branches>>

We should be able to supply a --sql_params argument one or more times to
provide the sql parameters.

runreport.pl --to="someone at someplace.com" --subject="Patrons with Holds Waiting
at Library" --format=csv --sql_params="ABC" 1

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


More information about the Koha-bugs mailing list