Lines 1988-1993
subtest 'AddReturn | is_overdue' => sub {
Link Here
|
1988 |
|
1988 |
|
1989 |
my $library = $builder->build( { source => 'Branch' } ); |
1989 |
my $library = $builder->build( { source => 'Branch' } ); |
1990 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
1990 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
|
|
1991 |
my $manager = $builder->build_object({ class => "Koha::Patrons" }); |
1992 |
t::lib::Mocks::mock_userenv({ patron => $manager, branchcode => $manager->branchcode }); |
1991 |
|
1993 |
|
1992 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
1994 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
1993 |
my $item = $builder->build( |
1995 |
my $item = $builder->build( |
Lines 2438-2444
subtest '_FixAccountForLostAndReturned' => sub {
Link Here
|
2438 |
}; |
2440 |
}; |
2439 |
|
2441 |
|
2440 |
subtest '_FixOverduesOnReturn' => sub { |
2442 |
subtest '_FixOverduesOnReturn' => sub { |
2441 |
plan tests => 6; |
2443 |
plan tests => 9; |
|
|
2444 |
|
2445 |
my $manager = $builder->build_object({ class => "Koha::Patrons" }); |
2446 |
t::lib::Mocks::mock_userenv({ patron => $manager, branchcode => $manager->branchcode }); |
2442 |
|
2447 |
|
2443 |
my $biblio = $builder->build_sample_biblio({ author => 'Hall, Kylie' }); |
2448 |
my $biblio = $builder->build_sample_biblio({ author => 'Hall, Kylie' }); |
2444 |
|
2449 |
|
Lines 2475-2481
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
2475 |
is( $accountline->amountoutstanding, '99.000000', 'Fine has the same amount outstanding as previously' ); |
2480 |
is( $accountline->amountoutstanding, '99.000000', 'Fine has the same amount outstanding as previously' ); |
2476 |
is( $accountline->status, 'RETURNED', 'Open fine ( account type OVERDUE ) has been closed out ( status RETURNED )'); |
2481 |
is( $accountline->status, 'RETURNED', 'Open fine ( account type OVERDUE ) has been closed out ( status RETURNED )'); |
2477 |
|
2482 |
|
2478 |
|
|
|
2479 |
## Run again, with exemptfine enabled |
2483 |
## Run again, with exemptfine enabled |
2480 |
$accountline->set( |
2484 |
$accountline->set( |
2481 |
{ |
2485 |
{ |
Lines 2494-2499
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
2494 |
is( $accountline->status, 'FORGIVEN', 'Open fine ( account type OVERDUE ) has been set to fine forgiven ( status FORGIVEN )'); |
2498 |
is( $accountline->status, 'FORGIVEN', 'Open fine ( account type OVERDUE ) has been set to fine forgiven ( status FORGIVEN )'); |
2495 |
is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" ); |
2499 |
is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" ); |
2496 |
is( $offset->amount, '-99.000000', "Amount of offset is correct" ); |
2500 |
is( $offset->amount, '-99.000000', "Amount of offset is correct" ); |
|
|
2501 |
my $credit = $offset->credit; |
2502 |
is( ref $credit, "Koha::Account::Line", "Found matching credit for fine forgiveness" ); |
2503 |
is( $credit->amount, '-99.000000', "Credit amount is set correctly" ); |
2504 |
is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); |
2497 |
}; |
2505 |
}; |
2498 |
|
2506 |
|
2499 |
subtest 'Set waiting flag' => sub { |
2507 |
subtest 'Set waiting flag' => sub { |
2500 |
- |
|
|