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

(-)a/C4/Reserves.pm (-2 / +2 lines)
Lines 1052-1058 sub AutoUnsuspendReserves { Link Here
1052
1052
1053
  CancelReserve({ reserve_id => $reserve_id, [ biblionumber => $biblionumber, borrowernumber => $borrrowernumber, itemnumber => $itemnumber, ] [ charge_cancel_fee => 1 ] });
1053
  CancelReserve({ reserve_id => $reserve_id, [ biblionumber => $biblionumber, borrowernumber => $borrrowernumber, itemnumber => $itemnumber, ] [ charge_cancel_fee => 1 ] });
1054
1054
1055
Cancels a reserve. If C<charge_cancel_fee> is passed and the C<ExpireReservesMaxPickUpDelayCharge> syspref is set, charge that fee to the patron's account.
1055
Cancels a reserve. If C<charge_cancel_fee> is passed and the C<WaitingHoldCancelationFee> syspref is set, charge that fee to the patron's account.
1056
1056
1057
=cut
1057
=cut
1058
1058
Lines 1098-1104 sub CancelReserve { Link Here
1098
        _FixPriority({ biblionumber => $reserve->{biblionumber} });
1098
        _FixPriority({ biblionumber => $reserve->{biblionumber} });
1099
1099
1100
        # and, if desired, charge a cancel fee
1100
        # and, if desired, charge a cancel fee
1101
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
1101
        my $charge = C4::Context->preference("WaitingHoldCancelationFee");
1102
        if ( $charge && $params->{'charge_cancel_fee'} ) {
1102
        if ( $charge && $params->{'charge_cancel_fee'} ) {
1103
            manualinvoice($reserve->{'borrowernumber'}, $reserve->{'itemnumber'}, '', 'HE', $charge);
1103
            manualinvoice($reserve->{'borrowernumber'}, $reserve->{'itemnumber'}, '', 'HE', $charge);
1104
        }
1104
        }
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 142-148 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
142
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
142
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
143
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
143
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
144
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
144
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
145
('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'),
145
('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'),
146
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
146
('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
147
('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'),
147
('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'),
148
('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'),
148
('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 508-516 Circulation: Link Here
508
                  no: "Don't allow"
508
                  no: "Don't allow"
509
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
509
            - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay"
510
        -
510
        -
511
            - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of
511
            - Charge an amount of
512
            - pref: ExpireReservesMaxPickUpDelayCharge
512
            - pref: WaitingHoldCancelationFee
513
              class: currency
513
              class: currency
514
            - if a waiting hold cancellation fee is to be charged, based on if the hold has been waiting more days than defined by ReservesMaxPickUpDelay.
514
        -
515
        -
515
            - Satisfy holds using items from the libraries
516
            - Satisfy holds using items from the libraries
516
            - pref: StaticHoldsQueueWeight
517
            - pref: StaticHoldsQueueWeight
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 608-614 $(document).ready(function () { Link Here
608
                        [% END %]
608
                        [% END %]
609
                        <label for="dropboxcheck">Book drop mode</label>
609
                        <label for="dropboxcheck">Book drop mode</label>
610
                    </p>
610
                    </p>
611
                    [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
611
                    [% IF Koha.Preference('WaitingHoldCancelationFee') %]
612
                    <p>
612
                    <p>
613
                        [% IF ( forgivemanualholdsexpire ) %]
613
                        [% IF ( forgivemanualholdsexpire ) %]
614
                        <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
614
                        <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 138-144 Link Here
138
                   <input type="hidden" name="allbranches" value="[% allbranches %]" />
138
                   <input type="hidden" name="allbranches" value="[% allbranches %]" />
139
                   <input type="hidden" name="tab" value="holdsover">
139
                   <input type="hidden" name="tab" value="holdsover">
140
                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
140
                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
141
                   [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
141
                   [% IF Koha.Preference('WaitingHoldCancelationFee') %]
142
                       <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
142
                       <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
143
                   [% END %]
143
                   [% END %]
144
               </form>
144
               </form>
Lines 179-185 Link Here
179
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
179
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
180
                            <input type="hidden" name="tab" value="holdsover">
180
                            <input type="hidden" name="tab" value="holdsover">
181
181
182
                            [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
182
                            [% IF Koha.Preference('WaitingHoldCancelationFee') %]
183
                                <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
183
                                <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
184
                            [% END %]
184
                            [% END %]
185
185
(-)a/t/db_dependent/Holds/CancelAll.t (-2 / +2 lines)
Lines 38-44 my $borrowers_count = 2; Link Here
38
38
39
my ( $biblionumber, $title, $biblioitemnumber ) = create_helper_biblio('DUMMY');
39
my ( $biblionumber, $title, $biblioitemnumber ) = create_helper_biblio('DUMMY');
40
40
41
C4::Context->set_preference( 'ExpireReservesMaxPickUpDelayCharge', '5.00' );
41
C4::Context->set_preference( 'WaitingHoldCancelationFee', '5.00' );
42
42
43
my ( undef, undef, $itemnumber ) = AddItem(
43
my ( undef, undef, $itemnumber ) = AddItem(
44
    {
44
    {
Lines 107-113 is( $hold, undef, 'Hold canceled correctly' ); Link Here
107
$accountlines =
107
$accountlines =
108
  Koha::Account::Lines->search( { borrowernumber => $borrowernumber } );
108
  Koha::Account::Lines->search( { borrowernumber => $borrowernumber } );
109
is( $accountlines->count(), 1, "Found charge for cancelation" );
109
is( $accountlines->count(), 1, "Found charge for cancelation" );
110
is( $accountlines->as_list->[0]->amountoutstanding, '5.000000', 'Charge is equal to ExpireReservesMaxPickUpDelayCharge' );
110
is( $accountlines->as_list->[0]->amountoutstanding, '5.000000', 'Charge is equal to WaitingHoldCancelationFee' );
111
111
112
# Helper method to set up a Biblio.
112
# Helper method to set up a Biblio.
113
sub create_helper_biblio {
113
sub create_helper_biblio {
(-)a/t/db_dependent/Reserves.t (-3 / +2 lines)
Lines 560-566 my ( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ) Link Here
560
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
560
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' );
561
561
562
# First, test cancelling a reserve when there's no charge configured.
562
# First, test cancelling a reserve when there's no charge configured.
563
t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelayCharge', 0);
563
t::lib::Mocks::mock_preference('WaitingHoldCancelationFee', 0);
564
564
565
my $bz14464_reserve = AddReserve(
565
my $bz14464_reserve = AddReserve(
566
    'CPL',
566
    'CPL',
Lines 587-593 is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from r Link Here
587
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
587
is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' );
588
588
589
# Then, test cancelling a reserve when there's no charge desired.
589
# Then, test cancelling a reserve when there's no charge desired.
590
t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelayCharge', 42);
590
t::lib::Mocks::mock_preference('WaitingHoldCancelationFee', 42);
591
591
592
$bz14464_reserve = AddReserve(
592
$bz14464_reserve = AddReserve(
593
    'CPL',
593
    'CPL',
594
- 

Return to bug 15561