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

(-)a/Koha/CirculationRules.pm (-7 / +1 lines)
Lines 671-677 sub get_effective_daysmode { Link Here
671
=head3 get_effective_expire_reserves_charge
671
=head3 get_effective_expire_reserves_charge
672
672
673
Return the value for expire_reserves_charge defined in the circulation rules.
673
Return the value for expire_reserves_charge defined in the circulation rules.
674
If not defined (or empty string), the value of the system preference ExpireReservesMaxPickUpDelayCharge is returned
675
674
676
=cut
675
=cut
677
676
Lines 682-688 sub get_effective_expire_reserves_charge { Link Here
682
    my $branchcode   = $params->{branchcode};
681
    my $branchcode   = $params->{branchcode};
683
    my $categorycode = $params->{categorycode};
682
    my $categorycode = $params->{categorycode};
684
683
685
    my $expire_reserves_charge_rule = $class->get_effective_rule(
684
    return $class->get_effective_rule(
686
        {
685
        {
687
            itemtype     => $itemtype,
686
            itemtype     => $itemtype,
688
            branchcode   => $branchcode,
687
            branchcode   => $branchcode,
Lines 690-700 sub get_effective_expire_reserves_charge { Link Here
690
            rule_name    => 'expire_reserves_charge',
689
            rule_name    => 'expire_reserves_charge',
691
        }
690
        }
692
    );
691
    );
693
694
    # return the rule value (incl. 0) if rule found so there's an object in the variable,
695
    # or return default value from sysprefs when rule wasn't found and there's undef
696
    return $expire_reserves_charge_rule ? $expire_reserves_charge_rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
697
698
}
692
}
699
693
700
=head3 type
694
=head3 type
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 629-635 my $cancel_hold = $hold->cancel( Link Here
629
Cancel a hold:
629
Cancel a hold:
630
- The hold will be moved to the old_reserves table with a priority=0
630
- The hold will be moved to the old_reserves table with a priority=0
631
- The priority of other holds will be updated
631
- The priority of other holds will be updated
632
- The patron will be charge (see ExpireReservesMaxPickUpDelayCharge) if the charge_cancel_fee parameter is set
632
- The patron will be charged if charge_cancel_fee parameter is set (controlled by the expire_reserves_charge circ rule)
633
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
633
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
634
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
634
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
635
635
(-)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 218-224 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
218
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
218
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
219
('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'),
219
('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'),
220
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
220
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
221
('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'),
222
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
221
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
223
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
222
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
224
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
223
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-6 lines)
Lines 768-778 Circulation: Link Here
768
              class: email
768
              class: email
769
            - . If no address is defined here, the email will be sent to the library's reply-to address.
769
            - . If no address is defined here, the email will be sent to the library's reply-to address.
770
            - '<br><strong>NOTE:</strong> These system preferences require the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br>'
770
            - '<br><strong>NOTE:</strong> These system preferences require the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br>'
771
        -
772
            - 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
773
            - pref: ExpireReservesMaxPickUpDelayCharge
774
              class: currency
775
            - "."
776
        -
771
        -
777
            - Satisfy holds using items from the libraries
772
            - Satisfy holds using items from the libraries
778
            - pref: StaticHoldsQueueWeight
773
            - pref: StaticHoldsQueueWeight
779
- 

Return to bug 25711