BUG 13468: Overdue notice lists all checked out books
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 16 Dec 2014 17:15:58 +0000 (17:15 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 17 Dec 2014 22:26:05 +0000 (19:26 -0300)
This patch should fix the issue when running under 'triggered' mode

To test:

1) Run overdue_notices.pl -t -n [to output notices to command
line]
2) Note that the notices output, list ALL checked out items
3) Apply Patch
4) Run again
5) Note the difference

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: remove space changes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
misc/cronjobs/overdue_notices.pl

index 4e58e8a..4d05ff7 100755 (executable)
@@ -621,8 +621,17 @@ END_SQL
                         }
                     }
                     else {
-                        unless ($days_between >=$mindays && $days_between <= $maxdays){
-                            next;
+                        if ($triggered) {
+                            if ( $mindays != $days_between ) {
+                                next;
+                            }
+                        }
+                        else {
+                            unless ( $days_between >= $mindays
+                                && $days_between <= $maxdays )
+                            {
+                                next;
+                            }
                         }
                     }