@@ -, +, @@ --- Koha/Account.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -76,9 +76,8 @@ sub pay { my $account_type = $params->{account_type}; my $offset_type = $params->{offset_type} || $type eq 'writeoff' ? 'Writeoff' : 'Payment'; - $library_id ||= C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; - my $userenv = C4::Context->userenv; + $library_id ||= $userenv ? $userenv->{'branch'} : undef; # We should remove accountno, it is no longer needed my $last = Koha::Account::Lines->search( --