@@ -, +, @@ --- C4/Accounts.pm | 2 ++ C4/Circulation.pm | 2 +- t/db_dependent/Circulation/issue.t | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -211,6 +211,8 @@ sub manualinvoice { my $accountno = getnextacctno($borrowernumber); my $amountleft = $amount; + $itemnum ||= undef; + if ( ( $type eq 'L' ) or ( $type eq 'F' ) or ( $type eq 'A' ) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -3223,7 +3223,7 @@ sub AddIssuingCharge { my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; - Koha::Account::Line->new( + return Koha::Account::Line->new( { date => dt_from_string(), borrowernumber => $borrowernumber, --- a/t/db_dependent/Circulation/issue.t +++ a/t/db_dependent/Circulation/issue.t @@ -207,8 +207,8 @@ $sth = $dbh->prepare($query); $sth->execute; my $countaccount = $sth -> fetchrow_array; is ($countaccount,0,"0 accountline exists"); -is( C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, 10 ), - 1, "An issuing charge has been added" ); +isa_ok( C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, 10 ), + 'Koha::Account::Line', "An issuing charge has been added" ); my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef ); $sth->execute; $countaccount = $sth -> fetchrow_array; --