use Koha::Borrowers;
use Koha::Borrower::Debarments;
use Koha::Database;
+use Koha::Libraries;
use Carp;
use List::MoreUtils qw( uniq );
use Date::Calc qw(
sub AddReturn {
my ( $barcode, $branch, $exemptfine, $dropbox, $return_date, $dropboxdate ) = @_;
- if ($branch and not GetBranchDetail($branch)) {
+ if ($branch and not Koha::Libraries->find($branch)) {
warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'};
undef $branch;
}