Bug 12003: Do not calculate next pubdate for irregular subscriptions
[koha_fer] / circ / returns.pl
index 9472797..4abac2e 100755 (executable)
@@ -172,6 +172,14 @@ my $issueinformation;
 my $itemnumber;
 my $barcode     = $query->param('barcode');
 my $exemptfine  = $query->param('exemptfine');
+if (
+  $exemptfine &&
+  !C4::Auth::haspermission(C4::Context->userenv->{'id'}, {'updatecharges' => 'writeoff'})
+) {
+    # silently prevent unauthorized operator from forgiving overdue
+    # fines by manually tweaking form parameters
+    undef $exemptfine;
+}
 my $dropboxmode = $query->param('dropboxmode');
 my $dotransfer  = $query->param('dotransfer');
 my $canceltransfer = $query->param('canceltransfer');
@@ -225,6 +233,16 @@ if ($barcode) {
     # fix up item type for display
     $biblio->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $biblio->{'itype'} : $biblio->{'itemtype'};
 
+    # Check if we should display a checkin message, based on the the item
+    # type of the checked in item
+    my $itemtype = C4::ItemType->get( $biblio->{'itemtype'} );
+    if ( $itemtype->{'checkinmsg'} ) {
+        $template->param(
+            checkinmsg     => $itemtype->{'checkinmsg'},
+            checkinmsgtype => $itemtype->{'checkinmsgtype'},
+        );
+    }
+
     $template->param(
         title            => $biblio->{'title'},
         homebranch       => $biblio->{'homebranch'},
@@ -430,7 +448,7 @@ foreach my $code ( keys %$messages ) {
     elsif ( $code eq 'WasTransfered' ) {
         ;    # FIXME... anything to do here?
     }
-    elsif ( $code eq 'wthdrawn' ) {
+    elsif ( $code eq 'withdrawn' ) {
         $err{withdrawn} = 1;
         $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
     }