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

(-)a/C4/Circulation.pm (-29 lines)
Lines 278-287 is a reference-to-hash which may have any of the following keys: Link Here
278
278
279
There is no item in the catalog with the given barcode. The value is C<$barcode>.
279
There is no item in the catalog with the given barcode. The value is C<$barcode>.
280
280
281
=item C<IsPermanent>
282
283
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.
284
285
=item C<DestinationEqualsHolding>
281
=item C<DestinationEqualsHolding>
286
282
287
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.
283
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 336-350 sub transferbook { Link Here
336
        }
332
        }
337
    }
333
    }
338
334
339
    # if is permanent...
340
    # FIXME Is this still used by someone?
341
    # See other FIXME in AddReturn
342
    my $library = Koha::Libraries->find($hbr);
343
    if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
344
        $messages->{'IsPermanent'} = $hbr;
345
        $dotransfer = 0;
346
    }
347
348
    # can't transfer book if is already there....
335
    # can't transfer book if is already there....
349
    if ( $fbr eq $tbr ) {
336
    if ( $fbr eq $tbr ) {
350
        $messages->{'DestinationEqualsHolding'} = 1;
337
        $messages->{'DestinationEqualsHolding'} = 1;
Lines 1766-1777 No item with this barcode exists. The value is C<$barcode>. Link Here
1766
1753
1767
The book is not currently on loan. The value is C<$barcode>.
1754
The book is not currently on loan. The value is C<$barcode>.
1768
1755
1769
=item C<IsPermanent>
1770
1771
The book's home branch is a permanent collection. If you have borrowed
1772
this book, you are not allowed to return it. The value is the code for
1773
the book's home branch.
1774
1775
=item C<withdrawn>
1756
=item C<withdrawn>
1776
1757
1777
This book has been withdrawn/cancelled. The value should be ignored.
1758
This book has been withdrawn/cancelled. The value should be ignored.
Lines 1886-1901 sub AddReturn { Link Here
1886
        }
1867
        }
1887
    }
1868
    }
1888
1869
1889
1890
    # check if the book is in a permanent collection....
1891
    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
1892
    if ( $returnbranch ) {
1893
        my $library = Koha::Libraries->find($returnbranch);
1894
        if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
1895
            $messages->{'IsPermanent'} = $returnbranch;
1896
        }
1897
    }
1898
1899
    # check if the return is allowed at this branch
1870
    # check if the return is allowed at this branch
1900
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1871
    my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
1901
    unless ($returnallowed){
1872
    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 206-215 foreach my $code ( keys %$messages ) { Link Here
206
            $err{tbr}      = $tbr;
206
            $err{tbr}      = $tbr;
207
            $err{code}     = $typecode;
207
            $err{code}     = $typecode;
208
        }
208
        }
209
        elsif ( $code eq 'IsPermanent' ) {
210
            $err{errispermanent} = 1;
211
            $err{msg} = $messages->{'IsPermanent'};
212
        }
213
        elsif ( $code eq 'WasReturned' ) {
209
        elsif ( $code eq 'WasReturned' ) {
214
            $err{errwasreturned} = 1;
210
            $err{errwasreturned} = 1;
215
            $err{borrowernumber} = $messages->{'WasReturned'};
211
            $err{borrowernumber} = $messages->{'WasReturned'};
(-)a/circ/returns.pl (-8 lines)
Lines 498-504 foreach my $code ( keys %$messages ) { Link Here
498
    elsif ( $code eq 'NotIssued' ) {
498
    elsif ( $code eq 'NotIssued' ) {
499
        $err{notissued} = 1;
499
        $err{notissued} = 1;
500
        $err{msg} = '';
500
        $err{msg} = '';
501
        $err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'};
502
    }
501
    }
503
    elsif ( $code eq 'LocalUse' ) {
502
    elsif ( $code eq 'LocalUse' ) {
504
        $err{localuse} = 1;
503
        $err{localuse} = 1;
Lines 523-534 foreach my $code ( keys %$messages ) { Link Here
523
        $err{withdrawn} = 1;
522
        $err{withdrawn} = 1;
524
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
523
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
525
    }
524
    }
526
    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
527
        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
528
            $err{ispermanent} = 1;
529
            $err{msg}         = $messages->{'IsPermanent'};
530
        }
531
    }
532
    elsif ( $code eq 'WrongTransfer' ) {
525
    elsif ( $code eq 'WrongTransfer' ) {
533
        ;    # FIXME... anything to do here?
526
        ;    # FIXME... anything to do here?
534
    }
527
    }
535
- 

Return to bug 16735