From 15e846d74aa30d3bfa5222d009171313594590d7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 6 Oct 2011 15:13:30 -0400 Subject: [PATCH] Fix for Bug 6983 - Item type filter on overdues report does not respect item-level_itypes This patch adds a check for the item-level_itypes preference when building the SQL for the overdues report. Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- circ/overdue.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/circ/overdue.pl b/circ/overdue.pl index 2bdafe1a0b..7467874f5f 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -265,7 +265,13 @@ if ($noreport) { $strsth.=" AND date_due < '" . $todaysdate . "' " unless ($showall); $strsth.=" AND (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ; $strsth.=" AND borrowers.categorycode = '" . $borcatfilter . "' " if $borcatfilter; - $strsth.=" AND biblioitems.itemtype = '" . $itemtypefilter . "' " if $itemtypefilter; + if( $itemtypefilter ){ + if( C4::Context->preference('item-level_itypes') ){ + $strsth.=" AND items.itype = '" . $itemtypefilter . "' "; + } else { + $strsth.=" AND biblioitems.itemtype = '" . $itemtypefilter . "' "; + } + } $strsth.=" AND borrowers.flags = '" . $borflagsfilter . "' " if $borflagsfilter; $strsth.=" AND borrowers.branchcode = '" . $branchfilter . "' " if $branchfilter; $strsth.=" AND date_due < '" . $datedueto . "' " if $datedueto; -- 2.39.5