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

(-)a/Koha/Acquisition/Order.pm (-1 / +39 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 169-174 sub subscription { Link Here
169
    return Koha::Subscription->_new_from_dbic( $subscription_rs );
170
    return Koha::Subscription->_new_from_dbic( $subscription_rs );
170
}
171
}
171
172
173
=head3 holds
174
175
    my $holds = $order->holds
176
177
Returns the holds associated to the order. It returns a I<Koha::Holds>
178
resultset in scalar context or a list of I<Koha::Hold> objects in list context.
179
180
=cut
181
182
sub holds {
183
    my ($self) = @_;
184
185
    my $items_rs = $self->_result->aqorders_items;
186
    my @item_numbers = $items_rs->get_column( 'itemnumber' )->all;
187
188
    return Koha::Holds->search(
189
        {
190
            itemnumber => {
191
                -in => \@item_numbers
192
            }
193
        }
194
    );
195
}
196
197
=head3 holds_count
198
199
    my $count = $order->holds_count
200
201
Returns the holds count associated to the order.
202
203
=cut
204
205
sub holds_count {
206
    my ($self) = @_;
207
208
    return $self->holds->count;
209
}
210
172
=head3 items
211
=head3 items
173
212
174
    my $items = $order->items
213
    my $items = $order->items
175
- 

Return to bug 24440