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

(-)a/C4/Acquisition.pm (+5 lines)
Lines 2290-2295 sub GetHistory { Link Here
2290
    my $ordernumber = $params{ordernumber};
2290
    my $ordernumber = $params{ordernumber};
2291
    my $search_children_too = $params{search_children_too} || 0;
2291
    my $search_children_too = $params{search_children_too} || 0;
2292
    my $created_by = $params{created_by} || [];
2292
    my $created_by = $params{created_by} || [];
2293
    my $ordernumbers = $params{ordernumbers} || [];
2293
2294
2294
    my @order_loop;
2295
    my @order_loop;
2295
    my $total_qty         = 0;
2296
    my $total_qty         = 0;
Lines 2450-2455 sub GetHistory { Link Here
2450
        push @query_params, @$created_by;
2451
        push @query_params, @$created_by;
2451
    }
2452
    }
2452
2453
2454
    if ( @$ordernumbers ) {
2455
        $query .= ' AND (aqorders.ordernumber IN ( ' . join (',', ('?') x @$ordernumbers ) . '))';
2456
        push @query_params, @$ordernumbers;
2457
    }
2453
2458
2454
    if ( C4::Context->preference("IndependentBranches") ) {
2459
    if ( C4::Context->preference("IndependentBranches") ) {
2455
        unless ( C4::Context->IsSuperLibrarian() ) {
2460
        unless ( C4::Context->IsSuperLibrarian() ) {
(-)a/t/db_dependent/Acquisition.t (-1 / +5 lines)
Lines 438-443 my $orders = GetHistory( ordernumber => $ordernumbers[1] ); Link Here
438
is( scalar( @$orders ), 1, 'GetHistory with a given ordernumber returns 1 order' );
438
is( scalar( @$orders ), 1, 'GetHistory with a given ordernumber returns 1 order' );
439
$orders = GetHistory( ordernumber => $ordernumbers[1], search_children_too => 1 );
439
$orders = GetHistory( ordernumber => $ordernumbers[1], search_children_too => 1 );
440
is( scalar( @$orders ), 2, 'GetHistory with a given ordernumber and search_children_too set returns 2 orders' );
440
is( scalar( @$orders ), 2, 'GetHistory with a given ordernumber and search_children_too set returns 2 orders' );
441
$orders = GetHistory( ordernumbers => [$ordernumbers[1]] );
442
is( scalar( @$orders ), 1, 'GetHistory with a given ordernumbers returns 1 order' );
443
$orders = GetHistory( ordernumbers => \@ordernumbers );
444
is( scalar( @$orders ), scalar( @ordernumbers ) - 1, 'GetHistory with a list of ordernumbers returns N-1 orders (was has been deleted [3])' );
445
441
446
442
# Test GetHistory() with and without SearchWithISBNVariations
447
# Test GetHistory() with and without SearchWithISBNVariations
443
# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml
448
# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml
444
- 

Return to bug 15184