Bug 22037: (QA follow-up) Implement use of CHARGES_GUARANTEES

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Kyle M Hall 2019-08-22 09:25:54 -04:00 committed by Martin Renvoize
parent 2e91d33381
commit 9a5e519d70
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 4 additions and 0 deletions

View File

@ -65,8 +65,12 @@ sub new {
$dob and $dob =~ s/-//g; # YYYYMMDD
my $dexpiry = $kp->{dateexpiry};
$dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD
my $fines_amount = $flags->{CHARGES}->{amount}; # This "amount" is the negative balance or the one of the guarantees
$fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
my $guarantees_fines_amount = $flags->{CHARGES_GUARANTEES} ? $flags->{CHARGES_GUARANTEES}->{amount} : 0;
$fines_amount += $guarantees_fines_amount;
my $fee_limit = _fee_limit();
my $fine_blocked = $fines_amount > $fee_limit;
my $circ_blocked =( C4::Context->preference('OverduesBlockCirc') ne "noblock" && defined $flags->{ODUES}->{itemlist} ) ? 1 : 0;