Bugzilla – Attachment 189362 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: Add detailed error handling for cashup completion failures
Bug-40445-Add-detailed-error-handling-for-cashup-c.patch (text/plain), 3.79 KB, created by
Martin Renvoize (ashimema)
on 2025-11-07 17:07:44 UTC
(
hide
)
Description:
Bug 40445: Add detailed error handling for cashup completion failures
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-11-07 17:07:44 UTC
Size:
3.79 KB
patch
obsolete
>From e5a338d8ffb1b89541642150497ab8b79e1f5ae8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 7 Nov 2025 16:26:05 +0000 >Subject: [PATCH] Bug 40445: Add detailed error handling for cashup completion > failures > >The cashup completion process in pos/register.pl was providing only >a generic "Failed to complete cashup" message for all errors, making >it difficult to diagnose issues during development and production use. > >This patch enhances error handling by: > >1. Adding specific error messages for MissingParameter exceptions > (displays the actual missing parameter name) > >2. Adding specific error messages for AmountNotPositive exceptions > (clarifies that amount must be positive and non-zero) > >3. Displaying detailed error information for unhandled exceptions > in the generic error case (aids debugging) > >These improvements provide clearer feedback to users and make it easier >to troubleshoot cashup failures in both two-phase and legacy workflows. > >Test plan: >1. Attempt cashup operations that trigger various exceptions >2. Verify each exception type shows an appropriate, specific error message >3. Confirm the error details help identify the root cause >--- > .../intranet-tmpl/prog/en/modules/pos/register.tt | 15 ++++++++++++++- > pos/register.pl | 8 +++++++- > 2 files changed, 21 insertions(+), 2 deletions(-) > >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 2f012023fd1..53ec4dbda88 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -68,8 +68,21 @@ > <div id="error_message" class="alert alert-warning"> Failed to start cashup. Please try again. </div> > [% END %] > >+ [% IF ( error_cashup_missing_param ) %] >+ <div id="error_message" class="alert alert-warning"> Missing required parameter for cashup: [% error_message | html %] </div> >+ [% END %] >+ >+ [% IF ( error_cashup_amount_invalid ) %] >+ <div id="error_message" class="alert alert-warning"> The cashup amount must be a positive number greater than zero. </div> >+ [% END %] >+ > [% IF ( error_cashup_complete ) %] >- <div id="error_message" class="alert alert-warning"> Failed to complete cashup. Please try again. </div> >+ <div id="error_message" class="alert alert-warning"> >+ Failed to complete cashup. Please try again. >+ [% IF error_details %] >+ <br /><strong>Error details:</strong> [% error_details | html %] >+ [% END %] >+ </div> > [% END %] > > [% IF ( error_refund_permission ) %] >diff --git a/pos/register.pl b/pos/register.pl >index df1faf73def..41d62fff656 100755 >--- a/pos/register.pl >+++ b/pos/register.pl >@@ -157,8 +157,14 @@ if ( !$registers->count ) { > $template->param( error_no_cashup_start => 1 ); > } elsif ( $@->isa('Koha::Exceptions::Object::DuplicateID') ) { > $template->param( error_cashup_already_completed => 1 ); >+ } elsif ( $@->isa('Koha::Exceptions::MissingParameter') ) { >+ $template->param( error_cashup_missing_param => 1, error_message => $@ ); >+ } elsif ( $@->isa('Koha::Exceptions::Account::AmountNotPositive') ) { >+ $template->param( error_cashup_amount_invalid => 1 ); > } else { >- $template->param( error_cashup_complete => 1 ); >+ >+ # Log the actual exception for debugging >+ $template->param( error_cashup_complete => 1, error_details => "$@" ); > } > } else { > >-- >2.51.1
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