|
Lines 263-269
subtest "AddReturn logging on statistics table (item-level_itypes=0)" => sub {
Link Here
|
| 263 |
}; |
263 |
}; |
| 264 |
|
264 |
|
| 265 |
subtest 'Handle ids duplication' => sub { |
265 |
subtest 'Handle ids duplication' => sub { |
| 266 |
plan tests => 1; |
266 |
plan tests => 2; |
| 267 |
|
267 |
|
| 268 |
my $biblio = $builder->build( { source => 'Biblio' } ); |
268 |
my $biblio = $builder->build( { source => 'Biblio' } ); |
| 269 |
my $item = $builder->build( |
269 |
my $item = $builder->build( |
|
Lines 283-290
subtest 'Handle ids duplication' => sub {
Link Here
|
| 283 |
my $checkout = AddIssue( $patron, $item->{barcode} ); |
283 |
my $checkout = AddIssue( $patron, $item->{barcode} ); |
| 284 |
$builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } }); |
284 |
$builder->build({ source => 'OldIssue', value => { issue_id => $checkout->issue_id } }); |
| 285 |
|
285 |
|
| 286 |
my @a = AddReturn( $item->{barcode} ); |
286 |
my ($doreturn, $messages, $issue, $borrower) = AddReturn( $item->{barcode} ); |
| 287 |
my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id ); |
287 |
my $old_checkout = Koha::Old::Checkouts->find( $checkout->issue_id ); |
|
|
288 |
|
| 289 |
isnt( $checkout->issue_id, $issue->{issue_id}, 'AddReturn should return the issue with the new 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' ); |
290 |
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 |
}; |
291 |
}; |
| 290 |
|
292 |
|
| 291 |
- |
|
|