-if ($borrowernumber) {
- $borrower = GetMemberDetails( $borrowernumber, 0 );
- my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
-
- # Warningdate is the date that the warning starts appearing
- my ( $today_year, $today_month, $today_day) = Today();
- my ($warning_year, $warning_month, $warning_day) = split /-/, $borrower->{'dateexpiry'};
- my ( $enrol_year, $enrol_month, $enrol_day) = split /-/, $borrower->{'dateenrolled'};
+$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
+if ($patron) {
+ my $overdues = $patron->get_overdues;
+ my $issues = $patron->checkouts;
+ my $balance = $patron->account->balance;
+
+