diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js
index 29a1f3b064..b2394c6db7 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js
@@ -764,11 +764,6 @@ function patron_autocomplete(node, options) {
item.link = null;
}
- var cardnumber = "";
- if (item.cardnumber != "") {
- // Display card number in parentheses if it exists
- cardnumber = " (" + item.cardnumber + ") ";
- }
if (item.library_id == loggedInLibrary) {
loggedInClass = "ac-currentlibrary";
} else {
@@ -780,20 +775,7 @@ function patron_autocomplete(node, options) {
.append(
"" +
(item.link ? '' : "") +
- (item.surname ? item.surname.escapeHtml() : "") +
- ", " +
- (item.preferred_name
- ? item.preferred_name.escapeHtml()
- : item.firstname
- ? item.firstname.escapeHtml()
- : "") +
- " " +
- (item.middle_name ? item.middle_name.escapeHtml() : "") +
- " " +
- (item.other_name
- ? "(" + item.other_name.escapeHtml() + ")"
- : "") +
- cardnumber.escapeHtml() +
+ $patron_to_html(item, { display_cardnumber: true }) +
" " +
(item.date_of_birth
? $date(item.date_of_birth) +