|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use utf8; |
19 |
use utf8; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 130; |
21 |
use Test::More tests => 131; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
|
23 |
|
| 24 |
use Data::Dumper; |
24 |
use Data::Dumper; |
|
Lines 2597-2602
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
| 2597 |
is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); |
2597 |
is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); |
| 2598 |
}; |
2598 |
}; |
| 2599 |
|
2599 |
|
|
|
2600 |
subtest '_FixAccountForLostAndReturned returns undef if patron is deleted' => sub { |
| 2601 |
plan tests => 1; |
| 2602 |
|
| 2603 |
my $manager = $builder->build_object({ class => "Koha::Patrons" }); |
| 2604 |
t::lib::Mocks::mock_userenv({ patron => $manager, branchcode => $manager->branchcode }); |
| 2605 |
|
| 2606 |
my $biblio = $builder->build_sample_biblio({ author => 'Hall, Kylie' }); |
| 2607 |
|
| 2608 |
my $branchcode = $library2->{branchcode}; |
| 2609 |
|
| 2610 |
my $item = $builder->build_sample_item( |
| 2611 |
{ |
| 2612 |
biblionumber => $biblio->biblionumber, |
| 2613 |
library => $branchcode, |
| 2614 |
replacementprice => 99.00, |
| 2615 |
itype => $itemtype, |
| 2616 |
} |
| 2617 |
); |
| 2618 |
|
| 2619 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 2620 |
|
| 2621 |
## Start with basic call, should just close out the open fine |
| 2622 |
my $accountline = Koha::Account::Line->new( |
| 2623 |
{ |
| 2624 |
borrowernumber => $patron->id, |
| 2625 |
accounttype => 'L', |
| 2626 |
status => undef, |
| 2627 |
itemnumber => $item->itemnumber, |
| 2628 |
amount => 99.00, |
| 2629 |
amountoutstanding => 99.00, |
| 2630 |
interface => 'test', |
| 2631 |
} |
| 2632 |
)->store(); |
| 2633 |
|
| 2634 |
$patron->delete(); |
| 2635 |
|
| 2636 |
my $return_value = C4::Circulation::_FixAccountForLostAndReturned( $patron->id, $item->itemnumber ); |
| 2637 |
|
| 2638 |
is( $return_value, undef, "_FixAccountForLostAndReturned returns undef if patron is deleted" ); |
| 2639 |
|
| 2640 |
}; |
| 2641 |
|
| 2600 |
subtest 'Set waiting flag' => sub { |
2642 |
subtest 'Set waiting flag' => sub { |
| 2601 |
plan tests => 4; |
2643 |
plan tests => 4; |
| 2602 |
|
2644 |
|
| 2603 |
- |
|
|