Lines 32-37
use Koha::DateUtils qw( dt_from_string );
Link Here
|
32 |
|
32 |
|
33 |
use base qw(Koha::Object); |
33 |
use base qw(Koha::Object); |
34 |
|
34 |
|
|
|
35 |
use Koha::Acquisition::Orders; |
35 |
use Koha::ArticleRequest::Status; |
36 |
use Koha::ArticleRequest::Status; |
36 |
use Koha::ArticleRequests; |
37 |
use Koha::ArticleRequests; |
37 |
use Koha::Biblio::Metadatas; |
38 |
use Koha::Biblio::Metadatas; |
Lines 82-87
sub metadata {
Link Here
|
82 |
return Koha::Biblio::Metadata->_new_from_dbic($metadata); |
83 |
return Koha::Biblio::Metadata->_new_from_dbic($metadata); |
83 |
} |
84 |
} |
84 |
|
85 |
|
|
|
86 |
=head3 orders |
87 |
|
88 |
my $orders = $biblio->orders(); |
89 |
|
90 |
Returns a Koha::Acquisition::Orders object |
91 |
|
92 |
=cut |
93 |
|
94 |
sub orders { |
95 |
my ( $self ) = @_; |
96 |
|
97 |
my $orders = $self->_result->orders; |
98 |
return Koha::Acquisition::Orders->_new_from_dbic($orders); |
99 |
} |
100 |
|
101 |
=head3 active_orders_count |
102 |
|
103 |
my $orders_count = $biblio->active_orders_count(); |
104 |
|
105 |
Returns the number of active acquisition orders related to this biblio. |
106 |
An order is considered active when it is not cancelled (i.e. when datecancellation |
107 |
is not undef). |
108 |
|
109 |
=cut |
110 |
|
111 |
sub active_orders_count { |
112 |
my ( $self ) = @_; |
113 |
|
114 |
return $self->orders->search({ datecancellationprinted => undef })->count; |
115 |
} |
116 |
|
85 |
=head3 can_article_request |
117 |
=head3 can_article_request |
86 |
|
118 |
|
87 |
my $bool = $biblio->can_article_request( $borrower ); |
119 |
my $bool = $biblio->can_article_request( $borrower ); |