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

(-)a/t/db_dependent/Circulation/Returns.t (-2 / +27 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 3;
20
use Test::More tests => 4;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 262-265 subtest "AddReturn logging on statistics table (item-level_itypes=0)" => sub { Link Here
262
        "biblio-level itype recorded on statistics for return");
262
        "biblio-level itype recorded on statistics for return");
263
};
263
};
264
264
265
subtest 'Handle ids duplication' => sub {
266
    plan tests => 1;
267
268
    my $biblio = $builder->build( { source => 'Biblio' } );
269
    my $item = $builder->build(
270
        {
271
            source => 'Item',
272
            value  => {
273
                biblionumber => $biblio->{biblionumber},
274
                notforloan => 0,
275
                itemlost   => 0,
276
                withdrawn  => 0,
277
278
            }
279
        }
280
    );
281
    my $patron = $builder->build({source => 'Borrower'});
282
283
    my $checkout = AddIssue( $patron, $item->{barcode} );
284
    $builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } });
285
286
    my @a = AddReturn( $item->{barcode} );
287
    my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id );
288
    isnt( $old_checkout->itemnumber, $item->{itemnumber}, 'If an item is checked-in, it should be moved to old_issues even if the issue_id already existed in the table' );
289
};
290
265
1;
291
1;
266
- 

Return to bug 18242