# Get ID of logged in user. if called from a batch job,
# no user session exists and C4::Context->userenv() returns
- # the scalar '0'. Only do this is the syspref says so
+ # the scalar '0'. Only do this if the syspref says so
if ( C4::Context->preference('RecordStaffUserOnCheckout') ) {
my $userenv = C4::Context->userenv();
my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef;
}
);
my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef;
- $nb_rows += $old_issues_to_anonymise->update( {
- 'old_issues.borrowernumber' => $anonymous_patron
- } );
+ $nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } );
}
return $nb_rows;
}
is( $item->itemnumber, $item_1->itemnumber, 'Koha::Checkout->item should return the correct item' );
};
-$retrieved_checkout_1->delete;
-is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
-
subtest 'patron' => sub {
plan tests => 3;
my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});
);
};
+$retrieved_checkout_1->delete;
+is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
+
subtest 'issuer' => sub {
plan tests => 3;
my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});