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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (+3 lines)
Lines 167-172 Link Here
167
                            [% IF ( validuser ) %]
167
                            [% IF ( validuser ) %]
168
                                <div class="alert alert-info">You are logged in as [% borrowername %].</div>
168
                                <div class="alert alert-info">You are logged in as [% borrowername %].</div>
169
                                [% INCLUDE 'opac-note.inc' %]
169
                                [% INCLUDE 'opac-note.inc' %]
170
                                [% IF patron_has_hold_fee %]
171
                                    <div class="alert">You have been charged for collecting this item.</div>
172
                                [% END %]
170
                            [% END %]
173
                            [% END %]
171
174
172
                            [% IF ( nouser ) %]
175
                            [% IF ( nouser ) %]
(-)a/opac/sco/sco-main.pl (-7 / +17 lines)
Lines 44-49 use C4::Output; Link Here
44
use C4::Members;
44
use C4::Members;
45
use C4::Biblio;
45
use C4::Biblio;
46
use C4::Items;
46
use C4::Items;
47
use Koha::DateUtils qw( dt_from_string );
47
use Koha::Acquisition::Currencies;
48
use Koha::Acquisition::Currencies;
48
use Koha::Patron::Images;
49
use Koha::Patron::Images;
49
use Koha::Patron::Messages;
50
use Koha::Patron::Messages;
Lines 199-211 elsif ( $op eq "checkout" ) { Link Here
199
        }
200
        }
200
    } else {
201
    } else {
201
        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.
202
            # warn "issuing book?";
203
            my $hold_existed;
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.
206
                # So we check if a hold existed for this item before the check in
207
                my $item = Koha::Items->find({ barcode => $barcode });
208
                $hold_existed = Koha::Holds->search({ -or => { 'biblionumber' => $item->biblionumber, 'itemnumber' => $item->itemnumber}})->count;
209
            }
203
            AddIssue( $borrower, $barcode );
210
            AddIssue( $borrower, $barcode );
204
            # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid);
211
205
            # $template->param(
212
            if ( $hold_existed ) {
206
            #   patronid => $patronid,
213
                my $dtf = Koha::Database->new->schema->storage->datetime_parser;
207
            #   validuser => 1,
214
                $template->param(
208
            # );
215
                    # 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
217
                    patron_has_hold_fee => Koha::Account::Lines->search({ borrowernumber => $borrower->{borrowernumber}, accounttype => 'Res', date => $dtf->format_date( dt_from_string ) })->count,
218
                );
219
            }
209
        } else {
220
        } else {
210
            $confirm_required = 1;
221
            $confirm_required = 1;
211
            #warn "issue confirmation";
222
            #warn "issue confirmation";
212
- 

Return to bug 17560