View | Details | Raw Unified | Return to bug 16735
Collapse All | Expand All

(-)a/C4/Circulation.pm (-29 lines)
Lines 277-286 is a reference-to-hash which may have any of the following keys: Link Here
277
277
278
There is no item in the catalog with the given barcode. The value is C<$barcode>.
278
There is no item in the catalog with the given barcode. The value is C<$barcode>.
279
279
280
=item C<IsPermanent>
281
282
The item's home branch is permanent. This doesn't prevent the item from being transferred, though. The value is the code of the item's home branch.
283
284
=item C<DestinationEqualsHolding>
280
=item C<DestinationEqualsHolding>
285
281
286
The item is already at the branch to which it is being transferred. The transfer is nonetheless considered to have failed. The value should be ignored.
282
The item is already at the branch to which it is being transferred. The transfer is nonetheless considered to have failed. The value should be ignored.
Lines 334-348 sub transferbook { Link Here
334
    	}
330
    	}
335
    }
331
    }
336
332
337
    # if is permanent...
338
    # FIXME Is this still used by someone?
339
    # See other FIXME in AddReturn
340
    my $library = Koha::Libraries->find($hbr);
341
    if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
342
        $messages->{'IsPermanent'} = $hbr;
343
        $dotransfer = 0;
344
    }
345
346
    # can't transfer book if is already there....
333
    # can't transfer book if is already there....
347
    if ( $fbr eq $tbr ) {
334
    if ( $fbr eq $tbr ) {
348
        $messages->{'DestinationEqualsHolding'} = 1;
335
        $messages->{'DestinationEqualsHolding'} = 1;
Lines 1770-1781 No item with this barcode exists. The value is C<$barcode>. Link Here
1770
1757
1771
The book is not currently on loan. The value is C<$barcode>.
1758
The book is not currently on loan. The value is C<$barcode>.
1772
1759
1773
=item C<IsPermanent>
1774
1775
The book's home branch is a permanent collection. If you have borrowed
1776
this book, you are not allowed to return it. The value is the code for
1777
the book's home branch.
1778
1779
=item C<withdrawn>
1760
=item C<withdrawn>
1780
1761
1781
This book has been withdrawn/cancelled. The value should be ignored.
1762
This book has been withdrawn/cancelled. The value should be ignored.
Lines 1893-1908 sub AddReturn { Link Here
1893
        }
1874
        }
1894
    }
1875
    }
1895
1876
1896
1897
    # check if the book is in a permanent collection....
1898
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1899
    if ( $returnbranch ) {
1900
        my $library = Koha::Libraries->find($returnbranch);
1901
        if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
1902
            $messages->{'IsPermanent'} = $returnbranch;
1903
        }
1904
    }
1905
1906
    # check if the return is allowed at this branch
1877
    # check if the return is allowed at this branch
1907
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1878
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1908
    unless ($returnallowed){
1879
    unless ($returnallowed){
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-1 / +1 lines)
Lines 67-73 sub do_checkin { Link Here
67
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
67
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
68
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
68
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
69
    $self->alert(!$return);
69
    $self->alert(!$return);
70
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
70
    # ignoring messages: NotIssued, WasLost, WasTransfered
71
71
72
    # biblionumber, biblioitemnumber, itemnumber
72
    # biblionumber, biblioitemnumber, itemnumber
73
    # borrowernumber, reservedate, branchcode
73
    # borrowernumber, reservedate, branchcode
(-)a/circ/branchtransfers.pl (-4 lines)
Lines 200-209 foreach my $code ( keys %$messages ) { Link Here
200
            $err{tbr}      = $tbr;
200
            $err{tbr}      = $tbr;
201
            $err{code}     = $typecode;
201
            $err{code}     = $typecode;
202
        }
202
        }
203
        elsif ( $code eq 'IsPermanent' ) {
204
            $err{errispermanent} = 1;
205
            $err{msg} = $messages->{'IsPermanent'};
206
        }
207
        elsif ( $code eq 'WasReturned' ) {
203
        elsif ( $code eq 'WasReturned' ) {
208
            $err{errwasreturned} = 1;
204
            $err{errwasreturned} = 1;
209
            $err{borrowernumber} = $messages->{'WasReturned'};
205
            $err{borrowernumber} = $messages->{'WasReturned'};
(-)a/circ/returns.pl (-8 lines)
Lines 485-491 foreach my $code ( keys %$messages ) { Link Here
485
    elsif ( $code eq 'NotIssued' ) {
485
    elsif ( $code eq 'NotIssued' ) {
486
        $err{notissued} = 1;
486
        $err{notissued} = 1;
487
        $err{msg} = '';
487
        $err{msg} = '';
488
        $err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'};
489
    }
488
    }
490
    elsif ( $code eq 'LocalUse' ) {
489
    elsif ( $code eq 'LocalUse' ) {
491
        $err{localuse} = 1;
490
        $err{localuse} = 1;
Lines 509-520 foreach my $code ( keys %$messages ) { Link Here
509
        $err{withdrawn} = 1;
508
        $err{withdrawn} = 1;
510
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
509
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
511
    }
510
    }
512
    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
513
        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
514
            $err{ispermanent} = 1;
515
            $err{msg}         = $messages->{'IsPermanent'};
516
        }
517
    }
518
    elsif ( $code eq 'WrongTransfer' ) {
511
    elsif ( $code eq 'WrongTransfer' ) {
519
        ;    # FIXME... anything to do here?
512
        ;    # FIXME... anything to do here?
520
    }
513
    }
521
- 

Return to bug 16735