|
Lines 502-508
ok((not defined $error), "DelOrder does not fail");
Link Here
|
| 502 |
$order1 = GetOrder($order1->{ordernumber}); |
502 |
$order1 = GetOrder($order1->{ordernumber}); |
| 503 |
ok((defined $order1->{datecancellationprinted}), "order is cancelled"); |
503 |
ok((defined $order1->{datecancellationprinted}), "order is cancelled"); |
| 504 |
ok((not defined $order1->{cancellationreason}), "order has no cancellation reason"); |
504 |
ok((not defined $order1->{cancellationreason}), "order has no cancellation reason"); |
| 505 |
ok((defined GetBiblio($order1->{biblionumber})), "biblio still exists"); |
505 |
ok((defined Koha::Biblios->find( $order1->{biblionumber} )), "biblio still exists"); |
| 506 |
|
506 |
|
| 507 |
$order2 = GetOrder($ordernumbers[1]); |
507 |
$order2 = GetOrder($ordernumbers[1]); |
| 508 |
$error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1); |
508 |
$error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1); |
|
Lines 510-516
ok((not defined $error), "DelOrder does not fail");
Link Here
|
| 510 |
$order2 = GetOrder($order2->{ordernumber}); |
510 |
$order2 = GetOrder($order2->{ordernumber}); |
| 511 |
ok((defined $order2->{datecancellationprinted}), "order is cancelled"); |
511 |
ok((defined $order2->{datecancellationprinted}), "order is cancelled"); |
| 512 |
ok((not defined $order2->{cancellationreason}), "order has no cancellation reason"); |
512 |
ok((not defined $order2->{cancellationreason}), "order has no cancellation reason"); |
| 513 |
ok((not defined GetBiblio($order2->{biblionumber})), "biblio does not exist anymore"); |
513 |
ok((not defined Koha::Biblios->find( $order2->{biblionumber} )), "biblio does not exist anymore"); |
| 514 |
|
514 |
|
| 515 |
my $order4 = GetOrder($ordernumbers[3]); |
515 |
my $order4 = GetOrder($ordernumbers[3]); |
| 516 |
$error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar"); |
516 |
$error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar"); |
|
Lines 518-531
ok((not defined $error), "DelOrder does not fail");
Link Here
|
| 518 |
$order4 = GetOrder($order4->{ordernumber}); |
518 |
$order4 = GetOrder($order4->{ordernumber}); |
| 519 |
ok((defined $order4->{datecancellationprinted}), "order is cancelled"); |
519 |
ok((defined $order4->{datecancellationprinted}), "order is cancelled"); |
| 520 |
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\""); |
520 |
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\""); |
| 521 |
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore"); |
521 |
ok((not defined Koha::Biblios->find( $order4->{biblionumber} )), "biblio does not exist anymore"); |
| 522 |
|
522 |
|
| 523 |
my $order5 = GetOrder($ordernumbers[4]); |
523 |
my $order5 = GetOrder($ordernumbers[4]); |
| 524 |
C4::Items::AddItem( { barcode => '0102030405' }, $order5->{biblionumber} ); |
524 |
C4::Items::AddItem( { barcode => '0102030405' }, $order5->{biblionumber} ); |
| 525 |
$error = DelOrder($order5->{biblionumber}, $order5->{ordernumber}, 1); |
525 |
$error = DelOrder($order5->{biblionumber}, $order5->{ordernumber}, 1); |
| 526 |
$order5 = GetOrder($order5->{ordernumber}); |
526 |
$order5 = GetOrder($order5->{ordernumber}); |
| 527 |
ok((defined $order5->{datecancellationprinted}), "order is cancelled"); |
527 |
ok((defined $order5->{datecancellationprinted}), "order is cancelled"); |
| 528 |
ok(GetBiblio($order5->{biblionumber}), "biblio still exists"); |
528 |
ok((defined Koha::Biblios->find( $order5->{biblionumber} )), "biblio still exists"); |
| 529 |
|
529 |
|
| 530 |
# End of tests for DelOrder |
530 |
# End of tests for DelOrder |
| 531 |
|
531 |
|