Bug 41214

Summary: Cash register should only show if UseCashRegisters sys pref is enabled
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: SIP2Assignee: Pedro Amorim <pedro.amorim>
Status: Pushed to main --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, lucas, martin.renvoize, matt.blenkinsop, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This change turns the display of the 'cash register' field in SIP2 accounts to become conditional depending on whether the UseCashRegisters sys pref is enabled or not. For developers: This changes the hideIn option for VueJS framework resources, now allowing it to be a callback function which is checked in real-time, dictating whether a field is displayed or not.
Version(s) released in:
26.05.00
Circulation function:
Bug Depends on: 37893    
Bug Blocks:    
Attachments: Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled
Bug 41214: Add cypress test
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref
Bug 41214: Apply the same logic to table columns
Bug 41214: Apply the same logic to table columns
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled
Bug 41214: Add cypress test
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref
Bug 41214: Apply the same logic to table columns
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled
Bug 41214: Add cypress test
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref
Bug 41214: Apply the same logic to table columns
Bug 41214: (QA follow-up): Tidy fix

Description Pedro Amorim 2025-11-07 11:10:55 UTC

    
Comment 1 Pedro Amorim 2025-11-07 11:13:32 UTC
Created attachment 189263 [details] [review]
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled

Test plan:
1) Add a new account:
http://localhost:8081/cgi-bin/koha/sip2/accounts/add
2) Notice the 'cash register' field does not show
3) Enable UseCashRegisters sys pref
4) Repeat 1 (or edit an existing account). Refresh the page.
5) Notice the 'cash register' field now shows
Comment 2 Jonathan Druart 2025-11-07 13:04:05 UTC
Can we have a cypress test for this?
Comment 3 Pedro Amorim 2025-11-07 13:57:49 UTC
Created attachment 189322 [details] [review]
Bug 41214: Add cypress test

cypress run --spec t/cypress/integration/SIP2/Accounts.ts --config video=false,screenshotOnRunFailure=false
Comment 4 Matt Blenkinsop 2025-11-19 10:27:20 UTC
Created attachment 189695 [details] [review]
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref
Comment 5 Matt Blenkinsop 2025-11-19 10:52:58 UTC
Created attachment 189697 [details] [review]
Bug 41214: Apply the same logic to table columns
Comment 6 Matt Blenkinsop 2025-11-19 11:36:05 UTC
Created attachment 189698 [details] [review]
Bug 41214: Apply the same logic to table columns
Comment 7 Pedro Amorim 2025-11-19 11:40:48 UTC
Created attachment 189699 [details] [review]
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled

Test plan:
1) Add a new account:
http://localhost:8081/cgi-bin/koha/sip2/accounts/add
2) Notice the 'cash register' field does not show
3) Enable UseCashRegisters sys pref
4) Repeat 1 (or edit an existing account). Refresh the page.
5) Notice the 'cash register' field now shows

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 8 Pedro Amorim 2025-11-19 11:40:50 UTC
Created attachment 189700 [details] [review]
Bug 41214: Add cypress test

cypress run --spec t/cypress/integration/SIP2/Accounts.ts --config video=false,screenshotOnRunFailure=false

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 9 Pedro Amorim 2025-11-19 11:40:53 UTC
Created attachment 189701 [details] [review]
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 10 Pedro Amorim 2025-11-19 11:40:55 UTC
Created attachment 189702 [details] [review]
Bug 41214: Apply the same logic to table columns

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 11 Pedro Amorim 2025-11-19 11:47:24 UTC
Thanks Matt for the follow-ups, that is a better approach here imo.
I'm moving this to Signed-off with both mine and Matt's SO lines for the following reasons:
1) We both worked on this (and tested it) and we're both happy with the solution here.
2) It's a small patch with core VueJS framework changes i.e. make 'hideIn' be optionally used as a callback.

Setting Joubu as QA contact as it makes sense. I'm happy to put it back to NSO if the above reasons are not enough for SO.
Comment 12 Jonathan Druart 2025-11-24 09:47:45 UTC
Created attachment 189902 [details] [review]
Bug 41214: Only show cash register if UseCashRegisters sys pref is enabled

Test plan:
1) Add a new account:
http://localhost:8081/cgi-bin/koha/sip2/accounts/add
2) Notice the 'cash register' field does not show
3) Enable UseCashRegisters sys pref
4) Repeat 1 (or edit an existing account). Refresh the page.
5) Notice the 'cash register' field now shows

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2025-11-24 09:47:46 UTC
Created attachment 189903 [details] [review]
Bug 41214: Add cypress test

cypress run --spec t/cypress/integration/SIP2/Accounts.ts --config video=false,screenshotOnRunFailure=false

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2025-11-24 09:47:47 UTC
Created attachment 189904 [details] [review]
Bug 41214: Convert hideIn to a callback to allow total removal of fields via syspref

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Jonathan Druart 2025-11-24 09:47:49 UTC
Created attachment 189905 [details] [review]
Bug 41214: Apply the same logic to table columns

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Lucas Gass (lukeg) 2026-01-12 17:43:09 UTC
This files seem to not be tidy:

[FAIL] koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue
   FAIL	  tidiness
		File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/intranet-tmpl/prog/js/vue/components/FormElement.vue`
[FAIL] koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue
   FAIL	  tidiness
		File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/intranet-tmpl/prog/js/vue/components/ResourceList.vue`
[PASS] koha-tmpl/intranet-tmpl/prog/js/vue/components/SIP2/Main.vue
[FAIL] koha-tmpl/intranet-tmpl/prog/js/vue/components/SIP2/SIP2AccountResource.vue
   FAIL	  tidiness
		File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/intranet-tmpl/prog/js/vue/components/SIP2/SIP2AccountResource.vue`
[FAIL] koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js
   FAIL	  tidiness
		File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js`



When I run tidy.pl on the, a diff is generated.
Comment 17 Pedro Amorim 2026-01-13 09:22:56 UTC
Created attachment 191343 [details] [review]
Bug 41214: (QA follow-up): Tidy fix
Comment 18 Lucas Gass (lukeg) 2026-02-06 22:20:55 UTC
Nice work everyone!

Pushed to main for 26.05