From 4ff0818a9324d357ed8be69bf8095456625c8f28 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 1 Feb 2021 14:50:02 +0000 Subject: [PATCH] Bug 26273: Add historic cashups table to register page This patch adds a historic cashups table to the bottom of the register transaction details page. It will only display if one or more cashups have taken place and contains links to allow display of the summary detail modal for each cashup. Test plan 1/ Enable UseCashRegisters 2/ Undertake a few transactions and cashups 3/ View the 'Register details' page 4/ Note the appearance of a 'Cashup history' section at the bottom of the page 5/ Note that 'Summary' button displays the relevant modal 6/ Signoff Signed-off-by: Sally Signed-off-by: Daniel Jones Signed-off-by: Sally --- .../intranet-tmpl/prog/en/modules/pos/register.tt | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) 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 5569539969..bb607901b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -223,6 +223,17 @@ [% END %] +

Cashup history

+
+ + + + + + + + +
DateAmountActions
[% END %] @@ -390,6 +401,45 @@ window.print(); }); + + var cashups_table_url = "/api/v1/cash_registers/[% register.id | html %]/cashups?"; + var cashups_table = $("#table_cashups").api({ + "ajax": { + "url": cashups_table_url + }, + "order": [[ 1, "asc" ]], + "columnDefs": [ { + "targets": [0,1], + "render": function (data, type, row, meta) { + if ( type == 'display' ) { + return data.escapeHtml(); + } + return data; + } + } ], + "columns": [ + { + "data": "timestamp", + "searchable": true, + "orderable": true + }, + { + "data": "amount", + "searchable": true, + "orderable": true + }, + { + "data": function( row, type, val, meta ) { + var result = ' '+_("Summary")+'\n'; + return result; + + }, + "searchable": false, + "orderable": false + } + ] + }, [], 1); + $(document).ready(function() { // http://jqueryui.com/demos/datepicker/#date-range var dates = $( "#from, #to" ).datepicker({ -- 2.11.0