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

(-)a/C4/Circulation.pm (-6 / +25 lines)
Lines 42-47 use C4::Koha qw( Link Here
42
    GetKohaAuthorisedValueLib
42
    GetKohaAuthorisedValueLib
43
);
43
);
44
use C4::Overdues qw(CalcFine UpdateFine);
44
use C4::Overdues qw(CalcFine UpdateFine);
45
use C4::RotatingCollections qw(GetCollectionItemBranches);
45
use Algorithm::CheckDigits;
46
use Algorithm::CheckDigits;
46
47
47
use Data::Dumper;
48
use Data::Dumper;
Lines 1911-1925 sub AddReturn { Link Here
1911
    logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'})
1912
    logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'})
1912
        if C4::Context->preference("ReturnLog");
1913
        if C4::Context->preference("ReturnLog");
1913
    
1914
    
1914
    # FIXME: make this comment intelligible.
1915
    # IF 
1915
    #adding message if holdingbranch is non equal a userenv branch to return the document to homebranch
1916
    # a) The item is so far returnable or hasn't been issued
1916
    #we check, if we don't have reserv or transfert for this document, if not, return it to homebranch .
1917
    # b) There is no hold for this item for pickup at this branch
1917
1918
    # c) The item's branch is not this branch
1918
    if (($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $hbr) and not $messages->{'WrongTransfer'}){
1919
    # c) The should not have been transferred to another branch instead of this one
1920
    # d) The item is not part of a rotating collection that is currently at this branch
1921
    # THEN this return should be considered a transfer
1922
    # 
1923
    # This transfer should be considered valid UNLESS
1924
    # a) AutomaticItemReturn is enabled
1925
    # OR
1926
    # b) There is branch transfer limit that should prevent this item from being transfered to this branch
1927
    #
1928
    # If the transfer is not valid, a new transfer back to the item's branch will be created
1929
    if (
1930
                ( $doreturn or $messages->{'NotIssued'} ) 
1931
            and !$resfound 
1932
            and $branch ne $hbr 
1933
            and !$messages->{'WrongTransfer'} 
1934
            and [GetCollectionItemBranches( $item->{'itemnumber'} )]->[1] ne $branch
1935
    ){
1919
        if ( C4::Context->preference("AutomaticItemReturn"    ) or
1936
        if ( C4::Context->preference("AutomaticItemReturn"    ) or
1920
            (C4::Context->preference("UseBranchTransferLimits") and
1937
            (C4::Context->preference("UseBranchTransferLimits") and
1921
             ! IsBranchTransferAllowed($branch, $hbr, $item->{C4::Context->preference("BranchTransferLimitsType")} )
1938
             ! IsBranchTransferAllowed($branch, $hbr, $item->{C4::Context->preference("BranchTransferLimitsType")} )
1922
           )) {
1939
           )
1940
            ) {
1923
            $debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $hbr;
1941
            $debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $hbr;
1924
            $debug and warn "item: " . Dumper($item);
1942
            $debug and warn "item: " . Dumper($item);
1925
            ModItemTransfer($item->{'itemnumber'}, $branch, $hbr);
1943
            ModItemTransfer($item->{'itemnumber'}, $branch, $hbr);
Lines 1928-1933 sub AddReturn { Link Here
1928
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
1946
            $messages->{'NeedsTransfer'} = 1;   # TODO: instead of 1, specify branchcode that the transfer SHOULD go to, $item->{homebranch}
1929
        }
1947
        }
1930
    }
1948
    }
1949
1931
    return ( $doreturn, $messages, $issue, $borrower );
1950
    return ( $doreturn, $messages, $issue, $borrower );
1932
}
1951
}
1933
1952
(-)a/C4/RotatingCollections.pm (-4 / +2 lines)
Lines 343-350 sub AddItemToCollection { Link Here
343
    $sth = $dbh->prepare("
343
    $sth = $dbh->prepare("
344
        INSERT INTO collections_tracking (
344
        INSERT INTO collections_tracking (
345
            ctId,
345
            ctId,
346
            colId, i
346
            colId,
347
            temnumber
347
            itemnumber
348
        ) VALUES ( NULL, ?, ? )
348
        ) VALUES ( NULL, ?, ? )
349
    ");
349
    ");
350
    $sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() );
350
    $sth->execute( $colId, $itemnumber ) or return ( 0, 3, $sth->errstr() );
Lines 480-487 sub GetCollectionItemBranches { Link Here
480
480
481
    my $row = $sth->fetchrow_hashref;
481
    my $row = $sth->fetchrow_hashref;
482
482
483
    $sth->finish;
484
485
    return ( $$row{'holdingbranch'}, $$row{'colBranchcode'}, );
483
    return ( $$row{'holdingbranch'}, $$row{'colBranchcode'}, );
486
}
484
}
487
485
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 67-73 $(document).ready(function () { Link Here
67
[% END %]
67
[% END %]
68
68
69
[% IF ( collectionItemNeedsTransferred ) %]
69
[% IF ( collectionItemNeedsTransferred ) %]
70
	<div id="rotating-collection" class="dialog message">This item is part of a Rotating Collection and needs to be Transferred to [% collectionBranch %]</div>
70
	<div id="rotating-collection" class="dialog message">This item is part of a rotating collection and needs to be transferred to [% collectionBranch %]</div>
71
[% END %]
71
[% END %]
72
72
73
<!-- Patron has fines -->
73
<!-- Patron has fines -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt (-4 / +7 lines)
Lines 44-56 Link Here
44
      <div>
44
      <div>
45
        [% IF ( collectionsLoop ) %]
45
        [% IF ( collectionsLoop ) %]
46
          <table>
46
          <table>
47
           <thead>
47
            <tr>
48
            <tr>
48
              <th>Title</th>
49
              <th>Title</th>
49
              <th>Description</th>
50
              <th>Description</th>
50
              <th>Holding library</th>
51
              <th>Holding library</th>
51
              <td></td>
52
              <th>&nbsp;</th>
52
              <td></td>
53
              <th>&nbsp;</th>
53
            </tr>
54
            </tr>
55
           <thead>
56
           <tbody>
54
            [% FOREACH collectionsLoo IN collectionsLoop %]
57
            [% FOREACH collectionsLoo IN collectionsLoop %]
55
              <tr>
58
              <tr>
56
                <td>[% collectionsLoo.colTitle %]</td>
59
                <td>[% collectionsLoo.colTitle %]</td>
Lines 60-65 Link Here
60
                <td><a href="editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
63
                <td><a href="editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
61
              </tr>
64
              </tr>
62
            [% END %]
65
            [% END %]
66
           </tbody>
63
          </table>
67
          </table>
64
        [% ELSE %]
68
        [% ELSE %]
65
          There are no collections currently defined.
69
          There are no collections currently defined.
Lines 99-105 Link Here
99
                <label for="description">Description: </label>
103
                <label for="description">Description: </label>
100
              </td>
104
              </td>
101
              <td>
105
              <td>
102
                [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[ editColDescription %]" />
106
                [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[% editColDescription %]" />
103
                [% ELSE %]<input type="text" size="50" name="description" />[% END %]
107
                [% ELSE %]<input type="text" size="50" name="description" />[% END %]
104
              </td>
108
              </td>
105
            </tr>
109
            </tr>
106
- 

Return to bug 8836