Bugzilla – Attachment 190368 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) Disable cashup button and checkbox when bankable is zero
8df0242.patch (text/plain), 5.83 KB, created by
Martin Renvoize (ashimema)
on 2025-12-09 16:22:58 UTC
(
hide
)
Description:
Bug 40445: (follow-up) Disable cashup button and checkbox when bankable is zero
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-12-09 16:22:58 UTC
Size:
5.83 KB
patch
obsolete
>From 8df0242c75598c9e794490cfd588f6763423522c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 9 Dec 2025 16:14:43 +0000 >Subject: [PATCH] Bug 40445: (follow-up) Disable cashup button and checkbox > when bankable is zero > >When a register has no bankable transactions (bankable amount is 0.00), >the 'Record cashup' button and the corresponding checkbox should be >disabled to prevent attempting a cashup that will result in an error. > >This patch: >- Disables the checkbox for registers with 0.00 bankable amount >- Disables the 'Record cashup' button when bankable is 0.00 >- Adds tooltip "No bankable transactions" to both elements >- Applies to both the registers summary page and individual register page > >Test plan: >1. Navigate to /cgi-bin/koha/pos/registers.pl >2. Find or create a register with no bankable transactions (0.00) >3. Verify the checkbox for that register is disabled with tooltip >4. Verify the 'Record cashup' button is disabled with tooltip >5. Navigate to the individual register page >6. Verify the toolbar 'Record cashup' button is disabled when bankable is 0.00 >7. Verify registers with non-zero bankable amounts work as before >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 5 +++-- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt | 5 ++++- > 2 files changed, 7 insertions(+), 3 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 c7b29b96845..be22824bad9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -108,12 +108,13 @@ > </div> > [% END %] > >+ [% SET total_bankable = accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 %] > [% IF ( CAN_user_cash_management_cashup ) %] > <div id="toolbar" class="btn-toolbar"> > [% IF cashup_in_progress %] > <button id="pos_complete_cashup" type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#confirmCashupModal"> <i class="fa-solid fa-check"></i> Complete cashup </button> > [% ELSE %] >- <button type="button" class="btn btn-default" data-bs-toggle="modal" data-bs-target="#triggerCashupModal"> <i class="fa fa-money-bill-alt"></i> Record cashup </button> >+ <button type="button" class="btn btn-default" data-bs-toggle="modal" data-bs-target="#triggerCashupModal" [% IF total_bankable == 0 %]disabled title="No bankable transactions"[% END %]> <i class="fa fa-money-bill-alt"></i> Record cashup </button> > [% END %] > </div> > [% END %] >@@ -137,7 +138,7 @@ > <li>Float: [% register.starting_float | $Price %]</li> > <li>Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li> > <li>Total outgoing (cash): [% accountlines.debits_total * -1 | $Price %] ([% accountlines.debits_total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li> >- <li>Total bankable: [% accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %]</li> >+ <li>Total bankable: [% total_bankable | $Price %]</li> > </ul> > > [% IF register.last_cashup %] >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 e1ce660966b..3b06f81b402 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >@@ -156,11 +156,14 @@ > <tbody> > [% SET bankable = 0, ctotal = 0, dtotal = 0, cctotal = 0, cdtotal = 0 %] > [% FOREACH register IN registers %] >+ [% SET rbankable = ( register.outstanding_accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] > <tr> > [% IF CAN_user_cash_management_cashup %] > <td> > [% IF register.cashup_in_progress %] > <input type="checkbox" class="register_checkbox" value="[% register.id | html %]" disabled title="Cashup in progress" /> >+ [% ELSIF rbankable == 0 %] >+ <input type="checkbox" class="register_checkbox" value="[% register.id | html %]" disabled title="No bankable transactions" /> > [% ELSE %] > <input type="checkbox" class="register_checkbox" value="[% register.id | html %]" /> > [% END %] >@@ -178,7 +181,6 @@ > </td> > <td>[% register.starting_float | $Price %]</td> > <td> >- [% SET rbankable = ( register.outstanding_accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] > [% SET bankable = bankable + rbankable %] > [% rbankable | $Price %] > </td> >@@ -220,6 +222,7 @@ > data-bankable="[% rbankable | $Price %]" > data-float="[% register.starting_float | $Price %]" > data-registerid="[% register.id | html %]" >+ [% IF rbankable == 0 %]disabled title="No bankable transactions"[% END %] > ><i class="fa-solid fa-money-bill-1"></i> Record cashup</button > > > [% END %] >-- >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