From 1ff61e7206169cb814f464a2a575c755c09e5311 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 Signed-off-by: Katrin Fischer Bug 26273: (QA follow-up) Check for null firstname This patch adds a test for firstname being defined before constructing fullname from it. Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- api/v1/swagger/paths/cash_registers.json | 5 +++- .../prog/en/modules/pos/register.tt | 24 +++++++++++++++++-- 2 files changed, 26 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 aa2e47f837..3b06a6eb4b 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,21 @@ return $datetime(row.timestamp); } }, + { + "data": "manager.firstname:manager.surname", + "searchable": true, + "orderable": true, + "render": function(data, type, row, meta) { + var fullname; + if ( row.manager.firstname == null ) { + fullname = row.manager.surname; + } + else { + fullname = row.manager.firstname + " " + row.manager.surname; + } + return fullname; + } + }, { "data": "amount", "searchable": true, -- 2.39.5