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

(-)a/Koha/Patron.pm (+39 lines)
Lines 882-887 sub checkouts { Link Here
882
    return Koha::Checkouts->_new_from_dbic( $checkouts );
882
    return Koha::Checkouts->_new_from_dbic( $checkouts );
883
}
883
}
884
884
885
=head3 todays_checkouts
886
887
my $todays_checkouts = $patron->todays_checkouts
888
889
This method will return a filtered set of patron checkouts limited by those that have taken place today.
890
891
=cut
892
893
sub todays_checkouts {
894
    my ($self) = @_;
895
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
896
    my $today_start =
897
      dt_from_string->set( hour => 0, minute => 0, second => 0 );
898
    my $today_end =
899
      dt_from_string->set( hour => 23, minute => 59, second => 0 );
900
901
    my $checkouts = $self->_result->issues->search(
902
        {
903
            -or => {
904
                issuedate => {
905
                    '>=' => $dtf->format_datetime($today_start),
906
                    '<=' => $dtf->format_datetime($today_end),
907
                },
908
                lastreneweddate => {
909
                    '>=' => $dtf->format_datetime($today_start),
910
                    '<=' => $dtf->format_datetime($today_end),
911
                }
912
            }
913
        },
914
        {
915
            order_by => [
916
                -desc => 'me.lastreneweddate',
917
                -desc => 'me.issuedate'
918
            ]
919
        }
920
    );
921
    return Koha::Checkouts->_new_from_dbic($checkouts);
922
}
923
885
=head3 pending_checkouts
924
=head3 pending_checkouts
886
925
887
my $pending_checkouts = $patron->pending_checkouts
926
my $pending_checkouts = $patron->pending_checkouts
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (-10 / +11 lines)
Lines 91-110 Date due: <<issues.date_due>><br /> Link Here
91
<hr />
91
<hr />
92
</div>
92
</div>
93
</news>', 1),
93
</news>', 1),
94
('circulation','ISSUEQSLIP','Issue Quick Slip','Issue Quick Slip', '<h3><<branches.branchname>></h3>
94
('circulation','ISSUEQSLIP','Issue Quick Slip','Issue Quick Slip', '[%- USE KohaDates -%]
95
Checked out to <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
95
<h3>[% branch.branchname %]</h3>
96
(<<borrowers.cardnumber>>) <br />
96
Checked out to [% patron.title %] [% patron.firstname %] [% patron.initials %] [% patron.surname %] <br />
97
([% patron.cardnumber %]) <br />
97
98
98
<<today>><br />
99
[% today | $KohaDates %]<br />
99
100
100
<h4>Checked Out Today</h4>
101
<h4>Checked Out Today</h4>
101
<checkedout>
102
[% FOREACH checkout IN patron.todays_checkouts %]
102
<p>
103
<p>
103
<<biblio.title>> <br />
104
  [% checkout.item.biblio.title %] </br />
104
Barcode: <<items.barcode>><br />
105
  Barcode: [% checkout.item.barcode %]<br />
105
Date due: <<issues.date_due>><br />
106
  Date due: [% checkout.date_due %]<br />
106
</p>
107
</p>
107
</checkedout>', 1),
108
[% END %]
109
', 1),
108
('circulation','HOLD_SLIP','Hold Slip','Hold Slip', '<h5>Date: <<today>></h5>
110
('circulation','HOLD_SLIP','Hold Slip','Hold Slip', '<h5>Date: <<today>></h5>
109
111
110
<h3> Transfer to/Hold in <<branches.branchname>></h3>
112
<h3> Transfer to/Hold in <<branches.branchname>></h3>
111
- 

Return to bug 15283