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 2247-2252 sub AddReturn { Link Here
2247
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2248
    # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
2248
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2249
    my $transfer_trigger = $hbr eq 'homebranch' ? 'ReturnToHome' : $hbr eq 'holdingbranch' ? 'ReturnToHolding' : undef;
2249
2250
2251
    # check library float limits if enabled if the item isn't being transferred away
2252
    if ( ( $returnbranch eq $branch ) && C4::Context->preference('UseLibraryFloatLimits') ) {
2253
        my $effective_itemtype = $item->effective_itemtype;
2254
        my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } );
2255
        if ($limit) {
2256
            my $count = Koha::Items->count( { itype => $limit->itemtype } );
2257
            if ( $count >= $limit->float_limit ) {
2258
                my $transfer_branchcode = Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch );
2259
                if ( $transfer_branchcode ne $branch ) {
2260
                    $returnbranch     = $transfer_branchcode;
2261
                    $transfer_trigger = 'LibraryFloatLimit';
2262
                }
2263
            }
2264
        }
2265
    }
2266
2250
    my $borrowernumber   = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2267
    my $borrowernumber   = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
2251
    my $patron_unblessed = $patron ? $patron->unblessed      : {};
2268
    my $patron_unblessed = $patron ? $patron->unblessed      : {};
2252
2269
(-)a/circ/returns.pl (-2 / +15 lines)
Lines 303-309 if ( $barcode && ( $op eq 'cud-checkin' || $op eq 'cud-affect_reserve' ) ) { Link Here
303
        my $biblio   = $item->biblio;
303
        my $biblio   = $item->biblio;
304
        $template->param(
304
        $template->param(
305
            title                => $biblio->title,
305
            title                => $biblio->title,
306
            returnbranch         => $returnbranch,
307
            author               => $biblio->author,
306
            author               => $biblio->author,
308
            itembiblionumber     => $biblio->biblionumber,
307
            itembiblionumber     => $biblio->biblionumber,
309
            biblionumber         => $biblio->biblionumber,
308
            biblionumber         => $biblio->biblionumber,
Lines 413-418 if ( $barcode && ( $op eq 'cud-checkin' || $op eq 'cud-affect_reserve' ) ) { Link Here
413
        );
412
        );
414
    }
413
    }
415
414
415
    $returnbranch = $messages->{NeedsTransfer} if $messages->{NeedsTransfer};
416
416
    # Mark missing bundle items as lost and report unexpected items
417
    # Mark missing bundle items as lost and report unexpected items
417
    if (   $item
418
    if (   $item
418
        && $item->is_bundle
419
        && $item->is_bundle
Lines 509-514 my $recalled = 0; Link Here
509
# new op dev : we check if the document must be returned to his homebranch directly,
510
# new op dev : we check if the document must be returned to his homebranch directly,
510
#  if the document is transferred, we have warning message .
511
#  if the document is transferred, we have warning message .
511
512
513
if ( $messages->{'LibraryFloatLimitTransferRequest'} ) {
514
    $template->param(
515
        LibraryFloatLimitTransferRequest => 1,
516
        itemnumber                       => $itemnumber,
517
    );
518
}
519
512
if ( $messages->{'WasTransfered'} ) {
520
if ( $messages->{'WasTransfered'} ) {
513
    $template->param(
521
    $template->param(
514
        found      => 1,
522
        found      => 1,
Lines 732-737 foreach my $code ( keys %$messages ) { Link Here
732
        ;
740
        ;
733
    } elsif ( $code eq 'TransferredRecall' ) {
741
    } elsif ( $code eq 'TransferredRecall' ) {
734
        ;
742
        ;
743
    } elsif ( $code eq 'LibraryFloatLimitTransferRequest' ) {
744
        ;
735
    } elsif ( $code eq 'InBundle' ) {
745
    } elsif ( $code eq 'InBundle' ) {
736
        $template->param( InBundle => $messages->{InBundle} );
746
        $template->param( InBundle => $messages->{InBundle} );
737
    } else {
747
    } else {
Lines 808-814 if ($barcode) { Link Here
808
    }
818
    }
809
}
819
}
810
820
811
$template->param( itemnumber => $itemnumber );
821
$template->param(
822
    itemnumber   => $itemnumber,
823
    returnbranch => $returnbranch,
824
);
812
825
813
# Checking if there is a Fast Cataloging Framework
826
# Checking if there is a Fast Cataloging Framework
814
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find('FA');
827
$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