When the longoverdu.pl script is run, and it marks an item as lost ( using
LostItem() ), if fails to remove the item from the borrower record. So, the
item is marked as lost, but is also still listed as checked out to the
borrower.
This commit adds the command line parameter --mark-returned. If used,
longoverdue.pl will remove lost items from the borrowers record.
Functionality will remain the same if it is not used.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
http://bugs.koha-community.org/show_bug.cgi?id=7426
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
my $lost; # key=lost value, value=num days.
my ($charge, $verbose, $confirm, $quiet);
my $endrange = 366;
my $lost; # key=lost value, value=num days.
my ($charge, $verbose, $confirm, $quiet);
my $endrange = 366;
- 'lost=s%' => \$lost,
- 'c|charge=s' => \$charge,
- 'confirm' => \$confirm,
- 'verbose' => \$verbose,
- 'quiet' => \$quiet,
- 'maxdays=s' => \$endrange
+ 'lost=s%' => \$lost,
+ 'c|charge=s' => \$charge,
+ 'confirm' => \$confirm,
+ 'verbose' => \$verbose,
+ 'quiet' => \$quiet,
+ 'maxdays=s' => \$endrange,
+ 'mark-returned' => \$mark_returned,
);
my $usage = << 'ENDUSAGE';
);
my $usage = << 'ENDUSAGE';
--maxdays Specifies the end of the range of overdue days to deal with (defaults to 366). This
value is universal to all lost num days overdue passed.
--maxdays Specifies the end of the range of overdue days to deal with (defaults to 366). This
value is universal to all lost num days overdue passed.
+ --mark-returned When an item is marked lost, remove it from the borrowers issued items.
+
examples :
$PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1
Would set LOST=1 after 30 days (up to one year), but not charge the account.
examples :
$PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1
Would set LOST=1 after 30 days (up to one year), but not charge the account.
printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
if($confirm) {
ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
if($confirm) {
ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
- LostItem($row->{'itemnumber'}, undef, 'CHARGE FEE') if( $charge && $charge eq $lostvalue);
+ LostItem($row->{'itemnumber'}, $mark_returned, 'CHARGE FEE') if( $charge && $charge eq $lostvalue);