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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 1251-1257 sub ModReserveFill { Link Here
1251
    $hold->delete();
1251
    $hold->delete();
1252
1252
1253
    if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
1253
    if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
1254
        my $reserve_fee = GetReserveFee( $hold->borrowernumber );
1254
        my $reserve_fee = GetReserveFee( $hold->borrowernumber, $hold->biblionumber );
1255
        ChargeReserveFee( $hold->borrowernumber, $reserve_fee, $hold->biblio->title );
1255
        ChargeReserveFee( $hold->borrowernumber, $reserve_fee, $hold->biblio->title );
1256
    }
1256
    }
1257
1257
(-)a/installer/data/mysql/atomicupdate/bug_XXXXX.sql (-1 / +2 lines)
Line 1 Link Here
1
UPDATE systempreferences SET options="any_time_is_placed|not_always|any_time_is_collected" WHERE value="HoldFeeMode";
1
UPDATE systempreferences SET options="any_time_is_placed|not_always|any_time_is_collected" WHERE variable="HoldFeeMode";
2
UPDATE systempreferences SET value="any_time_is_placed" WHERE variable="HoldFeeMode" AND value="always";
(-)a/opac/sco/sco-main.pl (-5 / +21 lines)
Lines 200-211 elsif ( $op eq "checkout" ) { Link Here
200
        }
200
        }
201
    } else {
201
    } else {
202
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
202
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
203
            my $hold_existed;
203
            my ( $hold_existed, $item );
204
            if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
204
            if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
205
                # There is no easy way to know if the patron has been charged for this item.
205
                # There is no easy way to know if the patron has been charged for this item.
206
                # So we check if a hold existed for this item before the check in
206
                # So we check if a hold existed for this item before the check in
207
                my $item = Koha::Items->find({ barcode => $barcode });
207
                $item = Koha::Items->find({ barcode => $barcode });
208
                $hold_existed = Koha::Holds->search({ -or => { 'biblionumber' => $item->biblionumber, 'itemnumber' => $item->itemnumber}})->count;
208
                $hold_existed = Koha::Holds->search(
209
                    {
210
                        -and => {
211
                            borrowernumber => $borrower->{borrowernumber},
212
                            -or            => {
213
                                biblionumber => $item->biblionumber,
214
                                itemnumber   => $item->itemnumber
215
                            }
216
                        }
217
                    }
218
                )->count;
209
            }
219
            }
210
            AddIssue( $borrower, $barcode );
220
            AddIssue( $borrower, $barcode );
211
221
Lines 214-220 elsif ( $op eq "checkout" ) { Link Here
214
                $template->param(
224
                $template->param(
215
                    # If the hold existed before the check in, let's confirm that the charge line exists
225
                    # If the hold existed before the check in, let's confirm that the charge line exists
216
                    # Note that this should not be needed but since we do not have proper exception handling here we do it this way
226
                    # Note that this should not be needed but since we do not have proper exception handling here we do it this way
217
                    patron_has_hold_fee => Koha::Account::Lines->search({ borrowernumber => $borrower->{borrowernumber}, accounttype => 'Res', date => $dtf->format_date( dt_from_string ) })->count,
227
                    patron_has_hold_fee => Koha::Account::Lines->search(
228
                        {
229
                            borrowernumber => $borrower->{borrowernumber},
230
                            accounttype    => 'Res',
231
                            description    => 'Reserve Charge - ' . $item->biblio->title,
232
                            date           => $dtf->format_date(dt_from_string)
233
                        }
234
                      )->count,
218
                );
235
                );
219
            }
236
            }
220
        } else {
237
        } else {
221
- 

Return to bug 17560