From 77983324123cd91c048d6dbe66a95e42a492ece7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 30 Apr 2026 16:42:09 +0100 Subject: [PATCH] Bug 40445: (follow-up) Show actual cash removed alongside expected on discrepancy The cashup summary modal labelled the per-payment-type cash row "Cash removed from register", but the value came from the session transactions (with CASHUP_SURPLUS/DEFICIT lines excluded), so it represented the *expected* cash, not the amount actually counted at cashup. When a deficit or surplus existed, the reconciliation row appeared as the difference between two figures the user could not both see. Render two rows when surplus_total or deficit_total is set on a completed cashup: "Expected cash total" (from total_grouped) and "Cash removed from register" (from cash_register_actions.amount, already exposed as data.amount). The reconciliation row below now visibly equals the difference. Balanced cashups and the in-progress preview keep the original single-row display, and the negative-cashup branch flips the labels to "Expected cash to add to register" / "Cash added to register". Test plan: 1. Configure a cash register and record a few cash payments. 2. Trigger a cashup, enter the exact expected amount; open the summary modal -- a single "Cash removed from register" row is shown matching the expected total. 3. Repeat with an amount lower than expected -- "Expected cash total" and "Cash removed from register" both appear, and the "Cashup deficit" row is the difference. 4. Repeat with an amount higher than expected -- the actual row exceeds the expected row and "Cashup surplus" matches the gap. Sponsored-by: OpenFifth Signed-off-by: Jackie Usher Signed-off-by: Andrew Fuerste Henry Signed-off-by: Pedro Amorim --- .../prog/en/modules/pos/register.tt | 2 +- .../prog/en/modules/pos/registers.tt | 2 +- .../cashup_summary_modal.js} | 56 ++++++++++++++----- 3 files changed, 45 insertions(+), 15 deletions(-) rename koha-tmpl/intranet-tmpl/prog/js/{cashup_modal.js => modals/cashup_summary_modal.js} (83%) 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 452ca8b5af..7411fd1419 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -483,7 +483,7 @@ [% INCLUDE 'datatables.inc' %] [% INCLUDE 'format_price.inc' %] [% INCLUDE 'js-date-format.inc' %] - [% Asset.js("js/cashup_modal.js") | $raw %] + [% Asset.js("js/modals/cashup_summary_modal.js") | $raw %] [% Asset.js("js/modals/cashup_modals.js") | $raw %] [% Asset.js("js/modal_printer.js") | $raw %] [% INCLUDE 'calendar.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt index 8d87f3f774..6fcbdd1270 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt @@ -382,7 +382,7 @@ [% INCLUDE 'datatables.inc' %] [% INCLUDE 'format_price.inc' %] [% INCLUDE 'js-date-format.inc' %] - [% Asset.js("js/cashup_modal.js") | $raw %] + [% Asset.js("js/modals/cashup_summary_modal.js") | $raw %] [% Asset.js("js/modals/cashup_modals.js") | $raw %] [% Asset.js("js/modal_printer.js") | $raw %]