Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket
[koha.git] / Koha / Acquisition / Basket.pm
blob9179c43a243153cbe95e5c6e4193d7d423e3e512
1 package Koha::Acquisition::Basket;
3 # Copyright 2017 Aleisha Amohia <aleisha@catalyst.net.nz>
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
10 # version.
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 use Modern::Perl;
22 use Koha::Database;
24 use base qw( Koha::Object );
26 =head1 NAME
28 Koha::Acquisition::Basket - Koha Basket Object class
30 =head1 API
32 =head2 Class Methods
34 =cut
36 =head3 bookseller
38 Returns the vendor
40 =cut
42 sub bookseller {
43 my ($self) = @_;
44 my $bookseller_rs = $self->_result->booksellerid;
45 return Koha::Acquisition::Bookseller->_new_from_dbic( $bookseller_rs );
49 =head3 effective_create_items
51 Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset.
53 =cut
55 sub effective_create_items {
56 my ( $self ) = @_;
58 return $self->create_items || C4::Context->preference('AcqCreateItem');
61 =head3 type
63 =cut
65 sub _type {
66 return 'Aqbasket';
69 =head1 AUTHOR
71 Aleisha Amohia <aleisha@catalyst.net.nz>
72 Catalyst IT
74 =cut