Bug 21156: Add plural translation capabilities to JS files
[koha.git] / Koha / Acquisition / Bookseller.pm
blob708ae51461cb2a6883b788d9d08939b37a7ee56c
1 package Koha::Acquisition::Bookseller;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3 of the License, or (at your option) any later
8 # version.
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with Koha; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 use Modern::Perl;
20 use Koha::Acquisition::Bookseller::Contacts;
21 use Koha::Subscriptions;
23 use base qw( Koha::Object );
25 =head1 NAME
27 Koha::Acquisition::Bookseller Object class
29 =head1 API
31 =head2 Class methods
33 =head3 baskets
35 my $vendor = Koha::Acquisition::Booksellers->find( $id );
36 my @baskets = $vendor->baskets();
38 Returns the list of baskets for the vendor
40 =cut
42 sub baskets {
43 my ( $self ) = @_;
44 return $self->{_result}->aqbaskets;
47 =head3 contacts
49 my $vendor = Koha::Acquisition::Booksellers->find( $id );
50 my @contacts = $vendor->contacts();
52 Returns the list of contacts for the vendor
54 =cut
56 sub contacts {
57 my ($self) = @_;
58 return Koha::Acquisition::Bookseller::Contacts->search( { booksellerid => $self->id } );
61 =head3 subscriptions
63 my $vendor = Koha::Acquisition::Booksellers->find( $id );
64 my @subscriptions = $vendor->subscriptions();
66 Returns the list of subscriptions for the vendor
68 =cut
70 sub subscriptions {
71 my ($self) = @_;
73 return Koha::Subscriptions->search( { aqbooksellerid => $self->id } );
76 =head3 to_api_mapping
78 This method returns the mapping for representing a Koha::Acquisition::Bookseller object
79 on the API.
81 =cut
83 sub to_api_mapping {
84 return {
85 booksellerfax => undef,
86 bookselleremail => undef,
87 booksellerurl => undef,
88 currency => undef,
89 othersupplier => undef,
90 listprice => 'list_currency',
91 invoiceprice => 'invoice_currency',
92 gstreg => 'gst',
93 listincgst => 'list_includes_gst',
94 invoiceincgst => 'invoice_includes_gst'
98 =head2 Internal methods
100 =head3 _type
102 =cut
104 sub _type {
105 return 'Aqbookseller';