Bug 17560: Add a message when a patron checking in using the self checkout
Sponsored-by: Cheshire Libraries Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
20fe28d42c
commit
164db2833e
2 changed files with 20 additions and 6 deletions
|
@ -167,6 +167,9 @@
|
||||||
[% IF ( validuser ) %]
|
[% IF ( validuser ) %]
|
||||||
<div class="alert alert-info">You are logged in as [% borrowername %].</div>
|
<div class="alert alert-info">You are logged in as [% borrowername %].</div>
|
||||||
[% INCLUDE 'opac-note.inc' %]
|
[% INCLUDE 'opac-note.inc' %]
|
||||||
|
[% IF patron_has_hold_fee %]
|
||||||
|
<div class="alert">You have been charged for collecting this item.</div>
|
||||||
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% IF ( nouser ) %]
|
[% IF ( nouser ) %]
|
||||||
|
|
|
@ -44,6 +44,7 @@ use C4::Output;
|
||||||
use C4::Members;
|
use C4::Members;
|
||||||
use C4::Biblio;
|
use C4::Biblio;
|
||||||
use C4::Items;
|
use C4::Items;
|
||||||
|
use Koha::DateUtils qw( dt_from_string );
|
||||||
use Koha::Acquisition::Currencies;
|
use Koha::Acquisition::Currencies;
|
||||||
use Koha::Patron::Images;
|
use Koha::Patron::Images;
|
||||||
use Koha::Patron::Messages;
|
use Koha::Patron::Messages;
|
||||||
|
@ -199,13 +200,23 @@ elsif ( $op eq "checkout" ) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues.
|
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues.
|
||||||
# warn "issuing book?";
|
my $hold_existed;
|
||||||
|
if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
|
||||||
|
# There is no easy way to know if the patron has been charged for this item.
|
||||||
|
# So we check if a hold existed for this item before the check in
|
||||||
|
my $item = Koha::Items->find({ barcode => $barcode });
|
||||||
|
$hold_existed = Koha::Holds->search({ -or => { 'biblionumber' => $item->biblionumber, 'itemnumber' => $item->itemnumber}})->count;
|
||||||
|
}
|
||||||
AddIssue( $borrower, $barcode );
|
AddIssue( $borrower, $barcode );
|
||||||
# ($borrower, $flags) = getpatroninformation(undef,undef, $patronid);
|
|
||||||
# $template->param(
|
if ( $hold_existed ) {
|
||||||
# patronid => $patronid,
|
my $dtf = Koha::Database->new->schema->storage->datetime_parser;
|
||||||
# validuser => 1,
|
$template->param(
|
||||||
# );
|
# If the hold existed before the check in, let's confirm that the charge line exists
|
||||||
|
# Note that this should not be needed but since we do not have proper exception handling here we do it this way
|
||||||
|
patron_has_hold_fee => Koha::Account::Lines->search({ borrowernumber => $borrower->{borrowernumber}, accounttype => 'Res', date => $dtf->format_date( dt_from_string ) })->count,
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$confirm_required = 1;
|
$confirm_required = 1;
|
||||||
#warn "issue confirmation";
|
#warn "issue confirmation";
|
||||||
|
|
Loading…
Reference in a new issue