From 79befda127f563e15f1c77d7a07e8baae9294994 Mon Sep 17 00:00:00 2001 From: bob_lyon Date: Wed, 7 Jun 2006 01:56:57 +0000 Subject: [PATCH] Merging Katipo changes... Adding the allowance for making issuing impossible after a patron has accumulated a certain level of debt --- C4/Circulation/Circ2.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 1d6170c9f1..331b04eb04 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -765,7 +765,7 @@ sub TooMany ($$){ sub canbookbeissued { - my ($env,$borrower,$barcode,$year,$month,$day) = @_; + my ($env,$borrower,$barcode,$year,$month,$day,$inprocess) = @_; my %needsconfirmation; # filled with problems that needs confirmations my %issuingimpossible; # filled with problems that causes the issue to be IMPOSSIBLE my $iteminformation = getiteminformation($env, 0, $barcode); @@ -797,11 +797,19 @@ sub canbookbeissued { # DEBTS my $amount = checkaccount($env,$borrower->{'borrowernumber'}, $dbh,$duedate); - if ($amount >0) { + if($C4::Context->preference("IssuingInProcess")){ + my $amountlimit = $C4::Context->preference("maxoutstanding"); + if ($amount > $amountlimit && !$inprocess) { + $issuingimpossible{DEBT} = sprintf("%.2f",$amount); + } elsif ($amount <= $amountlimit && !$inprocess) { + $needsconfirmation{DEBT} = sprintf("%.2f",$amount); + } + } else { + if ($amount >0) { $needsconfirmation{DEBT} = $amount; + } } - # # JB34 CHECKS IF BORROWERS DONT HAVE ISSUE TOO MANY BOOKS # -- 2.39.5