@@ -, +, @@ [% checkout.item.biblio.title %] Barcode: [% checkout.item.barcode %] Date due: [% checkout.date_due %] --- Koha/Patron.pm | 39 +++++++++++++++++++ .../mysql/en/mandatory/sample_notices.sql | 20 +++++----- 2 files changed, 50 insertions(+), 9 deletions(-) --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -882,6 +882,45 @@ sub checkouts { return Koha::Checkouts->_new_from_dbic( $checkouts ); } +=head3 todays_checkouts + +my $todays_checkouts = $patron->todays_checkouts + +This method will return a filtered set of patron checkouts limited by those that have taken place today. + +=cut + +sub todays_checkouts { + my ($self) = @_; + my $dtf = Koha::Database->new->schema->storage->datetime_parser; + my $today_start = + dt_from_string->set( hour => 0, minute => 0, second => 0 ); + my $today_end = + dt_from_string->set( hour => 23, minute => 59, second => 0 ); + + my $checkouts = $self->_result->issues->search( + { + -or => { + issuedate => { + '>=' => $dtf->format_datetime($today_start), + '<=' => $dtf->format_datetime($today_end), + }, + lastreneweddate => { + '>=' => $dtf->format_datetime($today_start), + '<=' => $dtf->format_datetime($today_end), + } + } + }, + { + order_by => [ + -desc => 'me.lastreneweddate', + -desc => 'me.issuedate' + ] + } + ); + return Koha::Checkouts->_new_from_dbic($checkouts); +} + =head3 pending_checkouts my $pending_checkouts = $patron->pending_checkouts --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ a/installer/data/mysql/en/mandatory/sample_notices.sql @@ -91,20 +91,22 @@ Date due: <> ', 1), -('circulation','ISSUEQSLIP','Issue Quick Slip','Issue Quick Slip', '<> -Checked out to <> <> <> <> -(<>) +('circulation','ISSUEQSLIP','Issue Quick Slip','Issue Quick Slip', '[%- USE KohaDates -%] +[% branch.branchname %] +Checked out to [% patron.title %] [% patron.firstname %] [% patron.initials %] [% patron.surname %] +([% patron.cardnumber %]) -<> +[% today | $KohaDates %] Checked Out Today - +[% FOREACH checkout IN patron.todays_checkouts %] -<> -Barcode: <> -Date due: <> + [% checkout.item.biblio.title %] + Barcode: [% checkout.item.barcode %] + Date due: [% checkout.date_due %] -', 1), +[% END %] +', 1), ('circulation','HOLD_SLIP','Hold Slip','Hold Slip', 'Date: <> Transfer to/Hold in <> --
-<> -Barcode: <> -Date due: <> + [% checkout.item.biblio.title %] + Barcode: [% checkout.item.barcode %] + Date due: [% checkout.date_due %]