Bugzilla – Attachment 190415 Details for
Bug 40445
Point of Sale reconciliation input during daily summaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40445: (follow-up) Improve cashup summary display for negative amounts
876c463.patch (text/plain), 4.53 KB, created by
Martin Renvoize (ashimema)
on 2025-12-10 18:37:05 UTC
(
hide
)
Description:
Bug 40445: (follow-up) Improve cashup summary display for negative amounts
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-12-10 18:37:05 UTC
Size:
4.53 KB
patch
obsolete
>From 876c463ee5ed1248c1b83e34956fd3e7425b3bb1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 10 Dec 2025 18:31:32 +0000 >Subject: [PATCH] Bug 40445: (follow-up) Improve cashup summary display for > negative amounts > >When refunds exceed collections during a cashup session, the summary >modal now clearly explains the negative amounts. Adds an informational >notice and adjusts labels to indicate cash needs to be added to the >register rather than collected. > >Sponsored-by: OpenFifth <https://openfifth.co.uk/> >--- > .../intranet-tmpl/prog/js/cashup_modal.js | 50 +++++++++++++++++-- > 1 file changed, 45 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >index 11d00e034ca..ba236ee67c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >@@ -104,10 +104,34 @@ $(document).ready(function () { > var tfoot = summary_modal.find("tfoot"); > tfoot.empty(); > >+ // Determine if this is a negative cashup (float deficit scenario) >+ var isNegativeCashup = data.summary.total < 0; >+ >+ // Add informational notice for negative cashups >+ if (isNegativeCashup) { >+ var noticeText = __( >+ "This cashup shows a negative amount because refunds exceeded collections during this session. " + >+ "The register float was topped up to restore the expected balance." >+ ); >+ tbody.prepend( >+ "<tr class='reconciliation-info'><td colspan='2'>" + >+ "<i class='fa-solid fa-info-circle'></i> " + >+ "<strong>" + >+ __("Float deficit:") + >+ "</strong> " + >+ noticeText + >+ "</td></tr>" >+ ); >+ } >+ > // 1. Total (sum of all transactions) >+ var totalLabel = isNegativeCashup >+ ? __("Total float deficit") >+ : __("Total"); >+ > tfoot.append( > "<tr class='total-row'><td><strong>" + >- __("Total") + >+ totalLabel + > "</strong></td><td><strong>" + > data.summary.total.format_price() + > "</strong></td></tr>" >@@ -130,9 +154,14 @@ $(document).ready(function () { > } > } > if (cashCollected !== null) { >+ var cashLabel = >+ cashCollected < 0 >+ ? __("Cash added to register") >+ : __("Cash collected"); >+ > tfoot.append( > "<tr><td><strong>" + >- __("Cash collected") + >+ cashLabel + > "</strong></td><td><strong>" + > cashCollected.format_price() + > "</strong></td></tr>" >@@ -146,11 +175,22 @@ $(document).ready(function () { > type.payment_type !== "Cash" && > type.payment_type !== "CASH" > ) { >+ var paymentTypeLabel = >+ type.total < 0 >+ ? __x("{payment_type} to add", { >+ payment_type: escape_str( >+ type.payment_type >+ ), >+ }) >+ : __x("{payment_type} collected", { >+ payment_type: escape_str( >+ type.payment_type >+ ), >+ }); >+ > tfoot.append( > "<tr><td><strong>" + >- __x("{payment_type} collected", { >- payment_type: escape_str(type.payment_type), >- }) + >+ paymentTypeLabel + > "</strong></td><td><strong>" + > type.total.format_price() + > "</strong></td></tr>" >-- >2.52.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40445
:
185289
|
185290
|
185291
|
185292
|
185809
|
186636
|
186637
|
186638
|
186639
|
186640
|
186641
|
186642
|
186643
|
189333
|
189334
|
189335
|
189336
|
189337
|
189338
|
189339
|
189340
|
189341
|
189353
|
189354
|
189355
|
189356
|
189357
|
189358
|
189359
|
189360
|
189361
|
189362
|
189363
|
189364
|
189410
|
189411
|
189412
|
189413
|
189414
|
189415
|
189420
|
189421
|
189422
|
189423
|
189424
|
189425
|
189426
|
189427
|
189428
|
189429
|
189430
|
189476
|
189477
|
189478
|
189479
|
189480
|
189481
|
189482
|
190361
|
190362
|
190363
|
190364
|
190365
|
190366
|
190367
|
190368
|
190369
|
190370
|
190371
|
190372
|
190373
|
190374
|
190375
|
190376
|
190379
|
190380
|
190388
|
190389
|
190404
|
190405
|
190406
|
190407
|
190408
|
190409
|
190410
|
190411
|
190412
|
190413
|
190414
| 190415