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

(-)a/C4/Circulation.pm (-29 lines)
Lines 275-284 is a reference-to-hash which may have any of the following keys: Link Here
275
275
276
There is no item in the catalog with the given barcode. The value is C<$barcode>.
276
There is no item in the catalog with the given barcode. The value is C<$barcode>.
277
277
278
=item C<IsPermanent>
279
280
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.
281
282
=item C<DestinationEqualsHolding>
278
=item C<DestinationEqualsHolding>
283
279
284
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.
280
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 333-347 sub transferbook { Link Here
333
        }
329
        }
334
    }
330
    }
335
331
336
    # if is permanent...
337
    # FIXME Is this still used by someone?
338
    # See other FIXME in AddReturn
339
    my $library = Koha::Libraries->find($hbr);
340
    if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
341
        $messages->{'IsPermanent'} = $hbr;
342
        $dotransfer = 0;
343
    }
344
345
    # can't transfer book if is already there....
332
    # can't transfer book if is already there....
346
    if ( $fbr eq $tbr ) {
333
    if ( $fbr eq $tbr ) {
347
        $messages->{'DestinationEqualsHolding'} = 1;
334
        $messages->{'DestinationEqualsHolding'} = 1;
Lines 1758-1769 No item with this barcode exists. The value is C<$barcode>. Link Here
1758
1745
1759
The book is not currently on loan. The value is C<$barcode>.
1746
The book is not currently on loan. The value is C<$barcode>.
1760
1747
1761
=item C<IsPermanent>
1762
1763
The book's home branch is a permanent collection. If you have borrowed
1764
this book, you are not allowed to return it. The value is the code for
1765
the book's home branch.
1766
1767
=item C<withdrawn>
1748
=item C<withdrawn>
1768
1749
1769
This book has been withdrawn/cancelled. The value should be ignored.
1750
This book has been withdrawn/cancelled. The value should be ignored.
Lines 1881-1896 sub AddReturn { Link Here
1881
        }
1862
        }
1882
    }
1863
    }
1883
1864
1884
1885
    # check if the book is in a permanent collection....
1886
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1887
    if ( $returnbranch ) {
1888
        my $library = Koha::Libraries->find($returnbranch);
1889
        if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
1890
            $messages->{'IsPermanent'} = $returnbranch;
1891
        }
1892
    }
1893
1894
    # check if the return is allowed at this branch
1865
    # check if the return is allowed at this branch
1895
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1866
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1896
    unless ($returnallowed){
1867
    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 199-208 foreach my $code ( keys %$messages ) { Link Here
199
            $err{tbr}      = $tbr;
199
            $err{tbr}      = $tbr;
200
            $err{code}     = $typecode;
200
            $err{code}     = $typecode;
201
        }
201
        }
202
        elsif ( $code eq 'IsPermanent' ) {
203
            $err{errispermanent} = 1;
204
            $err{msg} = $messages->{'IsPermanent'};
205
        }
206
        elsif ( $code eq 'WasReturned' ) {
202
        elsif ( $code eq 'WasReturned' ) {
207
            $err{errwasreturned} = 1;
203
            $err{errwasreturned} = 1;
208
            $err{borrowernumber} = $messages->{'WasReturned'};
204
            $err{borrowernumber} = $messages->{'WasReturned'};
(-)a/circ/returns.pl (-8 lines)
Lines 494-500 foreach my $code ( keys %$messages ) { Link Here
494
    elsif ( $code eq 'NotIssued' ) {
494
    elsif ( $code eq 'NotIssued' ) {
495
        $err{notissued} = 1;
495
        $err{notissued} = 1;
496
        $err{msg} = '';
496
        $err{msg} = '';
497
        $err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'};
498
    }
497
    }
499
    elsif ( $code eq 'LocalUse' ) {
498
    elsif ( $code eq 'LocalUse' ) {
500
        $err{localuse} = 1;
499
        $err{localuse} = 1;
Lines 518-529 foreach my $code ( keys %$messages ) { Link Here
518
        $err{withdrawn} = 1;
517
        $err{withdrawn} = 1;
519
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
518
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
520
    }
519
    }
521
    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
522
        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
523
            $err{ispermanent} = 1;
524
            $err{msg}         = $messages->{'IsPermanent'};
525
        }
526
    }
527
    elsif ( $code eq 'WrongTransfer' ) {
520
    elsif ( $code eq 'WrongTransfer' ) {
528
        ;    # FIXME... anything to do here?
521
        ;    # FIXME... anything to do here?
529
    }
522
    }
530
- 

Return to bug 16735