From b34c2009f5f82c38602639525be2a89517cc79e1 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 Signed-off-by: Sally --- 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..e99c17a1ba 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:manager.surname", + "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