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 2244-2249 sub AddReturn { Link Here
2244
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2245
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2245
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2246
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2246
2247
2248
    # check library float limits if enabled if the item isn't being transferred away
2249
    if ( ( $returnbranch eq $branch ) && C4::Context->preference('UseLibraryFloatLimits') ) {
2250
        my $effective_itemtype = $item->effective_itemtype;
2251
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2252
        if ($limit) {
2253
            my $count = Koha::Items->count( { itype => $limit->itemtype } );
2254
            if ( $count >= $limit->float_limit ) {
2255
                my $transfer_branchcode = Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch );
2256
                if ( $transfer_branchcode ne $branch ) {
2257
                    $returnbranch     = $transfer_branchcode;
2258
                    $transfer_trigger = 'LibraryFloatLimit';
2259
                }
2260
            }
2261
        }
2262
    }
2263
2247
    my $borrowernumber   = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2264
    my $borrowernumber   = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2248
    my $patron_unblessed = $patron ? $patron->unblessed      : {};
2265
    my $patron_unblessed = $patron ? $patron->unblessed      : {};
2249
2266
(-)a/circ/returns.pl (-2 / +15 lines)
Lines 332-338 if ( $barcode && ( $op eq 'cud-checkin' || $op eq 'cud-affect_reserve' ) ) { Link Here
332
        my $biblio   = $item->biblio;
332
        my $biblio   = $item->biblio;
333
        $template->param(
333
        $template->param(
334
            title                => $biblio->title,
334
            title                => $biblio->title,
335
            returnbranch         => $returnbranch,
336
            author               => $biblio->author,
335
            author               => $biblio->author,
337
            itembiblionumber     => $biblio->biblionumber,
336
            itembiblionumber     => $biblio->biblionumber,
338
            biblionumber         => $biblio->biblionumber,
337
            biblionumber         => $biblio->biblionumber,
Lines 457-462 if ( $barcode && ( $op eq 'cud-checkin' || $op eq 'cud-affect_reserve' ) ) { Link Here
457
        );
456
        );
458
    }
457
    }
459
458
459
    $returnbranch = $messages->{NeedsTransfer} if $messages->{NeedsTransfer};
460
460
    # Mark missing bundle items as lost and report unexpected items
461
    # Mark missing bundle items as lost and report unexpected items
461
    if (   $item
462
    if (   $item
462
        && $item->is_bundle
463
        && $item->is_bundle
Lines 553-558 my $recalled = 0; Link Here
553
# new op dev : we check if the document must be returned to his homebranch directly,
554
# new op dev : we check if the document must be returned to his homebranch directly,
554
#  if the document is transferred, we have warning message .
555
#  if the document is transferred, we have warning message .
555
556
557
if ( $messages->{'LibraryFloatLimitTransferRequest'} ) {
558
    $template->param(
559
        LibraryFloatLimitTransferRequest => 1,
560
        itemnumber                       => $itemnumber,
561
    );
562
}
563
556
if ( $messages->{'WasTransfered'} ) {
564
if ( $messages->{'WasTransfered'} ) {
557
    $template->param(
565
    $template->param(
558
        found      => 1,
566
        found      => 1,
Lines 776-781 foreach my $code ( keys %$messages ) { Link Here
776
        ;
784
        ;
777
    } elsif ( $code eq 'TransferredRecall' ) {
785
    } elsif ( $code eq 'TransferredRecall' ) {
778
        ;
786
        ;
787
    } elsif ( $code eq 'LibraryFloatLimitTransferRequest' ) {
788
        ;
779
    } elsif ( $code eq 'InBundle' ) {
789
    } elsif ( $code eq 'InBundle' ) {
780
        $template->param( InBundle => $messages->{InBundle} );
790
        $template->param( InBundle => $messages->{InBundle} );
781
    } else {
791
    } else {
Lines 890-896 if ($barcode) { Link Here
890
    }
900
    }
891
}
901
}
892
902
893
$template->param( itemnumber => $itemnumber );
903
$template->param(
904
    itemnumber   => $itemnumber,
905
    returnbranch => $returnbranch,
906
);
894
907
895
# Checking if there is a Fast Cataloging Framework
908
# Checking if there is a Fast Cataloging Framework
896
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find('FA');
909
$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
                        >
108
                        >
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 (-1 / +2 lines)
Lines 119-124 Link Here
119
                <p>
119
                <p>
120
                    [%- SWITCH trigger -%]
120
                    [%- SWITCH trigger -%]
121
121
122
                    [%- CASE 'LibraryFloatLimit' -%]
123
                        <span>Library has exceeded float limit for this item type</span>
122
                    [%- CASE 'Manual' -%]
124
                    [%- CASE 'Manual' -%]
123
                        <span>Manual</span>
125
                        <span>Manual</span>
124
                    [%- CASE 'StockrotationAdvance' -%]
126
                    [%- CASE 'StockrotationAdvance' -%]
125
- 

Return to bug 28530