From 38ee2d6c6ca44a7b227ffd2a4157ba6af46dcb83 Mon Sep 17 00:00:00 2001 From: Marion Durand Date: Mon, 18 Oct 2021 14:35:21 +0200 Subject: [PATCH] MT28016: "Date due to" and "Show any items currently checked out" filters doesn't work properly in overdues.pl Filter "Date due to" is now taken into account even when filled with a future date for the displayed result and downloaded results. Filter "Show any items currently checked out" is now taken into account for the downloaded results. To test: 1- Go to Circulation then to overdues 2a- Add a filter with "Date due To" > today 2b- Check that only the results with "Due date" < today are displayed (not those with "Due date" between today and the date requested) 2c- Click on "Download file of displayed overdues" 2d- Check that the file contains only the results with "Due date" < today (not those with "Due date" between today and the date requested) 3a- Reset filter and then add the filter "Show any items currently checked out" 3b- Check that all the results are displayed (even those with "Due date" > today) 3c- Click on "Download file of displayed overdues" 3d- Check that the file contains only the results with "Due date" < today (not those with "Due date" between today and the date requested) 9- Apply the patch 10- Repeat step 1 to 8, checking that all the results corresponding to the selected filter are now displayed/downloaded https://bugs.koha-community.org/show_bug.cgi?id=26269 --- circ/overdue.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circ/overdue.pl b/circ/overdue.pl index a4df26e174..d6ae428e39 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -61,6 +61,7 @@ my $filters = { holdingbranch => $holdingbranchfilter, dateduefrom => $dateduefrom, datedueto => $datedueto, + showall => $showall, }; my $isfiltered = $op =~ /apply/i && $op =~ /filter/i; @@ -258,7 +259,7 @@ if ($noreport) { LEFT JOIN biblio ON (biblio.biblionumber=items.biblionumber ) WHERE 1=1 "; # placeholder, since it is possible that none of the additional # conditions will be selected by user - $strsth.=" AND date_due < '" . $todaysdate . "' " unless ($showall); + $strsth.=" AND date_due < '" . $todaysdate . "' " unless ($showall or $datedueto); $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; if( $itemtypefilter ){ -- 2.17.1