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

(-)a/Koha/Hold.pm (-2 / +2 lines)
Lines 331-337 my $cancel_hold = $hold->cancel(); Link Here
331
Cancel a hold:
331
Cancel a hold:
332
- The hold will be moved to the old_reserves table with a priority=0
332
- The hold will be moved to the old_reserves table with a priority=0
333
- The priority of other holds will be updated
333
- The priority of other holds will be updated
334
- The patron will be charge (see ExpireReservesMaxPickUpDelayCharge) if the charge_cancel_fee parameter is set
334
- The patron will be charge (see WaitingHoldCancelationFee) if the charge_cancel_fee parameter is set
335
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
335
- a CANCEL HOLDS log will be done if the pref HoldsLog is on
336
336
337
=cut
337
=cut
Lines 349-355 sub cancel { Link Here
349
            C4::Reserves::_FixPriority({ biblionumber => $self->biblionumber });
349
            C4::Reserves::_FixPriority({ biblionumber => $self->biblionumber });
350
350
351
            # and, if desired, charge a cancel fee
351
            # and, if desired, charge a cancel fee
352
            my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
352
            my $charge = C4::Context->preference("WaitingHoldCancelationFee");
353
            if ( $charge && $params->{'charge_cancel_fee'} ) {
353
            if ( $charge && $params->{'charge_cancel_fee'} ) {
354
                C4::Accounts::manualinvoice($self->borrowernumber, $self->itemnumber, '', 'HE', $charge);
354
                C4::Accounts::manualinvoice($self->borrowernumber, $self->itemnumber, '', 'HE', $charge);
355
            }
355
            }
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 160-166 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
160
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
160
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
161
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
161
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
162
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
162
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
163
('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'),
163
('WaitingHoldCancelationFee','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'),
164
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
164
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
165
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
165
('ExcludeHolidaysFromMaxPickUpDelay', '0', NULL, 'If ON, reserves max pickup delay takes into accountthe closed days.', 'YesNo'),
166
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
166
('ExportCircHistory', 0, NULL, "Display the export circulation options",  'YesNo' ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 602-610 Circulation: Link Here
602
                  no: "Don't allow"
602
                  no: "Don't allow"
603
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
603
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
604
        -
604
        -
605
            - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
605
            - Charge an amount of
606
            - pref: ExpireReservesMaxPickUpDelayCharge
606
            - pref: WaitingHoldCancelationFee
607
              class: currency
607
              class: currency
608
            - if a waiting hold cancellation fee is to be charged, based on if the hold has been waiting more days than defined by ReservesMaxPickUpDelay.
608
        -
609
        -
609
            - Satisfy holds using items from the libraries
610
            - Satisfy holds using items from the libraries
610
            - pref: StaticHoldsQueueWeight
611
            - pref: StaticHoldsQueueWeight
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 665-671 Link Here
665
                        [% END %]
665
                        [% END %]
666
                        <label for="dropboxcheck">Book drop mode</label>
666
                        <label for="dropboxcheck">Book drop mode</label>
667
                    </p>
667
                    </p>
668
                    [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
668
                    [% IF Koha.Preference('WaitingHoldCancelationFee') %]
669
                    <p>
669
                    <p>
670
                        [% IF ( forgivemanualholdsexpire ) %]
670
                        [% IF ( forgivemanualholdsexpire ) %]
671
                        <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
671
                        <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (-2 / +2 lines)
Lines 137-143 Link Here
137
                       <input type="submit" value="Cancel all" />
137
                       <input type="submit" value="Cancel all" />
138
                   [% END %]
138
                   [% END %]
139
                   
139
                   
140
                   [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
140
                   [% IF Koha.Preference('WaitingHoldCancelationFee') %]
141
                       <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
141
                       <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
142
                   [% END %]
142
                   [% END %]
143
               </form>
143
               </form>
Lines 184-190 Link Here
184
                            <input type="hidden" name="tbr" value="[% overloo.homebranch | html %]" />
184
                            <input type="hidden" name="tbr" value="[% overloo.homebranch | html %]" />
185
                            <input type="hidden" name="tab" value="holdsover">
185
                            <input type="hidden" name="tab" value="holdsover">
186
186
187
                            [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
187
                            [% IF Koha.Preference('WaitingHoldCancelationFee') %]
188
                                <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
188
                                <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
189
                            [% END %]
189
                            [% END %]
190
190
(-)a/t/db_dependent/Holds/CancelAll.t (-3 / +2 lines)
Lines 37-43 my $borrowers_count = 2; Link Here
37
37
38
my ( $biblionumber, $title, $biblioitemnumber ) = create_helper_biblio('DUMMY');
38
my ( $biblionumber, $title, $biblioitemnumber ) = create_helper_biblio('DUMMY');
39
39
40
C4::Context->set_preference( 'ExpireReservesMaxPickUpDelayCharge', '5.00' );
40
C4::Context->set_preference( 'WaitingHoldCancelationFee', '5.00' );
41
41
42
my ( undef, undef, $itemnumber ) = AddItem(
42
my ( undef, undef, $itemnumber ) = AddItem(
43
    {
43
    {
Lines 106-112 is( $hold, undef, 'Hold canceled correctly' ); Link Here
106
$accountlines =
106
$accountlines =
107
  Koha::Account::Lines->search( { borrowernumber => $borrowernumber } );
107
  Koha::Account::Lines->search( { borrowernumber => $borrowernumber } );
108
is( $accountlines->count(), 1, "Found charge for cancelation" );
108
is( $accountlines->count(), 1, "Found charge for cancelation" );
109
is( $accountlines->as_list->[0]->amountoutstanding, '5.000000', 'Charge is equal to ExpireReservesMaxPickUpDelayCharge' );
109
is( $accountlines->as_list->[0]->amountoutstanding, '5.000000', 'Charge is equal to WaitingHoldCancelationFee' );
110
110
111
# Helper method to set up a Biblio.
111
# Helper method to set up a Biblio.
112
sub create_helper_biblio {
112
sub create_helper_biblio {
113
- 

Return to bug 15561