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

(-)a/C4/Circulation.pm (+17 lines)
Lines 51-56 use Koha::Patrons; Link Here
51
use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment );
51
use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment );
52
use Koha::Database;
52
use Koha::Database;
53
use Koha::Libraries;
53
use Koha::Libraries;
54
use Koha::Library::FloatLimits;
54
use Koha::Account::Lines;
55
use Koha::Account::Lines;
55
use Koha::Holds;
56
use Koha::Holds;
56
use Koha::Account::Lines;
57
use Koha::Account::Lines;
Lines 2206-2211 sub AddReturn { Link Here
2206
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2207
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2207
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2208
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2208
2209
2210
    # check library float limits if enabled if the item isn't being transferred away
2211
    if ( ( $returnbranch eq $branch ) && C4::Context->preference('UseLibraryFloatLimits') ) {
2212
        my $effective_itemtype = $item->effective_itemtype;
2213
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2214
        if ($limit) {
2215
            my $count = Koha::Items->count( { itype => $limit->itemtype } );
2216
            if ( $count >= $limit->float_limit ) {
2217
                my $transfer_branchcode = Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch );
2218
                if ( $transfer_branchcode ne $branch ) {
2219
                    $returnbranch     = $transfer_branchcode;
2220
                    $transfer_trigger = 'LibraryFloatLimit';
2221
                }
2222
            }
2223
        }
2224
    }
2225
2209
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2226
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2210
    my $patron_unblessed = $patron ? $patron->unblessed : {};
2227
    my $patron_unblessed = $patron ? $patron->unblessed : {};
2211
2228
(-)a/circ/returns.pl (-9 / +22 lines)
Lines 320-326 if ($barcode) { Link Here
320
        my $biblio   = $item->biblio;
320
        my $biblio   = $item->biblio;
321
        $template->param(
321
        $template->param(
322
            title                => $biblio->title,
322
            title                => $biblio->title,
323
            returnbranch         => $returnbranch,
324
            author               => $biblio->author,
323
            author               => $biblio->author,
325
            itembiblionumber     => $biblio->biblionumber,
324
            itembiblionumber     => $biblio->biblionumber,
326
            biblionumber         => $biblio->biblionumber,
325
            biblionumber         => $biblio->biblionumber,
Lines 430-435 if ($barcode) { Link Here
430
        );
429
        );
431
    }
430
    }
432
431
432
    $returnbranch = $messages->{NeedsTransfer} if $messages->{NeedsTransfer};
433
433
    # Mark missing bundle items as lost and report unexpected items
434
    # Mark missing bundle items as lost and report unexpected items
434
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') && !$query->param('do_not_verify_items_bundle_contents') ) {
435
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') && !$query->param('do_not_verify_items_bundle_contents') ) {
435
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
436
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
Lines 517-522 my $recalled = 0; Link Here
517
# new op dev : we check if the document must be returned to his homebranch directly,
518
# new op dev : we check if the document must be returned to his homebranch directly,
518
#  if the document is transferred, we have warning message .
519
#  if the document is transferred, we have warning message .
519
520
521
if ( $messages->{'LibraryFloatLimitTransferRequest'} ) {
522
    $template->param(
523
        LibraryFloatLimitTransferRequest => 1,
524
        itemnumber     => $itemnumber,
525
    );
526
}
527
520
if ( $messages->{'WasTransfered'} ) {
528
if ( $messages->{'WasTransfered'} ) {
521
    $template->param(
529
    $template->param(
522
        found          => 1,
530
        found          => 1,
Lines 744-749 foreach my $code ( keys %$messages ) { Link Here
744
        ;
752
        ;
745
    } elsif ( $code eq 'TransferredRecall' ) {
753
    } elsif ( $code eq 'TransferredRecall' ) {
746
        ;
754
        ;
755
    } elsif ( $code eq 'LibraryFloatLimitTransferRequest' ) {
756
        ;
747
    } elsif ( $code eq 'InBundle' ) {
757
    } elsif ( $code eq 'InBundle' ) {
748
        $template->param( InBundle => $messages->{InBundle} );
758
        $template->param( InBundle => $messages->{InBundle} );
749
    } else {
759
    } else {
Lines 824-837 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
824
}
834
}
825
835
826
$template->param(
836
$template->param(
827
    riloop         => \@riloop,
837
    riloop                   => \@riloop,
828
    errmsgloop     => \@errmsgloop,
838
    errmsgloop               => \@errmsgloop,
829
    exemptfine     => $exemptfine,
839
    exemptfine               => $exemptfine,
830
    dropboxmode    => $dropboxmode,
840
    dropboxmode              => $dropboxmode,
831
    dropboxdate    => $dropboxdate,
841
    dropboxdate              => $dropboxdate,
832
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
842
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
833
    overduecharges => $overduecharges,
843
    overduecharges           => $overduecharges,
834
    AudioAlerts        => C4::Context->preference("AudioAlerts"),
844
    AudioAlerts              => C4::Context->preference("AudioAlerts"),
835
);
845
);
836
846
837
if ( $barcode ) {
847
if ( $barcode ) {
Lines 852-858 if ( $barcode ) { Link Here
852
    }
862
    }
853
}
863
}
854
864
855
$template->param( itemnumber => $itemnumber );
865
$template->param(
866
    itemnumber   => $itemnumber,
867
    returnbranch => $returnbranch,
868
);
856
869
857
# Checking if there is a Fast Cataloging Framework
870
# Checking if there is a Fast Cataloging Framework
858
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
871
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt (+2 lines)
Lines 107-112 Link Here
107
                    <dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON</dd>
107
                    <dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON</dd>
108
                    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
108
                    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
109
                    <dd>Define transport costs between branches</dd>
109
                    <dd>Define transport costs between branches</dd>
110
                    <dt><a href="/cgi-bin/koha/admin/float_limits.pl">Library float limits</a></dt>
111
                    <dd>Define when items should be transferred to other libraries on checkin to balance floating collections</dd>
110
                [% END %]
112
                [% END %]
111
                [% IF ( CAN_user_parameters_manage_item_circ_alerts ) %]
113
                [% IF ( CAN_user_parameters_manage_item_circ_alerts ) %]
112
                    <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
114
                    <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 126-131 Link Here
126
                                     <h3>Reason for transfer</h3>
126
                                     <h3>Reason for transfer</h3>
127
                                     <p>
127
                                     <p>
128
                                         [%- SWITCH trigger -%]
128
                                         [%- SWITCH trigger -%]
129
                                             [%- CASE 'LibraryFloatLimit' -%]<span>Library has exceeded float limit for this item type</span>
129
                                             [%- CASE 'Manual' -%]<span>Manual</span>
130
                                             [%- CASE 'Manual' -%]<span>Manual</span>
130
                                             [%- CASE 'StockrotationAdvance' -%]<span>Stock rotation advance</span>
131
                                             [%- CASE 'StockrotationAdvance' -%]<span>Stock rotation advance</span>
131
                                             [%- CASE 'StockrotationRepatriation' -%]<span>Stock rotation repatriation</span>
132
                                             [%- CASE 'StockrotationRepatriation' -%]<span>Stock rotation repatriation</span>
Lines 737-743 Link Here
737
738
738
                                                <div class="modal-header">
739
                                                <div class="modal-header">
739
                                                    <h3>
740
                                                    <h3>
740
                                                        Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
741
                                                        Please return this item to [% IF transfer || needstransfer %][% Branches.GetName( transfer || needstransfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
741
                                                    </h3>
742
                                                    </h3>
742
                                                </div>
743
                                                </div>
743
                                                <div class="modal-body">
744
                                                <div class="modal-body">
744
- 

Return to bug 28530