From 7878aa00123d79065692b046e2a7538d313a6c1f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 28 Jan 2021 17:20:29 +0000 Subject: [PATCH] Bug 26274: Update register.tt to use the API This patch updates the existing register details page to utilise the new api routes to gather the summary details on demand. Test plan 1/ Enable cash registers 2/ Add some transactions 3/ Perform a cashup 4/ Click 'Summary' next to the last cashup date 5/ Note the modal appears as it did prior to the patch being applied. 6/ Check the print option still works 7/ Signoff Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- .../en/includes/modals/cashup_summary.inc | 33 ++++++++++ .../prog/en/modules/pos/register.tt | 65 ++----------------- .../intranet-tmpl/prog/js/cashup_modal.js | 52 +++++++++++++++ 3 files changed, 89 insertions(+), 61 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/cashup_summary.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/cashup_summary.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/cashup_summary.inc new file mode 100644 index 0000000000..7e9e246918 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/cashup_summary.inc @@ -0,0 +1,33 @@ + + 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 1564a0f8aa..5569539969 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -59,8 +59,7 @@

Summary

    [% IF register.last_cashup %] -
  • Last cashup: [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %] (Summary)
  • - +
  • Last cashup: [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %] (Summary)
  • [% END %]
  • Float: [% register.starting_float | $Price %]
  • Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => 'CASH') * -1 | $Price %])
  • @@ -304,68 +303,12 @@ - - [% IF register.last_cashup %] - - [% END %] + [% INCLUDE 'modals/cashup_summary.inc' %] -[% MACRO jsinclude BLOCK %] + [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] + [% Asset.js("js/cashup_modal.js") | $raw %] [% INCLUDE 'calendar.inc' %]