From 26419d5560c52d8137f5e060b250eb54ee635426 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 Signed-off-by: Katrin Fischer Bug 26273: (QA follow-up) Remove unrequired table_controls div Looks like a copy/paste issue.. I don't believe we need this div at all for the table to function as expected and adding it just creates uneeded whitespace. Signed-off-by: Katrin Fischer Bug 26273: (QA follow-up) Add horizontal rule to distinguish tables Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../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 ebee5bd376..0907f6764f 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.39.5