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

(-)a/C4/Circulation.pm (+17 lines)
Lines 50-55 use Koha::Patrons; Link Here
50
use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment );
50
use Koha::Patron::Debarments qw( DelUniqueDebarment AddUniqueDebarment );
51
use Koha::Database;
51
use Koha::Database;
52
use Koha::Libraries;
52
use Koha::Libraries;
53
use Koha::Library::FloatLimits;
53
use Koha::Account::Lines;
54
use Koha::Account::Lines;
54
use Koha::Holds;
55
use Koha::Holds;
55
use Koha::Account::Lines;
56
use Koha::Account::Lines;
Lines 2199-2204 sub AddReturn { Link Here
2199
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2200
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2200
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2201
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2201
2202
2203
    # check library float limits if enabled if the item isn't being transferred away
2204
    if ( ( $returnbranch eq $branch ) && C4::Context->preference('UseLibraryFloatLimits') ) {
2205
        my $effective_itemtype = $item->effective_itemtype;
2206
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2207
        if ($limit) {
2208
            my $count = Koha::Items->count( { itype => $limit->itemtype } );
2209
            if ( $count >= $limit->float_limit ) {
2210
                my $transfer_branchcode = Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch );
2211
                if ( $transfer_branchcode ne $branch ) {
2212
                    $returnbranch     = $transfer_branchcode;
2213
                    $transfer_trigger = 'LibraryFloatLimit';
2214
                }
2215
            }
2216
        }
2217
    }
2218
2202
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2219
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2203
    my $patron_unblessed = $patron ? $patron->unblessed : {};
2220
    my $patron_unblessed = $patron ? $patron->unblessed : {};
2204
2221
(-)a/circ/returns.pl (-9 / +22 lines)
Lines 331-337 if ($barcode && $op eq 'cud-checkin') { Link Here
331
        my $biblio   = $item->biblio;
331
        my $biblio   = $item->biblio;
332
        $template->param(
332
        $template->param(
333
            title                => $biblio->title,
333
            title                => $biblio->title,
334
            returnbranch         => $returnbranch,
335
            author               => $biblio->author,
334
            author               => $biblio->author,
336
            itembiblionumber     => $biblio->biblionumber,
335
            itembiblionumber     => $biblio->biblionumber,
337
            biblionumber         => $biblio->biblionumber,
336
            biblionumber         => $biblio->biblionumber,
Lines 451-456 if ($barcode && $op eq 'cud-checkin') { Link Here
451
        );
450
        );
452
    }
451
    }
453
452
453
    $returnbranch = $messages->{NeedsTransfer} if $messages->{NeedsTransfer};
454
454
    # Mark missing bundle items as lost and report unexpected items
455
    # Mark missing bundle items as lost and report unexpected items
455
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') && !$query->param('do_not_verify_items_bundle_contents') ) {
456
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') && !$query->param('do_not_verify_items_bundle_contents') ) {
456
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
457
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
Lines 538-543 my $recalled = 0; Link Here
538
# new op dev : we check if the document must be returned to his homebranch directly,
539
# new op dev : we check if the document must be returned to his homebranch directly,
539
#  if the document is transferred, we have warning message .
540
#  if the document is transferred, we have warning message .
540
541
542
if ( $messages->{'LibraryFloatLimitTransferRequest'} ) {
543
    $template->param(
544
        LibraryFloatLimitTransferRequest => 1,
545
        itemnumber     => $itemnumber,
546
    );
547
}
548
541
if ( $messages->{'WasTransfered'} ) {
549
if ( $messages->{'WasTransfered'} ) {
542
    $template->param(
550
    $template->param(
543
        found          => 1,
551
        found          => 1,
Lines 771-776 foreach my $code ( keys %$messages ) { Link Here
771
        ;
779
        ;
772
    } elsif ( $code eq 'TransferredRecall' ) {
780
    } elsif ( $code eq 'TransferredRecall' ) {
773
        ;
781
        ;
782
    } elsif ( $code eq 'LibraryFloatLimitTransferRequest' ) {
783
        ;
774
    } elsif ( $code eq 'InBundle' ) {
784
    } elsif ( $code eq 'InBundle' ) {
775
        $template->param( InBundle => $messages->{InBundle} );
785
        $template->param( InBundle => $messages->{InBundle} );
776
    } else {
786
    } else {
Lines 854-867 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
854
}
864
}
855
865
856
$template->param(
866
$template->param(
857
    riloop         => \@riloop,
867
    riloop                   => \@riloop,
858
    errmsgloop     => \@errmsgloop,
868
    errmsgloop               => \@errmsgloop,
859
    exemptfine     => $exemptfine,
869
    exemptfine               => $exemptfine,
860
    dropboxmode    => $dropboxmode,
870
    dropboxmode              => $dropboxmode,
861
    dropboxdate    => $dropboxdate,
871
    dropboxdate              => $dropboxdate,
862
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
872
    forgivemanualholdsexpire => $forgivemanualholdsexpire,
863
    overduecharges => $overduecharges,
873
    overduecharges           => $overduecharges,
864
    AudioAlerts        => C4::Context->preference("AudioAlerts"),
874
    AudioAlerts              => C4::Context->preference("AudioAlerts"),
865
);
875
);
866
876
867
if ( $barcode ) {
877
if ( $barcode ) {
Lines 882-888 if ( $barcode ) { Link Here
882
    }
892
    }
883
}
893
}
884
894
885
$template->param( itemnumber => $itemnumber );
895
$template->param(
896
    itemnumber   => $itemnumber,
897
    returnbranch => $returnbranch,
898
);
886
899
887
# Checking if there is a Fast Cataloging Framework
900
# Checking if there is a Fast Cataloging Framework
888
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
901
$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 108-113 Link Here
108
                    <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
                    <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>
109
                    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
109
                    <dt><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></dt>
110
                    <dd>Define transport costs between branches</dd>
110
                    <dd>Define transport costs between branches</dd>
111
                    <dt><a href="/cgi-bin/koha/admin/float_limits.pl">Library float limits</a></dt>
112
                    <dd>Define when items should be transferred to other libraries on checkin to balance floating collections</dd>
111
                [% END %]
113
                [% END %]
112
                [% IF ( CAN_user_parameters_manage_item_circ_alerts ) %]
114
                [% IF ( CAN_user_parameters_manage_item_circ_alerts ) %]
113
                    <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
115
                    <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 127-132 Link Here
127
                                     <h3>Reason for transfer</h3>
127
                                     <h3>Reason for transfer</h3>
128
                                     <p>
128
                                     <p>
129
                                         [%- SWITCH trigger -%]
129
                                         [%- SWITCH trigger -%]
130
                                             [%- CASE 'LibraryFloatLimit' -%]<span>Library has exceeded float limit for this item type</span>
130
                                             [%- CASE 'Manual' -%]<span>Manual</span>
131
                                             [%- CASE 'Manual' -%]<span>Manual</span>
131
                                             [%- CASE 'StockrotationAdvance' -%]<span>Stock rotation advance</span>
132
                                             [%- CASE 'StockrotationAdvance' -%]<span>Stock rotation advance</span>
132
                                             [%- CASE 'StockrotationRepatriation' -%]<span>Stock rotation repatriation</span>
133
                                             [%- CASE 'StockrotationRepatriation' -%]<span>Stock rotation repatriation</span>
Lines 754-760 Link Here
754
755
755
                                                <div class="modal-header">
756
                                                <div class="modal-header">
756
                                                    <h3>
757
                                                    <h3>
757
                                                        Please return this item to [% IF transfer %][% Branches.GetName( transfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
758
                                                        Please return this item to [% IF transfer || needstransfer %][% Branches.GetName( transfer || needstransfer ) | html %][% ELSE %][% Branches.GetName( returnbranch ) | html %][% END %]
758
                                                    </h3>
759
                                                    </h3>
759
                                                </div>
760
                                                </div>
760
                                                <div class="modal-body">
761
                                                <div class="modal-body">
761
- 

Return to bug 28530