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

(-)a/Koha/Acquisition/Order.pm (-1 / +1 lines)
Lines 248-254 sub duplicate_to { Link Here
248
248
249
            $new_order = Koha::Acquisition::Order->new($order_info)->store;
249
            $new_order = Koha::Acquisition::Order->new($order_info)->store;
250
250
251
            if ( ! $self->subscriptionid || $self->basket->effective_create_items eq 'ordering') { # Do copy items if not a serial OR if items are created on ordering
251
            if ( ! $self->subscriptionid && $self->basket->effective_create_items eq 'ordering') { # Do copy items if not a serial AND if items are created on ordering
252
                my $items = $self->items;
252
                my $items = $self->items;
253
                while ( my ($item) = $items->next ) {
253
                while ( my ($item) = $items->next ) {
254
                    my $item_info = $item->unblessed;
254
                    my $item_info = $item->unblessed;
(-)a/t/db_dependent/Koha/Acquisition/Order.t (-5 / +4 lines)
Lines 215-222 subtest 'duplicate_to | add_item' => sub { Link Here
215
        t::lib::Mocks::mock_preference('AcqCreateItem', 'receiving');
215
        t::lib::Mocks::mock_preference('AcqCreateItem', 'receiving');
216
216
217
        my $duplicated_order = $order_no_sub->duplicate_to($basket_to);
217
        my $duplicated_order = $order_no_sub->duplicate_to($basket_to);
218
        is( $duplicated_order->items->count, 1,
218
        is( $duplicated_order->items->count, 0,
219
            'Items should be copied if the original order is not created from a subscription'
219
            'Items should not be copied if the original order did not create items on ordering'
220
        );
220
        );
221
221
222
        $duplicated_order = $order_from_sub->duplicate_to($basket_to);
222
        $duplicated_order = $order_from_sub->duplicate_to($basket_to);
Lines 236-243 subtest 'duplicate_to | add_item' => sub { Link Here
236
        );
236
        );
237
237
238
        $duplicated_order = $order_from_sub->duplicate_to($basket_to);
238
        $duplicated_order = $order_from_sub->duplicate_to($basket_to);
239
        is( $duplicated_order->items->count, 1,
239
        is( $duplicated_order->items->count, 0,
240
            'Items should be copied if items are created on ordering, even if created from subscription'
240
            'Items should never be copied if the original order is created from a subscription'
241
        );
241
        );
242
    };
242
    };
243
243
244
- 

Return to bug 22390