Lines 296-303
subtest 'Handle ids duplication' => sub {
Link Here
|
296 |
|
296 |
|
297 |
my ($doreturn, $messages, $new_checkout, $borrower) = AddReturn( $item->{barcode}, undef, undef, undef, dt_from_string ); |
297 |
my ($doreturn, $messages, $new_checkout, $borrower) = AddReturn( $item->{barcode}, undef, undef, undef, dt_from_string ); |
298 |
|
298 |
|
299 |
my $account_lines = Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber, issue_id => $new_checkout->{issue_id} }); |
299 |
my $account_lines = Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber, issue_id => $original_checkout->issue_id }); |
300 |
is( $account_lines->count, 1, 'One account line should exist on new issue_id' ); |
300 |
is( $account_lines->count, 0, 'No account lines should exist on old issue_id' ); |
|
|
301 |
|
302 |
$account_lines = Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber, issue_id => $new_checkout->{issue_id} }); |
303 |
is( $account_lines->count, 2, 'Two account lines should exist on new issue_id' ); |
301 |
|
304 |
|
302 |
isnt( $original_checkout->issue_id, $new_checkout->{issue_id}, 'AddReturn should return the issue with the new issue_id' ); |
305 |
isnt( $original_checkout->issue_id, $new_checkout->{issue_id}, 'AddReturn should return the issue with the new issue_id' ); |
303 |
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' ); |
306 |
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' ); |
304 |
- |
|
|