Lines 169-174
sub subscription {
Link Here
|
169 |
return Koha::Subscription->_new_from_dbic( $subscription_rs ); |
169 |
return Koha::Subscription->_new_from_dbic( $subscription_rs ); |
170 |
} |
170 |
} |
171 |
|
171 |
|
|
|
172 |
=head3 current_holds |
173 |
|
174 |
my $holds = $order->current_holds; |
175 |
|
176 |
Returns the current holds associated to the order. It returns a I<Koha::Holds> |
177 |
resultset in scalar context or a list of I<Koha::Hold> objects in list context. |
178 |
|
179 |
It returns B<undef> if no I<biblio> or no I<items> are linked to the order. |
180 |
|
181 |
=cut |
182 |
|
183 |
sub current_holds { |
184 |
my ($self) = @_; |
185 |
|
186 |
my $items_rs = $self->_result->aqorders_items; |
187 |
my @item_numbers = $items_rs->get_column('itemnumber')->all; |
188 |
|
189 |
return unless @item_numbers; |
190 |
|
191 |
my $biblio = $self->biblio; |
192 |
return unless $biblio; |
193 |
|
194 |
return $biblio->current_holds->search( |
195 |
{ |
196 |
itemnumber => { |
197 |
-in => \@item_numbers |
198 |
} |
199 |
} |
200 |
); |
201 |
} |
202 |
|
172 |
=head3 items |
203 |
=head3 items |
173 |
|
204 |
|
174 |
my $items = $order->items |
205 |
my $items = $order->items |
Lines 196-202
Returns the bibliographic record associated to the order
Link Here
|
196 |
|
227 |
|
197 |
sub biblio { |
228 |
sub biblio { |
198 |
my ( $self ) = @_; |
229 |
my ( $self ) = @_; |
199 |
my $biblio_rs= $self->_result->biblionumber; |
230 |
my $biblio_rs= $self->_result->biblio; |
|
|
231 |
return unless $biblio_rs; |
200 |
return Koha::Biblio->_new_from_dbic( $biblio_rs ); |
232 |
return Koha::Biblio->_new_from_dbic( $biblio_rs ); |
201 |
} |
233 |
} |
202 |
|
234 |
|