Bug 25261: Checkout confirmation depending on syspref
authorFrédéric Demians <f.demians@tamil.fr>
Thu, 30 Apr 2020 10:03:19 +0000 (12:03 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 1 Oct 2020 08:33:10 +0000 (10:33 +0200)
With this follow-up patch, the intended confirmation of checkin based on
CircConfirmParts value is effective.

Sponsored-by: Royal College of Music [https://www.rcm.ac.uk/]
Sponsored-by: PTFS Europe [https://ptfs-europe.com/]
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm

index cf638ab..a3b2f02 100644 (file)
@@ -898,9 +898,11 @@ sub CanBookBeIssued {
     }
 
     # Additional Materials Check
-    my $no_of_parts = $item_object->materials;
-    if ( $no_of_parts > 0 ) {
-        $needsconfirmation{additional_materials} = $no_of_parts;
+    if ( C4::Context->preference("CircConfirmParts") ) {
+        my $no_of_parts = $item_object->materials || 0;
+        if ( $no_of_parts > 0 ) {
+            $needsconfirmation{additional_materials} = $no_of_parts;
+        }
     }
 
     #