[Koha-bugs] [Bug 5527] New: Reports: Patrons who haven't checked out misses active users from issues table

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 20 16:43:03 CET 2010


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5527

           Summary: Reports: Patrons who haven't checked out misses active
                    users from issues table
 Change sponsored?: ---
           Product: Koha
           Version: rel_3_2
          Platform: All
               URL: /cgi-bin/koha/reports/borrowers_out.pl
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Reports
        AssignedTo: gmcharlt at gmail.com
        ReportedBy: katrin.fischer at bsz-bw.de
         QAContact: koha-bugs at lists.koha-community.org
   Estimated Hours: 0.0


I compared some of my sql statements for statistics with the results from
Koha's built in reports in the reports module.

Currently the 'Patrons who haven't checked out' report does not consider
patrons from issues.

If you have a newly registered user, that has checked out his first books in
the library his borrowernumber will only appear in issues. This is an active
user.

At the moment Koha gets a list of active borrowernumbers only from old_issues
and compares that (not in) to all borrowers to get the inactive borrowers.

It should also get the borrowers from issues.

Currently koha asks:

SELECT CONCAT( borrowers.surname , "\t",borrowers.firstname, "\t",
borrowers.cardnumber) 
FROM borrowers 
WHERE 1  
AND borrowers.borrowernumber not in 
(SELECT DISTINCT borrowernumber FROM old_issues where old_issues.timestamp>
01/01/2010 ) 
group by borrowers.borrowernumber


I think it needs to consider issues too, perhaps something like:

SELECT CONCAT( borrowers.surname , "\t",borrowers.firstname, "\t",
borrowers.cardnumber)
FROM borrowers
WHERE 1
AND borrowers.borrowernumber not in
(SELECT DISTINCT borrowernumber FROM (
select borrowernumber from old_issues where old_issues.timestamp> 01/01/2010
union
select borrowernumber from issues where issues.timestamp> 01/01/2010) active_b
)
group by borrowers.borrowernumber


There was some discussion about that on #koha too: 
http://stats.workbuffer.org/irclog/koha/2010-12-20#i_567711

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Koha-bugs mailing list