Bugzilla – Attachment 87561 Details for
Bug 22390
When duplicating existing order lines new items are not created
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22390: Never copy items if original order has been created from a subscription
Bug-22390-Never-copy-items-if-original-order-has-b.patch (text/plain), 2.63 KB, created by
Katrin Fischer
on 2019-04-08 21:52:35 UTC
(
hide
)
Description:
Bug 22390: Never copy items if original order has been created from a subscription
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-04-08 21:52:35 UTC
Size:
2.63 KB
patch
obsolete
>From 9b2368360676972d3919868698671b1c5ad7445f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Mar 2019 16:07:22 -0300 >Subject: [PATCH] Bug 22390: Never copy items if original order has been > created from a subscription > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Tiny change to the code comment: serial => subscription order >--- > Koha/Acquisition/Order.pm | 2 +- > t/db_dependent/Koha/Acquisition/Order.t | 8 ++++---- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 2b62760415..9bba0faef2 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -248,7 +248,7 @@ sub duplicate_to { > > $new_order = Koha::Acquisition::Order->new($order_info)->store; > >- if ( ! $self->subscriptionid || $self->basket->effective_create_items eq 'ordering') { # Do copy items if not a serial OR if items are created on ordering >+ if ( ! $self->subscriptionid && $self->basket->effective_create_items eq 'ordering') { # Do copy items if not a subscription order AND if items are created on ordering > my $items = $self->items; > while ( my ($item) = $items->next ) { > my $item_info = $item->unblessed; >diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t >index 9968c8bed3..a13f9c5edc 100644 >--- a/t/db_dependent/Koha/Acquisition/Order.t >+++ b/t/db_dependent/Koha/Acquisition/Order.t >@@ -215,8 +215,8 @@ subtest 'duplicate_to | add_item' => sub { > t::lib::Mocks::mock_preference('AcqCreateItem', 'receiving'); > > my $duplicated_order = $order_no_sub->duplicate_to($basket_to); >- is( $duplicated_order->items->count, 1, >- 'Items should be copied if the original order is not created from a subscription' >+ is( $duplicated_order->items->count, 0, >+ 'Items should not be copied if the original order did not create items on ordering' > ); > > $duplicated_order = $order_from_sub->duplicate_to($basket_to); >@@ -236,8 +236,8 @@ subtest 'duplicate_to | add_item' => sub { > ); > > $duplicated_order = $order_from_sub->duplicate_to($basket_to); >- is( $duplicated_order->items->count, 1, >- 'Items should be copied if items are created on ordering, even if created from subscription' >+ is( $duplicated_order->items->count, 0, >+ 'Items should never be copied if the original order is created from a subscription' > ); > }; > >-- >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 22390
:
85473
|
86027
|
86523
|
86524
|
87560
| 87561