Bugzilla – Attachment 86027 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.44 KB, created by
Jonathan Druart
on 2019-03-04 19:07:50 UTC
(
hide
)
Description:
Bug 22390: Never copy items if original order has been created from a subscription
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-04 19:07:50 UTC
Size:
2.44 KB
patch
obsolete
>From 2f20b8237cc046401dd70779509302b11803874b 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 > >--- > 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..b9349451e0 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 serial 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