Lines 846-852
subtest "Koha::Account::non_issues_charges tests" => sub {
Link Here
|
846 |
|
846 |
|
847 |
subtest "Koha::Account::Line::void tests" => sub { |
847 |
subtest "Koha::Account::Line::void tests" => sub { |
848 |
|
848 |
|
849 |
plan tests => 12; |
849 |
plan tests => 15; |
850 |
|
850 |
|
851 |
# Create a borrower |
851 |
# Create a borrower |
852 |
my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; |
852 |
my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; |
Lines 886-893
subtest "Koha::Account::Line::void tests" => sub {
Link Here
|
886 |
is( $line1->amountoutstanding+0, 0, 'First fee has amount outstanding of 0' ); |
886 |
is( $line1->amountoutstanding+0, 0, 'First fee has amount outstanding of 0' ); |
887 |
is( $line2->amountoutstanding+0, 0, 'Second fee has amount outstanding of 0' ); |
887 |
is( $line2->amountoutstanding+0, 0, 'Second fee has amount outstanding of 0' ); |
888 |
|
888 |
|
889 |
$account_payment->void(); |
889 |
my $ret = $account_payment->void(); |
890 |
|
890 |
|
|
|
891 |
is( ref($ret), 'Koha::Account::Line', 'Void returns the account line' ); |
891 |
is( $account->balance(), 30, "Account balance is again 30" ); |
892 |
is( $account->balance(), 30, "Account balance is again 30" ); |
892 |
|
893 |
|
893 |
$account_payment->_result->discard_changes(); |
894 |
$account_payment->_result->discard_changes(); |
Lines 900-905
subtest "Koha::Account::Line::void tests" => sub {
Link Here
|
900 |
|
901 |
|
901 |
is( $line1->amountoutstanding+0, 10, 'First fee again has amount outstanding of 10' ); |
902 |
is( $line1->amountoutstanding+0, 10, 'First fee again has amount outstanding of 10' ); |
902 |
is( $line2->amountoutstanding+0, 20, 'Second fee again has amount outstanding of 20' ); |
903 |
is( $line2->amountoutstanding+0, 20, 'Second fee again has amount outstanding of 20' ); |
|
|
904 |
|
905 |
# Accountlines that are not credits should be un-voidable |
906 |
my $line1_pre = $line1->unblessed(); |
907 |
$ret = $line1->void(); |
908 |
$line1->_result->discard_changes(); |
909 |
my $line1_post = $line1->unblessed(); |
910 |
is( $ret, undef, 'Attempted void on non-credit returns undef' ); |
911 |
is_deeply( $line1_pre, $line1_post, 'Non-credit account line cannot be voided' ) |
903 |
}; |
912 |
}; |
904 |
|
913 |
|
905 |
subtest "Koha::Account::Offset credit & debit tests" => sub { |
914 |
subtest "Koha::Account::Offset credit & debit tests" => sub { |
906 |
- |
|
|