Bug 11169: (follow-up) only count orders that have been placed
authorGalen Charlton <gmc@esilibrary.com>
Wed, 28 May 2014 18:28:29 +0000 (18:28 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 15 Jun 2014 14:12:46 +0000 (11:12 -0300)
This patch ensures that only orders that have been placed (i.e.,
orders whose basket is closed) are counted in the OPACAcquisitionsDetails
display.

To test:

[1] Turn on OPACAcquisitionsDetails and set AcqCreateItem to 'ordering'.
[2] Create an order for a record, but do not close the basket.
[3] View the record in the OPAC.  It should not display any order count.
[4] Close the bakset.
[5] View the record in the OPAC again.  This time, it should display
    the count of items on order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
opac/opac-detail.pl

index 4a193b8..224bf82 100755 (executable)
@@ -603,7 +603,7 @@ my ( @itemnumbers_on_order );
 if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
     my $orders = C4::Acquisition::SearchOrders({
         biblionumber => $biblionumber,
-        pending => 1,
+        ordered => 1,
     });
     my $total_quantity = 0;
     for my $order ( @$orders ) {