View | Details | Raw Unified | Return to bug 25297
Collapse All | Expand All

(-)a/Koha/Acquisition/Order.pm (-8 / +6 lines)
Lines 25-30 use Koha::Acquisition::Invoices; Link Here
25
use Koha::Database;
25
use Koha::Database;
26
use Koha::DateUtils qw( dt_from_string output_pref );
26
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::Biblios;
27
use Koha::Biblios;
28
use Koha::Holds;
28
use Koha::Items;
29
use Koha::Items;
29
use Koha::Subscriptions;
30
use Koha::Subscriptions;
30
31
Lines 182-190 sub subscription { Link Here
182
    my $holds = $order->current_item_level_holds;
183
    my $holds = $order->current_item_level_holds;
183
184
184
Returns the current item-level holds associated to the order. It returns a I<Koha::Holds>
185
Returns the current item-level holds associated to the order. It returns a I<Koha::Holds>
185
resultset in scalar context or a list of I<Koha::Hold> objects in list context.
186
resultset.
186
187
It returns B<undef> if no I<biblio> or no I<items> are linked to the order.
188
187
189
=cut
188
=cut
190
189
Lines 193-203 sub current_item_level_holds { Link Here
193
192
194
    my $items_rs     = $self->_result->aqorders_items;
193
    my $items_rs     = $self->_result->aqorders_items;
195
    my @item_numbers = $items_rs->get_column('itemnumber')->all;
194
    my @item_numbers = $items_rs->get_column('itemnumber')->all;
195
    my $biblio       = $self->biblio;
196
196
197
    return unless @item_numbers;
197
    unless ( $biblio and @item_numbers ) {
198
198
        return Koha::Holds->new->empty;
199
    my $biblio = $self->biblio;
199
    }
200
    return unless $biblio;
201
200
202
    return $biblio->current_holds->search(
201
    return $biblio->current_holds->search(
203
        {
202
        {
204
- 

Return to bug 25297