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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (-1 / +1 lines)
Lines 91-97 Link Here
91
    [% END %]
91
    [% END %]
92
[% END %]
92
[% END %]
93
93
94
[% IF NOT ( item.isa('Koha::Item') ) AND item.on_order %][%# on_order is only set from opac-detail.pl %]
94
[% IF Koha.Preference('OPACAcquisitionDetails') AND ( item.isa('Koha::Item') ) AND ( item.orders.filter_by_active.count ) %][%# on_order is only set from opac-detail.pl %]
95
    [% SET itemavailable = 0 %]
95
    [% SET itemavailable = 0 %]
96
    <span class="item-status onorder">On order</span>
96
    <span class="item-status onorder">On order</span>
97
[% END %]
97
[% END %]
(-)a/opac/opac-detail.pl (-16 / +2 lines)
Lines 653-669 $template->param( Link Here
653
# Get items on order
653
# Get items on order
654
my ( @itemnumbers_on_order );
654
my ( @itemnumbers_on_order );
655
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
655
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
656
    my $orders = C4::Acquisition::SearchOrders({
656
    my $orders = $biblio->orders->filter_by_active;
657
        biblionumber => $biblionumber,
658
        ordered => 1,
659
    });
660
    my $total_quantity = 0;
657
    my $total_quantity = 0;
661
    for my $order ( @$orders ) {
658
    while ( my $order = $orders->next ) {
662
        my $order = Koha::Acquisition::Orders->find( $order->{ordernumber} );
663
        my $basket = $order->basket;
664
        if ( $basket->effective_create_items eq 'ordering' ) {
665
            @itemnumbers_on_order = $order->items->get_column('itemnumber');
666
        }
667
        $total_quantity += $order->quantity;
659
        $total_quantity += $order->quantity;
668
    }
660
    }
669
    $template->{VARS}->{acquisition_details} = {
661
    $template->{VARS}->{acquisition_details} = {
Lines 742-752 else { Link Here
742
            $item_info->{transfertto}   = $transfertto;
734
            $item_info->{transfertto}   = $transfertto;
743
        }
735
        }
744
736
745
        if ( C4::Context->preference('OPACAcquisitionDetails') ) {
746
            $item_info->{on_order} = 1
747
              if grep { $_ eq $item->itemnumber } @itemnumbers_on_order;
748
        }
749
750
        if ( C4::Context->preference("OPACLocalCoverImages") == 1 ) {
737
        if ( C4::Context->preference("OPACLocalCoverImages") == 1 ) {
751
            $item_info->{cover_images} = $item->cover_images;
738
            $item_info->{cover_images} = $item->cover_images;
752
        }
739
        }
753
- 

Return to bug 31463