Bug 26269: "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

Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0b349d3560)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Marion Durand 2021-10-18 14:35:21 +02:00 committed by Andrew Fuerste-Henry
parent 68f7dbe2fb
commit 2ea0ccf5d4
1 changed files with 2 additions and 1 deletions

View File

@ -62,6 +62,7 @@ my $filters = {
holdingbranch => $holdingbranchfilter,
dateduefrom => $dateduefrom,
datedueto => $datedueto,
showall => $showall,
};
my $isfiltered = $op =~ /apply/i && $op =~ /filter/i;
@ -266,7 +267,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 ){