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

(-)a/Koha/CirculationRules.pm (-7 / +1 lines)
Lines 667-673 sub get_effective_daysmode { Link Here
667
=head3 get_effective_expire_reserves_charge
667
=head3 get_effective_expire_reserves_charge
668
668
669
Return the value for expire_reserves_charge defined in the circulation rules.
669
Return the value for expire_reserves_charge defined in the circulation rules.
670
If not defined (or empty string), the value of the system preference ExpireReservesMaxPickUpDelayCharge is returned
671
670
672
=cut
671
=cut
673
672
Lines 678-684 sub get_effective_expire_reserves_charge { Link Here
678
    my $branchcode   = $params->{branchcode};
677
    my $branchcode   = $params->{branchcode};
679
    my $categorycode = $params->{categorycode};
678
    my $categorycode = $params->{categorycode};
680
679
681
    my $expire_reserves_charge_rule = $class->get_effective_rule(
680
    return $class->get_effective_rule(
682
        {
681
        {
683
            itemtype     => $itemtype,
682
            itemtype     => $itemtype,
684
            branchcode   => $branchcode,
683
            branchcode   => $branchcode,
Lines 686-696 sub get_effective_expire_reserves_charge { Link Here
686
            rule_name    => 'expire_reserves_charge',
685
            rule_name    => 'expire_reserves_charge',
687
        }
686
        }
688
    );
687
    );
689
690
    # return the rule value (incl. 0) if rule found so there's an object in the variable,
691
    # or return default value from sysprefs when rule wasn't found and there's undef
692
    return $expire_reserves_charge_rule ? $expire_reserves_charge_rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
693
694
}
688
}
695
689
696
=head3 type
690
=head3 type
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 539-545 my $cancel_hold = $hold->cancel( Link Here
539
Cancel a hold:
539
Cancel a hold:
540
- The hold will be moved to the old_reserves table with a priority=0
540
- The hold will be moved to the old_reserves table with a priority=0
541
- The priority of other holds will be updated
541
- The priority of other holds will be updated
542
- The patron will be charge (see ExpireReservesMaxPickUpDelayCharge) if the charge_cancel_fee parameter is set
542
- The patron will be charged if charge_cancel_fee parameter is set (controlled by the expire_reserves_charge circ rule)
543
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
543
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
544
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
544
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
545
545
(-)a/installer/data/mysql/atomicupdate/bug_25711.pl (+26 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "25711",
5
    description => "Move ExpireReservesMaxPickUpDelayCharge to the circulation rules",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        my ($expire_reserves_charge) = $dbh->selectrow_array( q{
11
            SELECT value FROM systempreferences
12
            WHERE variable='ExpireReservesMaxPickUpDelayCharge';
13
        });
14
15
        $expire_reserves_charge //= 0;
16
17
        $dbh->do(qq{
18
            INSERT INTO circulation_rules
19
                ( categorycode, branchcode, itemtype, rule_name, rule_value )
20
            VALUES
21
                ( NULL, NULL, NULL, 'expire_reserves_charge', $expire_reserves_charge );
22
        });
23
24
        say $out "ExpireReservesMaxPickUpDelayCharge migrated to the expire_reserves_charge circulation rule";
25
    },
26
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 212-218 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
212
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
212
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
213
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
213
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
214
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
214
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
215
('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'),
216
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
215
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
217
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
216
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
218
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
217
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-6 lines)
Lines 756-766 Circulation: Link Here
756
                  1: Allow
756
                  1: Allow
757
                  0: "Don't allow"
757
                  0: "Don't allow"
758
            - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.'
758
            - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.'
759
        -
760
            - If using <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExpireReservesMaxPickUpDelay">ExpireReservesMaxPickUpDelay</a>, charge a patron who allows their waiting hold to expire a fee of
761
            - pref: ExpireReservesMaxPickUpDelayCharge
762
              class: currency
763
            - "."
764
        -
759
        -
765
            - Satisfy holds using items from the libraries
760
            - Satisfy holds using items from the libraries
766
            - pref: StaticHoldsQueueWeight
761
            - pref: StaticHoldsQueueWeight
767
- 

Return to bug 25711