8e82a01717d4f550339ab04e9b841d87dad30422
[srvgit] / Koha / Cash / Register / Cashups.pm
1 package Koha::Cash::Register::Cashups;
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18 use Modern::Perl;
19
20 use Carp;
21
22 use Koha::Database;
23 use Koha::Cash::Register::Cashup;
24
25 use base qw(Koha::Cash::Register::Actions);
26
27 =head1 NAME
28
29 Koha::Cash::Register::Actions - Koha Cash Register Action Object set class
30
31 =head1 API
32
33 =head2 Class methods
34
35 =head3 search
36
37     my $cashups = Koha::Cash::Register::Cashups->search( $where, $attr );
38
39 Returns a list of cash register cashups.
40
41 =cut
42
43 sub search {
44     my ( $self, $where, $attr ) = @_;
45
46     unless ( exists $attr->{order_by} ) {
47         $attr->{order_by} =
48           [ { '-asc' => 'register_id' }, { '-desc' => 'timestamp' } ];
49     }
50
51     my $rs = $self->SUPER::search({ code => 'CASHUP' });
52     return $rs->SUPER::search( $where, $attr );
53 }
54
55 =head3 object_class
56
57 =cut
58
59 sub object_class {
60     return 'Koha::Cash::Register::Cashup';
61 }
62
63 1;