@@ -, +, @@ --- circ/circulation.pl | 7 +++---- members/moremember.pl | 8 +++++--- 2 files changed, 8 insertions(+), 7 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -304,11 +304,10 @@ if ($patron) { } # Calculate and display patron's age - my $dateofbirth = $borrower->{ 'dateofbirth' }; - my $age = GetAge($dateofbirth); + my $age = $patron->get_age; - my $borrowercategory = Koha::Patron::Categories->find($borrower->{ 'categorycode' }); - my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); + my $patroncategory = $patron->category; + my ($low,$high) = ($patroncategory->dateofbirthrequired, $patroncategory->upperagelimit); if (($high && ($age > $high)) or ($age < $low)) { $template->param( age_limitations => 1 ); $template->param( age_low => $low ); --- a/members/moremember.pl +++ a/members/moremember.pl @@ -246,13 +246,15 @@ my $overdues_exist = 0; my $totalprice = 0; # Calculate and display patron's age +my $age; if ( $data->{dateofbirth} ) { - $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age ); + $age = Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age; + $template->param( age => $age ); } # Check patron's category against age -my $borrowercategory = Koha::Patron::Categories->find($data->{ 'categorycode' }); -my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); +my $patroncategory = Koha::Patron::Categories->find($data->{ 'categorycode' }); +my ($low,$high) = ($patroncategory->dateofbirthrequired, $patroncategory->upperagelimit); if (($high && ($age > $high)) or ($age < $low)) { $template->param( age_limitations => 1 ); $template->param( age_low => $low ); --