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
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.
23 use Koha
::Acquisition
::BasketGroups
;
25 use base
qw( Koha::Object Koha::Object::Mixin::AdditionalFields );
29 Koha::Acquisition::Basket - Koha Basket Object class
45 my $bookseller_rs = $self->_result->booksellerid;
46 return Koha
::Acquisition
::Bookseller
->_new_from_dbic( $bookseller_rs );
51 Returns the basket group associated to this basket
57 my $basket_group_rs = $self->_result->basketgroupid;
58 return unless $basket_group_rs;
59 return Koha
::Acquisition
::BasketGroup
->_new_from_dbic( $basket_group_rs );
62 =head3 effective_create_items
64 Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset.
68 sub effective_create_items
{
71 return $self->create_items || C4
::Context
->preference('AcqCreateItem');
76 my $json = $basket->to_api;
78 Overloaded method that returns a JSON representation of the Koha::Acquisition::Basket object,
79 suitable for API output.
84 my ( $self, $params ) = @_;
86 my $json = $self->SUPER::to_api
( $params );
88 $json->{closed
} = ( $self->closedate )
97 This method returns the mapping for representing a Koha::Acquisition::Basket object
104 basketno
=> 'basket_id',
105 basketname
=> 'name',
106 booksellernote
=> 'vendor_note',
107 contractnumber
=> 'contract_id',
108 creationdate
=> 'creation_date',
109 closedate
=> 'close_date',
110 booksellerid
=> 'vendor_id',
111 authorisedby
=> 'authorised_by',
112 booksellerinvoicenumber
=> undef,
113 basketgroupid
=> 'basket_group_id',
114 deliveryplace
=> 'delivery_place',
115 billingplace
=> 'billing_place',
116 branch
=> 'library_id',
117 is_standing
=> 'standing'
121 =head2 Internal methods
133 Aleisha Amohia <aleisha@catalyst.net.nz>