Bugzilla – Attachment 77316 Details for
Bug 15184
Ability to duplicate existing order lines to a given basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15184: Add the ordernumbers filters to GetHistory
Bug-15184-Add-the-ordernumbers-filters-to-GetHisto.patch (text/plain), 2.49 KB, created by
Jonathan Druart
on 2018-07-27 19:59:12 UTC
(
hide
)
Description:
Bug 15184: Add the ordernumbers filters to GetHistory
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-27 19:59:12 UTC
Size:
2.49 KB
patch
obsolete
>From dca9672f4fd2b09e65ac6e94e3005437947b4a40 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 27 Jul 2018 15:48:23 -0300 >Subject: [PATCH] Bug 15184: Add the ordernumbers filters to GetHistory > >It adds the ability to return the result of GetHistory given a list a >ordernumbers >--- > C4/Acquisition.pm | 5 +++++ > t/db_dependent/Acquisition.t | 7 ++++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index a257017dc7..016d33e15a 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2282,6 +2282,7 @@ sub GetHistory { > my $ordernumber = $params{ordernumber}; > my $search_children_too = $params{search_children_too} || 0; > my $created_by = $params{created_by} || []; >+ my $ordernumbers = $params{ordernumbers} || []; > > my @order_loop; > my $total_qty = 0; >@@ -2442,6 +2443,10 @@ sub GetHistory { > push @query_params, @$created_by; > } > >+ if ( @$ordernumbers ) { >+ $query .= ' AND (aqorders.ordernumber IN ( ' . join (',', ('?') x @$ordernumbers ) . '))'; >+ push @query_params, @$ordernumbers; >+ } > > if ( C4::Context->preference("IndependentBranches") ) { > unless ( C4::Context->IsSuperLibrarian() ) { >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 975fb034b2..b7c80121c4 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use POSIX qw(strftime); > >-use Test::More tests => 68; >+use Test::More tests => 70; > use t::lib::Mocks; > use Koha::Database; > >@@ -437,6 +437,11 @@ my $orders = GetHistory( ordernumber => $ordernumbers[1] ); > is( scalar( @$orders ), 1, 'GetHistory with a given ordernumber returns 1 order' ); > $orders = GetHistory( ordernumber => $ordernumbers[1], search_children_too => 1 ); > is( scalar( @$orders ), 2, 'GetHistory with a given ordernumber and search_children_too set returns 2 orders' ); >+$orders = GetHistory( ordernumbers => [$ordernumbers[1]] ); >+is( scalar( @$orders ), 1, 'GetHistory with a given ordernumbers returns 1 order' ); >+$orders = GetHistory( ordernumbers => \@ordernumbers ); >+is( scalar( @$orders ), scalar( @ordernumbers ) - 1, 'GetHistory with a list of ordernumbers returns N-1 orders (was has been deleted [3])' ); >+ > > # Test GetHistory() with and without SearchWithISBNVariations > # The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15184
:
77314
|
77315
|
77316
|
77317
|
77318
|
77513
|
77514
|
77515
|
77516
|
77517
|
77966
|
77967
|
77968
|
77969
|
77970
|
78074
|
78075
|
78076
|
78077
|
78078
|
78277
|
78278
|
78279
|
78280
|
78281
|
78282
|
78283
|
78284
|
78285
|
78340
|
78535
|
78536
|
78537
|
78538
|
78539
|
78697
|
78698
|
78699
|
78700
|
78701
|
78702
|
78703
|
78704
|
78705
|
78706
|
78898
|
78911
|
78927
|
78958
|
78959
|
78960
|
78961
|
78962
|
78963
|
78964
|
78965
|
78966
|
78967
|
78968
|
78969
|
78970
|
80485
|
80486
|
80487
|
80488
|
80489
|
80490
|
80491
|
80492
|
80493
|
80494
|
80495
|
80638
|
81435
|
81436
|
81437
|
81438
|
81439
|
81440
|
81441
|
81442
|
81443
|
81444
|
81445
|
81446
|
81447
|
81448
|
82079