Lines 41-54
use Getopt::Long;
Link Here
|
41 |
my $lost; # key=lost value, value=num days. |
41 |
my $lost; # key=lost value, value=num days. |
42 |
my ($charge, $verbose, $confirm, $quiet); |
42 |
my ($charge, $verbose, $confirm, $quiet); |
43 |
my $endrange = 366; |
43 |
my $endrange = 366; |
|
|
44 |
my $mark_returned = 0; |
44 |
|
45 |
|
45 |
GetOptions( |
46 |
GetOptions( |
46 |
'lost=s%' => \$lost, |
47 |
'lost=s%' => \$lost, |
47 |
'c|charge=s' => \$charge, |
48 |
'c|charge=s' => \$charge, |
48 |
'confirm' => \$confirm, |
49 |
'confirm' => \$confirm, |
49 |
'verbose' => \$verbose, |
50 |
'verbose' => \$verbose, |
50 |
'quiet' => \$quiet, |
51 |
'quiet' => \$quiet, |
51 |
'maxdays=s' => \$endrange |
52 |
'maxdays=s' => \$endrange, |
|
|
53 |
'mark-returned' => \$mark_returned, |
52 |
); |
54 |
); |
53 |
|
55 |
|
54 |
my $usage = << 'ENDUSAGE'; |
56 |
my $usage = << 'ENDUSAGE'; |
Lines 75-80
This script takes the following parameters :
Link Here
|
75 |
--maxdays Specifies the end of the range of overdue days to deal with (defaults to 366). This |
77 |
--maxdays Specifies the end of the range of overdue days to deal with (defaults to 366). This |
76 |
value is universal to all lost num days overdue passed. |
78 |
value is universal to all lost num days overdue passed. |
77 |
|
79 |
|
|
|
80 |
--mark-returned When an item is marked lost, remove it from the borrowers issued items. |
81 |
|
78 |
examples : |
82 |
examples : |
79 |
$PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1 |
83 |
$PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1 |
80 |
Would set LOST=1 after 30 days (up to one year), but not charge the account. |
84 |
Would set LOST=1 after 30 days (up to one year), but not charge the account. |
Lines 161-167
foreach my $startrange (sort keys %$lost) {
Link Here
|
161 |
printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); |
165 |
printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); |
162 |
if($confirm) { |
166 |
if($confirm) { |
163 |
ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); |
167 |
ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); |
164 |
LostItem($row->{'itemnumber'}, undef, 'CHARGE FEE') if( $charge && $charge eq $lostvalue); |
168 |
LostItem($row->{'itemnumber'}, $mark_returned, 'CHARGE FEE') if( $charge && $charge eq $lostvalue); |
165 |
} |
169 |
} |
166 |
$count++; |
170 |
$count++; |
167 |
} |
171 |
} |
168 |
- |
|
|