Lines 2219-2225
subtest '_FixAccountForLostAndReturned' => sub {
Link Here
|
2219 |
my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); |
2219 |
my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); |
2220 |
my $credit_return = Koha::Account::Lines->find($credit_return_id); |
2220 |
my $credit_return = Koha::Account::Lines->find($credit_return_id); |
2221 |
|
2221 |
|
2222 |
is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2222 |
is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2223 |
is( $credit_return->amount + 0, |
2223 |
is( $credit_return->amount + 0, |
2224 |
-99.00, 'The account line of type LOST_RETURN has an amount of -99' ); |
2224 |
-99.00, 'The account line of type LOST_RETURN has an amount of -99' ); |
2225 |
is( $credit_return->amountoutstanding + 0, |
2225 |
is( $credit_return->amountoutstanding + 0, |
Lines 2277-2283
subtest '_FixAccountForLostAndReturned' => sub {
Link Here
|
2277 |
my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); |
2277 |
my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); |
2278 |
my $credit_return = Koha::Account::Lines->find($credit_return_id); |
2278 |
my $credit_return = Koha::Account::Lines->find($credit_return_id); |
2279 |
|
2279 |
|
2280 |
is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2280 |
is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2281 |
is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' ); |
2281 |
is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' ); |
2282 |
is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_RETURN has an amountoutstanding of 0' ); |
2282 |
is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_RETURN has an amountoutstanding of 0' ); |
2283 |
|
2283 |
|
Lines 2371-2377
subtest '_FixAccountForLostAndReturned' => sub {
Link Here
|
2371 |
'LOST', 'Lost fee now still has account type of LOST' ); |
2371 |
'LOST', 'Lost fee now still has account type of LOST' ); |
2372 |
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); |
2372 |
is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); |
2373 |
|
2373 |
|
2374 |
is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2374 |
is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); |
2375 |
is( $credit_return->amount + 0, |
2375 |
is( $credit_return->amount + 0, |
2376 |
($payment_amount + $outstanding ) * -1, |
2376 |
($payment_amount + $outstanding ) * -1, |
2377 |
'The account line of type LOST_RETURN has an amount equal to the payment + outstanding' |
2377 |
'The account line of type LOST_RETURN has an amount equal to the payment + outstanding' |