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

(-)a/Koha/CirculationRules.pm (-7 / +1 lines)
Lines 750-756 sub get_effective_daysmode { Link Here
750
=head3 get_effective_expire_reserves_charge
750
=head3 get_effective_expire_reserves_charge
751
751
752
Return the value for expire_reserves_charge defined in the circulation rules.
752
Return the value for expire_reserves_charge defined in the circulation rules.
753
If not defined (or empty string), the value of the system preference ExpireReservesMaxPickUpDelayCharge is returned
754
753
755
=cut
754
=cut
756
755
Lines 761-767 sub get_effective_expire_reserves_charge { Link Here
761
    my $branchcode   = $params->{branchcode};
760
    my $branchcode   = $params->{branchcode};
762
    my $categorycode = $params->{categorycode};
761
    my $categorycode = $params->{categorycode};
763
762
764
    my $expire_reserves_charge_rule = $class->get_effective_rule(
763
    return $class->get_effective_rule(
765
        {
764
        {
766
            itemtype     => $itemtype,
765
            itemtype     => $itemtype,
767
            branchcode   => $branchcode,
766
            branchcode   => $branchcode,
Lines 769-779 sub get_effective_expire_reserves_charge { Link Here
769
            rule_name    => 'expire_reserves_charge',
768
            rule_name    => 'expire_reserves_charge',
770
        }
769
        }
771
    );
770
    );
772
773
    # return the rule value (incl. 0) if rule found so there's an object in the variable,
774
    # or return default value from sysprefs when rule wasn't found and there's undef
775
    return $expire_reserves_charge_rule ? $expire_reserves_charge_rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
776
777
}
771
}
778
772
779
=head3 type
773
=head3 type
(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 672-678 my $cancel_hold = $hold->cancel( Link Here
672
Cancel a hold:
672
Cancel a hold:
673
- The hold will be moved to the old_reserves table with a priority=0
673
- The hold will be moved to the old_reserves table with a priority=0
674
- The priority of other holds will be updated
674
- The priority of other holds will be updated
675
- The patron will be charge (see ExpireReservesMaxPickUpDelayCharge) if the charge_cancel_fee parameter is set
675
- The patron will be charged if charge_cancel_fee parameter is set (controlled by the expire_reserves_charge circ rule)
676
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
676
- The canceled hold will have the cancellation reason added to old_reserves.cancellation_reason if one is passed in
677
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
677
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
678
678
(-)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 240-246 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
240
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
240
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
241
('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'),
241
('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'),
242
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
242
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
243
('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'),
244
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
243
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
245
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
244
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
246
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
245
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-6 lines)
Lines 773-783 Circulation: Link Here
773
              class: email
773
              class: email
774
            - . If no address is defined here, the email will be sent to the library's reply-to address.
774
            - . If no address is defined here, the email will be sent to the library's reply-to address.
775
            - '<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>'
775
            - '<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>'
776
        -
777
            - 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
778
            - pref: ExpireReservesMaxPickUpDelayCharge
779
              class: currency
780
            - "."
781
        -
776
        -
782
            - The holds queue should prioritize filling a hold by matching the patron's home library with an item having a matching
777
            - The holds queue should prioritize filling a hold by matching the patron's home library with an item having a matching
783
            - pref: HoldsQueuePrioritizeBranch
778
            - pref: HoldsQueuePrioritizeBranch
784
- 

Return to bug 25711