From 98765f3fd6af9683d4eff77d65fcee25432f8e2b 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 --- .../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 00000000000..7e9e246918c --- /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 55c23fcddef..caaea05ed38 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' %]