Lines 2292-2298
subtest '_FixAccountForLostAndReturned' => sub {
Link Here
|
2292 |
}; |
2292 |
}; |
2293 |
|
2293 |
|
2294 |
subtest '_FixOverduesOnReturn' => sub { |
2294 |
subtest '_FixOverduesOnReturn' => sub { |
2295 |
plan tests => 6; |
2295 |
plan tests => 10; |
2296 |
|
2296 |
|
2297 |
# Generate test biblio |
2297 |
# Generate test biblio |
2298 |
my $title = 'Koha for Dummies'; |
2298 |
my $title = 'Koha for Dummies'; |
Lines 2345-2353
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
2345 |
C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 1 ); |
2345 |
C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 1 ); |
2346 |
|
2346 |
|
2347 |
$accountline->_result()->discard_changes(); |
2347 |
$accountline->_result()->discard_changes(); |
|
|
2348 |
my $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Forgiven' })->next(); |
2348 |
|
2349 |
|
2349 |
is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' ); |
2350 |
is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' ); |
2350 |
is( $accountline->accounttype, 'FFOR', 'Open fine ( account type FU ) has been set to fine forgiven ( account type FFOR )'); |
2351 |
is( $accountline->accounttype, 'FFOR', 'Open fine ( account type FU ) has been set to fine forgiven ( account type FFOR )'); |
|
|
2352 |
is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" ); |
2353 |
is( $offset->amount, '-99.000000', "Amount of offset is correct" ); |
2351 |
|
2354 |
|
2352 |
## Run again, with dropbox mode enabled |
2355 |
## Run again, with dropbox mode enabled |
2353 |
$accountline->set( |
2356 |
$accountline->set( |
Lines 2360-2368
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
2360 |
C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 0, 1 ); |
2363 |
C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 0, 1 ); |
2361 |
|
2364 |
|
2362 |
$accountline->_result()->discard_changes(); |
2365 |
$accountline->_result()->discard_changes(); |
|
|
2366 |
$offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Dropbox' })->next(); |
2363 |
|
2367 |
|
2364 |
is( $accountline->amountoutstanding + 0, 90, 'Fine has been reduced to 90' ); |
2368 |
is( $accountline->amountoutstanding + 0, 90, 'Fine has been reduced to 90' ); |
2365 |
is( $accountline->accounttype, 'F', 'Open fine ( account type FU ) has been closed out ( account type F )'); |
2369 |
is( $accountline->accounttype, 'F', 'Open fine ( account type FU ) has been closed out ( account type F )'); |
|
|
2370 |
is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via dropbox" ); |
2371 |
is( $offset->amount, '-9.000000', "Amount of offset is correct" ); |
2366 |
}; |
2372 |
}; |
2367 |
|
2373 |
|
2368 |
subtest 'Set waiting flag' => sub { |
2374 |
subtest 'Set waiting flag' => sub { |
2369 |
- |
|
|