Bugzilla – Attachment 25031 Details for
Bug 11552
After a transfer, allow to search on the original order line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11552; After a transfer, allow to search on the original order line
Bug-11552-After-a-transfer-allow-to-search-on-the-.patch (text/plain), 3.13 KB, created by
Biblibre Sandboxes
on 2014-02-04 15:04:19 UTC
(
hide
)
Description:
Bug 11552; After a transfer, allow to search on the original order line
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-02-04 15:04:19 UTC
Size:
3.13 KB
patch
obsolete
>From 09ccc5249f0837d7cdbb6469ea10687870f99ff7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 14 Jan 2014 13:33:58 +0100 >Subject: [PATCH] Bug 11552; After a transfer, allow to search on the original order line > >If an order is transferred from a basket to another, it should be >possible to retrieve it with the original ordernumber. > >Test plan: >- transfer an order >- note the original ordernumber and the new one >- receive the order and, on the parcel page, try to find your order with > the original ordernumber and the new one. > >Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> >--- > C4/Acquisition.pm | 12 ++++++++++-- > t/db_dependent/Acquisition/TransferOrder.t | 9 ++++++++- > 2 files changed, 18 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 56c2d7f..7bd92a7 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1687,6 +1687,14 @@ sub SearchOrders { > LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber > LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber > LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber >+ }; >+ >+ # If we search on ordernumber, we retrieve the transfered order is a transfer has been done. >+ $query .= q{ >+ LEFT JOIN aqorders_transfers ON aqorders_transfers.ordernumber_to = aqorders.ordernumber >+ } if $ordernumber; >+ >+ $query .= q{ > WHERE (datecancellationprinted is NULL) > }; > >@@ -1708,8 +1716,8 @@ sub SearchOrders { > } > > if ( $ordernumber ) { >- $query .= ' AND (aqorders.ordernumber=?)'; >- push @args, $ordernumber; >+ $query .= ' AND ( aqorders.ordernumber = ? OR aqorders_transfers.ordernumber_from = ? ) '; >+ push @args, ( $ordernumber, $ordernumber ); > } > if( $search ) { > $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)'; >diff --git a/t/db_dependent/Acquisition/TransferOrder.t b/t/db_dependent/Acquisition/TransferOrder.t >index a608627..e517f7f 100644 >--- a/t/db_dependent/Acquisition/TransferOrder.t >+++ b/t/db_dependent/Acquisition/TransferOrder.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 11; > use C4::Context; > use C4::Acquisition; > use C4::Biblio; >@@ -78,6 +78,13 @@ is(scalar GetOrders($basketno2), 1, "1 order in basket2"); > ($order) = GetOrders($basketno2); > is(scalar GetItemnumbersFromOrder($order->{ordernumber}), 1, "1 item in basket2's order"); > >+# Bug 11552 >+my $orders = SearchOrders({ ordernumber => $newordernumber }); >+is ( scalar( @$orders ), 1, 'SearchOrders returns 1 order with newordernumber' ); >+$orders = SearchOrders({ ordernumber => $ordernumber }); >+is ( scalar( @$orders ), 1, 'SearchOrders returns 1 order with [old]ordernumber' ); >+is ( $orders->[0]->{ordernumber}, $newordernumber, 'SearchOrders returns newordernumber if [old]ordernumber is given' ); >+ > ModReceiveOrder( $biblionumber, $newordernumber, 2, undef, undef, undef, undef, undef, undef, dt_from_string ); > CancelReceipt( $newordernumber ); > $order = GetOrder( $newordernumber ); >-- >1.7.2.5
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 11552
:
24281
|
25031
|
26054