From 607b19a0f5da5b6c14c2e7d1f6ba36e759835480 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Feb 2021 10:19:57 +0000 Subject: [PATCH] Bug 26273: (follow-up) Add 'Cashier' to the cashups table This patch adds the 'Cashier' field as discussed on the bug report. Test plan 1/ Apply patch and reload the register page to refresh the table 2/ Note that a 'Cashier' field now appears in the table 3/ Sorting and searching on 'Cashier' should work as expected 4/ Default sorting should remain as 'Date' order. 5/ Signoff --- api/v1/swagger/paths/cash_registers.json | 5 ++++- .../prog/en/modules/pos/register.tt | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/api/v1/swagger/paths/cash_registers.json b/api/v1/swagger/paths/cash_registers.json index 837f1ad35b..5466cd18be 100644 --- a/api/v1/swagger/paths/cash_registers.json +++ b/api/v1/swagger/paths/cash_registers.json @@ -57,7 +57,10 @@ "permissions": { "cash_management": "cashup" } - } + }, + "x-koha-embed": [ + "manager" + ] } }, "/cashups/{cashup_id}": { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt index e368f65043..b46d4f66b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -229,6 +229,7 @@ Date + Cashier Amount Actions @@ -408,9 +409,13 @@ "ajax": { "url": cashups_table_url }, - "order": [[ 1, "asc" ]], + "header_filter": true, + "embed": [ + "manager" + ], + "order": [[ 0, "asc" ]], "columnDefs": [ { - "targets": [0,1], + "targets": [0,1,2], "render": function (data, type, row, meta) { if ( type == 'display' ) { return data.escapeHtml(); @@ -427,6 +432,15 @@ return $datetime(row.timestamp); } }, + { + "data": "manager.firstname", + "searchable": true, + "orderable": true, + "render": function(data, type, row, meta) { + var fullname = row.manager.firstname + ' ' + row.manager.surname; + return fullname; + } + }, { "data": "amount", "searchable": true, -- 2.20.1