diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index c1166f8dc3..a296bf6894 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -348,6 +348,23 @@ Circulation: yes: ask no: "do not ask" - "for confirmation." + - + - By default, set the LOST value of an item to + - pref: DefaultLongOverdueLostValue + class: integer + - when the item has been overdue for more than + - pref: DefaultLongOverdueDays + class: integer + - days. + -
WARNING — These preferences will activate the automatic item loss process. Leave these fields empty if you don't want to activate this feature. + - "
Example: [1] [30] Sets an item to the LOST value 1 when it has been overdue for more than 30 days." + -
(Used when the longoverdue.pl script is called without the --lost parameter) + - + - "Charge a lost item to the borrower's account when the LOST value of the item changes to :" + - pref: DefaultLongOverdueChargeValue + class: integer + -
Leave this field empty if you don't want to charge the user for lost items. + -
(Used when the longoverdue.pl script is called without the --charge parameter) - - On checkin route the returned item to - pref: HomeOrHoldingBranchReturn diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 0f647128ba..ea7d5946ed 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -108,8 +108,21 @@ ENDUSAGE # FIXME: allow --help or -h # if ( ! defined($lost) ) { - print $usage; - die "ERROR: No --lost (-l) option defined"; + my $longoverdue_value = C4::Context->preference('DefaultLongOverdueLostValue'); + my $longoverdue_days = C4::Context->preference('DefaultLongOverdueDays'); + if(defined($longoverdue_value) and defined($longoverdue_days) and $longoverdue_value ne '' and $longoverdue_days ne '' and $longoverdue_days >= 0) { + $lost->{$longoverdue_days} = $longoverdue_value; + } + else { + print $usage; + die "ERROR: No --lost (-l) option defined"; + } +} +if ( ! defined($charge) ) { + my $charge_value = C4::Context->preference('DefaultLongOverdueChargeValue'); + if(defined($charge_value) and $charge_value ne '') { + $charge = $charge_value; + } } unless ($confirm) { $verbose = 1; # If you're not running it for real, then the whole point is the print output.