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

(-)a/C4/Circulation.pm (-1 / +5 lines)
Lines 2407-2413 sub AddReturn { Link Here
2407
    # if we have a transfer to complete, we update the line of transfers with the datearrived
2407
    # if we have a transfer to complete, we update the line of transfers with the datearrived
2408
    if ($transfer) {
2408
    if ($transfer) {
2409
        $validTransfer = 0;
2409
        $validTransfer = 0;
2410
        if ( $transfer->in_transit ) {
2410
        # cancel transfer if item can float but it wasn't checked in homebranch
2411
        if ( C4::Context->preference('CancelTransitWhenItemFloats') && $validate_float && $branch ne $item->homebranch )
2412
        {
2413
            $transfer->cancel( { reason => 'ItemArrivedToFloatBranch', force => 1 } );
2414
        } elsif ( $transfer->in_transit ) {
2411
            if ( $transfer->tobranch eq $branch ) {
2415
            if ( $transfer->tobranch eq $branch ) {
2412
                $transfer->receive;
2416
                $transfer->receive;
2413
                $messages->{'TransferArrived'} = $transfer->frombranch;
2417
                $messages->{'TransferArrived'} = $transfer->frombranch;
(-)a/installer/data/mysql/atomicupdate/bug_36957.pl (+43 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "36957",
6
    description =>
7
        "Add CancelTransitWhenItemFloats system preference and 'ItemArrivedToFloatBranch' to branchtransfers.cancellation_reason enum",
8
    up => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        $dbh->do(
13
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('CancelTransitWhenItemFloats','0',NULL,'Cancels items transit automatically if it arrives to a branch where it can float','YesNo')}
14
        );
15
16
        say_success( $out, "Added system preference 'CancelTransitWhenItemFloats'" );
17
18
        $dbh->do(
19
            q{
20
                alter table
21
                    `branchtransfers`
22
                modify column
23
                    `cancellation_reason` enum(
24
                        'Manual',
25
                        'StockrotationAdvance',
26
                        'StockrotationRepatriation',
27
                        'ReturnToHome',
28
                        'ReturnToHolding',
29
                        'RotatingCollection',
30
                        'Reserve',
31
                        'LostReserve',
32
                        'CancelReserve',
33
                        'ItemLost',
34
                        'WrongTransfer',
35
                        'ItemArrivedToFloatBranch'
36
                    ) DEFAULT NULL
37
                after `reason`
38
              }
39
        );
40
41
        say_success( $out, "Added 'ItemArrivedToFloatBranch' to branchtransfers.cancellation_reason enum" );
42
    },
43
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 139-144 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
139
('CalculateFundValuesIncludingTax', '1', NULL, 'Include tax in the calculated fund values (spent, ordered) for all supplier configurations', 'YesNo'),
139
('CalculateFundValuesIncludingTax', '1', NULL, 'Include tax in the calculated fund values (spent, ordered) for all supplier configurations', 'YesNo'),
140
('CalendarFirstDayOfWeek','0','0|1|2|3|4|5|6','Select the first day of week to use in the calendar.','Choice'),
140
('CalendarFirstDayOfWeek','0','0|1|2|3|4|5|6','Select the first day of week to use in the calendar.','Choice'),
141
('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo'),
141
('CancelOrdersInClosedBaskets', '0', NULL, 'Allow/Do not allow cancelling order lines in closed baskets.', 'YesNo'),
142
('CancelTransitWhenItemFloats','0',NULL,'Cancels items transit automatically if it arrives to a branch where it can float','YesNo'),
142
('CanMarkHoldsToPullAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button to the "Holds to pull" screen to mark an item as lost and notify the patron.','Choice'),
143
('CanMarkHoldsToPullAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button to the "Holds to pull" screen to mark an item as lost and notify the patron.','Choice'),
143
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
144
('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'),
144
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
145
('CardnumberLength', '', '', 'Set a length for card numbers with a maximum of 32 characters.', 'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +7 lines)
Lines 757-762 Circulation: Link Here
757
                  1: Store
757
                  1: Store
758
                  0: "Don't store"
758
                  0: "Don't store"
759
            - 'the last patron to return an item. This setting is independent of the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=opacreadinghistory">opacreadinghistory</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AnonymousPatron">AnonymousPatron</a> system preferences.'
759
            - 'the last patron to return an item. This setting is independent of the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=opacreadinghistory">opacreadinghistory</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AnonymousPatron">AnonymousPatron</a> system preferences.'
760
        -
761
            - pref: CancelTransitWhenItemFloats
762
              default: 0
763
              choices:
764
                  1: Do
765
                  0: "Don't"
766
            - 'cancel transit automatically when item arrives to branch where it can float.'
760
    Holds policy:
767
    Holds policy:
761
        -
768
        -
762
            - Default the holds ratio report to
769
            - Default the holds ratio report to
763
- 

Return to bug 36957