Bug 10445: make SIP Server respect maxoutstanding system preference
The system preference 'maxoutstanding' is defined as the maximum amount of fees owed by the patron before Koha should block placing holds ( terrible naming on this one ). However, although the Koha OPAC respects this preference, placing holds via a SIP2 device will not. Test Plan: 1) Set maxoutstanding to $10 2) Pick a patron owning more than $10 in fees 3) Attempt to place a hold for this patron from a SIP2 device This attempt should succeed 4) Apply this patch 5) Restart your SIP2 server 6) Attempt to place a hold for this patron from a SIP2 device again This attempt should now fail Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
f57a057ef4
commit
070e52f401
|
|
@ -254,6 +254,10 @@ sub add_hold {
|
|||
return $trans;
|
||||
}
|
||||
|
||||
if ( $patron->holds_blocked_by_excessive_fees() ) {
|
||||
$trans->screen_msg("Excessive fees blocking placement of hold.");
|
||||
}
|
||||
|
||||
if ($item->fee and $fee_ack ne 'Y') {
|
||||
$trans->screen_msg = "Fee required to place hold.";
|
||||
return $trans;
|
||||
|
|
|
|||
|
|
@ -340,10 +340,16 @@ sub excessive_fees {
|
|||
my $self = shift;
|
||||
return ($self->fee_amount and $self->fee_amount > $self->fee_limit);
|
||||
}
|
||||
|
||||
sub excessive_fines {
|
||||
my $self = shift;
|
||||
return $self->excessive_fees; # excessive_fines is the same thing as excessive_fees for Koha
|
||||
}
|
||||
|
||||
sub holds_blocked_by_excessive_fees {
|
||||
return ( $self->fee_amount
|
||||
&& $self->fee_amount > C4::Context->preference("maxoutstanding") );
|
||||
}
|
||||
|
||||
sub library_name {
|
||||
my $self = shift;
|
||||
|
|
|
|||
Loading…
Reference in New Issue