Bug 21796: Don't unlock checkouts if restriction exists but fines are below limit
[koha.git] / circ / circulation.pl
index 9ddf3d5..98b011b 100755 (executable)
@@ -352,7 +352,7 @@ if (@$barcodes) {
 
     if ( $item ) {
         $biblio = $item->biblio;
-        my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } });
+        my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
         $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
     }
 
@@ -487,7 +487,7 @@ if ( $patron ) {
     my $account = $patron->account;
     if( ( my $owing = $account->non_issues_charges ) > 0 ) {
         my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why??
-        $noissues = ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) );
+        $noissues ||= ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) );
         $template->param(
             charges => 1,
             chargesamount => $owing,
@@ -537,12 +537,6 @@ if ( $patron ) {
     }
 }
 
-if ( $patron && $patron->is_child) {
-    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
-    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
-    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
-}
-
 my $messages = Koha::Patron::Messages->search(
     {
         'me.borrowernumber' => $borrowernumber,