If the patron has amassed charges that block borrowing, but we
allow staff override the information that the patron cannot
issue should be included the patron information response
This patch sets the appropriate status fields in the patron object
It restores the fee_limit member to the patron object
and calls a local subroutine to set it.
This could be done more elegantly but that would require more
major refactoring of the rather messy initializer code
in ILS::Patron
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
$dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD
my $fines_amount = $flags->{CHARGES}->{amount};
$fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
$dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD
my $fines_amount = $flags->{CHARGES}->{amount};
$fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
+ my $fee_limit = _fee_limit();
+ my $fine_blocked = $fines_amount > $fee_limit;
{
no warnings; # any of these $kp->{fields} being concat'd could be undef
%ilspatron = (
{
no warnings; # any of these $kp->{fields} being concat'd could be undef
%ilspatron = (
address => $adr,
home_phone => $kp->{phone},
email_addr => $kp->{email},
address => $adr,
home_phone => $kp->{phone},
email_addr => $kp->{email},
- charge_ok => ( !$debarred && !$expired ),
- renew_ok => ( !$debarred && !$expired ),
- recall_ok => ( !$debarred && !$expired ),
- hold_ok => ( !$debarred && !$expired ),
+ charge_ok => ( !$debarred && !$expired && !$fine_blocked),
+ renew_ok => ( !$debarred && !$expired && !$fine_blocked),
+ recall_ok => ( !$debarred && !$expired && !$fine_blocked),
+ hold_ok => ( !$debarred && !$expired && !$fine_blocked),
card_lost => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
claims_returned => 0,
fines => $fines_amount, # GetMemberAccountRecords($kp->{borrowernumber})
card_lost => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
claims_returned => 0,
fines => $fines_amount, # GetMemberAccountRecords($kp->{borrowernumber})
unavail_holds => [],
inet => ( !$debarred && !$expired ),
expired => $expired,
unavail_holds => [],
inet => ( !$debarred && !$expired ),
expired => $expired,
+ fee_limit => $fee_limit,
);
}
$debug and warn "patron fines: $ilspatron{fines} ... amountoutstanding: $kp->{amountoutstanding} ... CHARGES->amount: $flags->{CHARGES}->{amount}";
);
}
$debug and warn "patron fines: $ilspatron{fines} ... amountoutstanding: $kp->{amountoutstanding} ... CHARGES->amount: $flags->{CHARGES}->{amount}";
card_lost => 0, # for patron_status[4]
recall_overdue => 0,
currency => 1,
card_lost => 0, # for patron_status[4]
recall_overdue => 0,
currency => 1,
screen_msg => 1,
print_line => 1,
too_many_charged => 0, # for patron_status[5]
screen_msg => 1,
print_line => 1,
too_many_charged => 0, # for patron_status[5]
return $self->{inet} ? 'Y' : 'N';
}
return $self->{inet} ? 'Y' : 'N';
}
-sub fee_limit {
- my $self = shift;
- return C4::Context->preference("noissuescharge") || 5;
+sub _fee_limit {
+ return C4::Context->preference('noissuescharge') || 5;