Bug 24786 - Allow setting a cash register for a login session and configuring library-default cash registers
Summary: Allow setting a cash register for a login session and configuring library-def...
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 10 votes (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL: https://gitlab.com/mrenvoize/Koha/-/c...
Keywords: release-notes-needed
Depends on: 24201 26469 23321
Blocks: 24665 26177 26540
  Show dependency treegraph
 
Reported: 2020-03-03 11:37 UTC by Martin Renvoize
Modified: 2020-11-20 00:27 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
Bug 24786: Allow setting a register for the session (19.08 KB, patch)
2020-07-21 12:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (5.22 KB, patch)
2020-07-21 12:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.17 KB, patch)
2020-07-21 12:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.07 KB, patch)
2020-07-21 12:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-07-21 12:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (18.94 KB, patch)
2020-08-04 10:35 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (5.22 KB, patch)
2020-08-04 10:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.17 KB, patch)
2020-08-04 10:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.07 KB, patch)
2020-08-04 10:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-08-04 10:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (19.81 KB, patch)
2020-08-04 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (3.70 KB, patch)
2020-08-04 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.17 KB, patch)
2020-08-04 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.08 KB, patch)
2020-08-04 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-08-04 12:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-08-04 12:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (22.14 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (3.70 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.17 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.08 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-08-07 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.17 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.31 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-08-11 13:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.19 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.31 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-08-18 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-09-16 10:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-09-16 10:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (4.85 KB, patch)
2020-09-16 10:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.34 KB, patch)
2020-09-16 10:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-09-16 10:27 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-09-16 10:27 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-09-16 10:27 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-09-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-09-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (4.85 KB, patch)
2020-09-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.86 KB, patch)
2020-09-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-09-16 12:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-09-16 12:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-09-16 12:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-10-02 08:23 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.22 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.86 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.76 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-10-02 08:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.92 KB, patch)
2020-10-02 09:23 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.22 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.86 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.80 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-10-02 11:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.92 KB, patch)
2020-10-02 11:29 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (21.96 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.84 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.22 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.86 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.80 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.56 KB, patch)
2020-10-05 12:14 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.78 KB, patch)
2020-10-05 12:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.92 KB, patch)
2020-10-05 12:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (22.07 KB, patch)
2020-10-05 12:28 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.93 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.30 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.95 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.89 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.66 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.85 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.99 KB, patch)
2020-10-05 12:29 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (22.02 KB, patch)
2020-10-14 12:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.90 KB, patch)
2020-10-14 12:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.28 KB, patch)
2020-10-14 12:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.92 KB, patch)
2020-10-14 12:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.87 KB, patch)
2020-10-14 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.63 KB, patch)
2020-10-14 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.85 KB, patch)
2020-10-14 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.99 KB, patch)
2020-10-14 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) POD Fixes (1.81 KB, patch)
2020-10-14 12:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Make QA script happy with html_helpers (1.27 KB, patch)
2020-10-14 12:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Fix Registers Plugin (1.44 KB, patch)
2020-10-14 13:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Add validation to paycollect (1.36 KB, patch)
2020-10-15 12:43 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (22.02 KB, patch)
2020-10-15 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.90 KB, patch)
2020-10-15 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.28 KB, patch)
2020-10-15 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (6.92 KB, patch)
2020-10-15 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.87 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.63 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.85 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (1.99 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) POD Fixes (1.81 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Make QA script happy with html_helpers (1.27 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Fix Registers Plugin (1.44 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Add validation to paycollect (1.36 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Unit tests for Registers plugin (7.95 KB, patch)
2020-10-15 16:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Unit tests for Registers plugin (8.03 KB, patch)
2020-10-15 16:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Allow setting a register for the session (22.12 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Allow selection of cash register at login (4.99 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Update point of sale to use session register (5.36 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Update paycollect to use session register (7.00 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Update borroaccount to use session register (5.94 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (follow-up) Cache the register_name in the session (9.72 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Default to 'branch default' on auth. (2.90 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: Add validation to point of sale (2.04 KB, patch)
2020-10-15 17:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) POD Fixes (1.87 KB, patch)
2020-10-15 17:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Make QA script happy with html_helpers (1.33 KB, patch)
2020-10-15 17:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Fix Registers Plugin (1.50 KB, patch)
2020-10-15 17:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Add validation to paycollect (1.42 KB, patch)
2020-10-15 17:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Unit tests for Registers plugin (8.10 KB, patch)
2020-10-15 17:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) String fix (2.76 KB, patch)
2020-11-04 11:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Remove trailing space in classes (1.41 KB, patch)
2020-11-04 12:55 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Remove trailing space in classes (3.00 KB, patch)
2020-11-04 13:03 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Handle no defined registers (1.02 KB, patch)
2020-11-06 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Hide archived registers (1.29 KB, patch)
2020-11-06 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Do not use 'hidden' attribute (2.52 KB, patch)
2020-11-06 11:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Reset beenSubmitted on validation failure (1.37 KB, patch)
2020-11-06 14:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Ensure tests pass with existing data (3.23 KB, patch)
2020-11-06 14:44 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24786: Fix Script_cron.t (707 bytes, patch)
2020-11-06 16:03 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24786: Fix Script_cron.t and t/Koha/Script.t (1.12 KB, patch)
2020-11-06 16:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24786: (QA follow-up) Mock UseCashRegister in tests (1.65 KB, patch)
2020-11-06 16:20 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2020-03-03 11:37:37 UTC
If enabled, the cash register associated with any transaction needs to be selected for each and every transaction.  One can use a 'branch default' to set the most likely register for all transactions at a branch, but it would be an improvement to also allow for selecting a different till for the entirety of a login session.

This enhancement aims to add that ability, allowing for a session register to be selected at any point during a session and override the branch default for that session.

One should still be able to override the register per transaction if required.
Comment 1 Martin Renvoize 2020-07-21 12:42:14 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize 2020-07-21 12:42:17 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize 2020-07-21 12:42:20 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize 2020-07-21 12:42:23 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize 2020-07-21 12:42:25 UTC Comment hidden (obsolete)
Comment 6 Sally 2020-07-24 14:20:30 UTC
Sorry Martin - patch doesn't apply with the following conflict:  

CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
Comment 7 Martin Renvoize 2020-08-04 10:35:58 UTC Comment hidden (obsolete)
Comment 8 Martin Renvoize 2020-08-04 10:36:01 UTC Comment hidden (obsolete)
Comment 9 Martin Renvoize 2020-08-04 10:36:05 UTC Comment hidden (obsolete)
Comment 10 Martin Renvoize 2020-08-04 10:36:08 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize 2020-08-04 10:36:11 UTC Comment hidden (obsolete)
Comment 12 Martin Renvoize 2020-08-04 10:36:29 UTC
Rebased
Comment 13 Martin Renvoize 2020-08-04 11:11:51 UTC
Hold off testing here until the next upload.. I'm going to rebase it upon bug 24201 as that's nearly hit PQA now.
Comment 14 Martin Renvoize 2020-08-04 12:53:47 UTC Comment hidden (obsolete)
Comment 15 Martin Renvoize 2020-08-04 12:53:50 UTC Comment hidden (obsolete)
Comment 16 Martin Renvoize 2020-08-04 12:53:54 UTC Comment hidden (obsolete)
Comment 17 Martin Renvoize 2020-08-04 12:53:57 UTC Comment hidden (obsolete)
Comment 18 Martin Renvoize 2020-08-04 12:54:00 UTC Comment hidden (obsolete)
Comment 19 Martin Renvoize 2020-08-04 12:54:03 UTC Comment hidden (obsolete)
Comment 20 Martin Renvoize 2020-08-04 12:55:03 UTC
This should be ready for testing again now.
Comment 21 Martin Renvoize 2020-08-07 13:26:38 UTC
Created attachment 107957 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 22 Martin Renvoize 2020-08-07 13:26:41 UTC
Created attachment 107958 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 23 Martin Renvoize 2020-08-07 13:26:44 UTC
Created attachment 107959 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 24 Martin Renvoize 2020-08-07 13:26:48 UTC
Created attachment 107960 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 25 Martin Renvoize 2020-08-07 13:26:51 UTC
Created attachment 107961 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 26 Martin Renvoize 2020-08-07 13:26:55 UTC
Created attachment 107962 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 27 Martin Renvoize 2020-08-11 13:26:01 UTC
Created attachment 108060 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 28 Martin Renvoize 2020-08-11 13:26:04 UTC
Created attachment 108061 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 29 Martin Renvoize 2020-08-11 13:26:08 UTC
Created attachment 108062 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 30 Martin Renvoize 2020-08-11 13:26:11 UTC
Created attachment 108063 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 31 Martin Renvoize 2020-08-11 13:26:15 UTC
Created attachment 108064 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 32 Martin Renvoize 2020-08-11 13:26:18 UTC
Created attachment 108065 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 33 Martin Renvoize 2020-08-11 13:26:21 UTC
Created attachment 108066 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 34 Martin Renvoize 2020-08-11 13:28:13 UTC
Ready for testing, rebased now that the dependant bug is in master.
Comment 35 Katrin Fischer 2020-08-16 22:27:03 UTC
Requires a rebase:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 24786: Allow setting a register for the session
Applying: Bug 24786: Allow selection of cash register at login
Applying: Bug 24786: Update point of sale to use session register
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt
error: Failed to merge in the changes.
Patch failed at 0001 Bug 24786: Update point of sale to use session register
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-24786-Update-point-of-sale-to-use-session-regi-_fOoYW.patch
Comment 36 Martin Renvoize 2020-08-18 14:10:26 UTC
Created attachment 108510 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 37 Martin Renvoize 2020-08-18 14:10:30 UTC
Created attachment 108511 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 38 Martin Renvoize 2020-08-18 14:10:33 UTC
Created attachment 108512 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 39 Martin Renvoize 2020-08-18 14:10:37 UTC
Created attachment 108513 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 40 Martin Renvoize 2020-08-18 14:10:40 UTC
Created attachment 108514 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 41 Martin Renvoize 2020-08-18 14:10:44 UTC
Created attachment 108515 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 42 Martin Renvoize 2020-08-18 14:10:47 UTC
Created attachment 108516 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 43 Martin Renvoize 2020-08-18 14:11:57 UTC
Rebased, ready for testing again.
Comment 44 Martin Renvoize 2020-09-16 10:26:36 UTC
Created attachment 110162 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 45 Martin Renvoize 2020-09-16 10:26:42 UTC
Created attachment 110163 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 46 Martin Renvoize 2020-09-16 10:26:50 UTC
Created attachment 110164 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 47 Martin Renvoize 2020-09-16 10:26:55 UTC
Created attachment 110165 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 48 Martin Renvoize 2020-09-16 10:27:02 UTC
Created attachment 110166 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 49 Martin Renvoize 2020-09-16 10:27:14 UTC
Created attachment 110167 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 50 Martin Renvoize 2020-09-16 10:27:22 UTC
Created attachment 110168 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 51 Martin Renvoize 2020-09-16 10:27:53 UTC
Rebased ready for testing... again
Comment 52 Andrew Fuerste-Henry 2020-09-16 11:49:16 UTC
I'm getting an internal server error when trying to submit a sale without a register selected. "Missing mandatory parameter: cash_register at /usr/share/perl5/Exception/Class/Base.pm line 88"
Comment 53 Martin Renvoize 2020-09-16 12:35:17 UTC
(In reply to Andrew Fuerste-Henry from comment #52)
> I'm getting an internal server error when trying to submit a sale without a
> register selected. "Missing mandatory parameter: cash_register at
> /usr/share/perl5/Exception/Class/Base.pm line 88"

Hmm.. I think this bug pre-exists prior to this patchset?

Can you confirm how you are taking such an action.. are you switching to a branch with no cash registers defined and then attempting to pay (with a payment type of cash).. is that how you are managing to submit a payment without a register?

This is sort of by design, we want to catch cases where cash payments do not include a register if UseCashRegisters is enabled.

However, we should be catching it visibly prior to this point.

Investigating
Comment 54 Martin Renvoize 2020-09-16 12:38:21 UTC
Rebase error.. working on it.
Comment 55 Martin Renvoize 2020-09-16 12:48:37 UTC
Created attachment 110187 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 56 Martin Renvoize 2020-09-16 12:48:43 UTC
Created attachment 110188 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 57 Martin Renvoize 2020-09-16 12:48:48 UTC
Created attachment 110189 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 58 Martin Renvoize 2020-09-16 12:48:53 UTC
Created attachment 110190 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 59 Martin Renvoize 2020-09-16 12:49:00 UTC
Created attachment 110191 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 60 Martin Renvoize 2020-09-16 12:49:04 UTC
Created attachment 110192 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 61 Martin Renvoize 2020-09-16 12:49:08 UTC
Created attachment 110193 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 62 Martin Renvoize 2020-09-16 12:49:58 UTC
Thanks for testing Andrew.. it should now be working with this freshly rebased set :)
Comment 63 Martin Renvoize 2020-09-23 10:08:51 UTC
Just checked, still applies.
Comment 64 Martin Renvoize 2020-10-01 13:46:50 UTC
Still applies.
Comment 65 Andrew Fuerste-Henry 2020-10-01 16:48:28 UTC
When I get to step 4, I don't get an alert that no cash register is selected. Further, when I to submit a sale with cash registers enabled but undefined I get an error: Missing mandatory parameter: cash_register at /usr/share/perl5/Exception/Class/Base.pm line 88
Comment 66 Martin Renvoize 2020-10-02 08:23:19 UTC
Thanks for testing Andrew.. it looks like I missed something when rebasing for bug 26194.
Comment 67 Martin Renvoize 2020-10-02 08:23:52 UTC
Created attachment 111066 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 68 Martin Renvoize 2020-10-02 08:24:01 UTC
Created attachment 111067 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 69 Martin Renvoize 2020-10-02 08:24:08 UTC
Created attachment 111068 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 70 Martin Renvoize 2020-10-02 08:24:16 UTC
Created attachment 111069 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 71 Martin Renvoize 2020-10-02 08:24:24 UTC
Created attachment 111070 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 72 Martin Renvoize 2020-10-02 08:24:36 UTC
Created attachment 111071 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 73 Martin Renvoize 2020-10-02 08:24:45 UTC
Created attachment 111072 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 74 Martin Renvoize 2020-10-02 08:25:31 UTC
Ready for testing again :)
Comment 75 Martin Renvoize 2020-10-02 09:23:49 UTC
Created attachment 111074 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff
Comment 76 Martin Renvoize 2020-10-02 11:28:12 UTC
Created attachment 111126 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 77 Martin Renvoize 2020-10-02 11:28:20 UTC
Created attachment 111127 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 78 Martin Renvoize 2020-10-02 11:28:27 UTC
Created attachment 111128 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 79 Martin Renvoize 2020-10-02 11:28:33 UTC
Created attachment 111129 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 80 Martin Renvoize 2020-10-02 11:28:38 UTC
Created attachment 111130 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 81 Martin Renvoize 2020-10-02 11:28:46 UTC
Created attachment 111131 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 82 Martin Renvoize 2020-10-02 11:28:54 UTC
Created attachment 111132 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 83 Martin Renvoize 2020-10-02 11:29:01 UTC
Created attachment 111133 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff
Comment 84 Martin Renvoize 2020-10-05 12:14:34 UTC
Created attachment 111220 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff
Comment 85 Martin Renvoize 2020-10-05 12:14:39 UTC
Created attachment 111221 [details] [review]
Bug 24786: Allow selection of cash register at login
Comment 86 Martin Renvoize 2020-10-05 12:14:44 UTC
Created attachment 111222 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff
Comment 87 Martin Renvoize 2020-10-05 12:14:48 UTC
Created attachment 111223 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.
Comment 88 Martin Renvoize 2020-10-05 12:14:53 UTC
Created attachment 111224 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.
Comment 89 Martin Renvoize 2020-10-05 12:14:59 UTC
Created attachment 111225 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.
Comment 90 Martin Renvoize 2020-10-05 12:15:05 UTC
Created attachment 111226 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.
Comment 91 Martin Renvoize 2020-10-05 12:15:10 UTC
Created attachment 111227 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff
Comment 92 Martin Renvoize 2020-10-05 12:16:24 UTC
It sounds like this wasn't applying.. rebased again and added a branch link: https://gitlab.com/mrenvoize/Koha/-/commits/bug_24786
Comment 93 Andrew Fuerste-Henry 2020-10-05 12:28:58 UTC
Created attachment 111228 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 94 Andrew Fuerste-Henry 2020-10-05 12:29:04 UTC
Created attachment 111229 [details] [review]
Bug 24786: Allow selection of cash register at login

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 95 Andrew Fuerste-Henry 2020-10-05 12:29:10 UTC
Created attachment 111230 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 96 Andrew Fuerste-Henry 2020-10-05 12:29:17 UTC
Created attachment 111231 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 97 Andrew Fuerste-Henry 2020-10-05 12:29:27 UTC
Created attachment 111232 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 98 Andrew Fuerste-Henry 2020-10-05 12:29:37 UTC
Created attachment 111233 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 99 Andrew Fuerste-Henry 2020-10-05 12:29:45 UTC
Created attachment 111234 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 100 Andrew Fuerste-Henry 2020-10-05 12:29:50 UTC
Created attachment 111235 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 101 Katrin Fischer 2020-10-14 11:49:21 UTC
Hm, there are a couple of fails on the QA tool here I'd like to have checked/fixed first for moving on here (not a complete list, please run tools yourself):

 FAIL	koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
   FAIL	  tt_valid
		lines 27

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
   FAIL	  valid_template
		Can't use an undefined value as a HASH reference at /home/vagrant/kohaclone/Koha/Template/Plugin/Registers.pm line 60.


 FAIL	Koha/Template/Plugin/Registers.pm
   OK	  critic
   OK	  file permissions
   OK	  forbidden patterns
   OK	  git manipulation
   FAIL	  pod
		*** WARNING: 
		=head2 without preceding higher level
		 
		 in file Koha/Template/Plugin/Registers.pm
		
		*** ERROR: 
		empty =head2
		 
		 in file Koha/Template/Plugin/Registers.pm
		
   FAIL	  pod coverage
		POD is missing for all
		POD is missing for session_register_id
		POD is missing for session_register_name
Comment 102 Martin Renvoize 2020-10-14 12:51:29 UTC
Created attachment 111611 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 103 Martin Renvoize 2020-10-14 12:51:42 UTC
Created attachment 111612 [details] [review]
Bug 24786: Allow selection of cash register at login

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 104 Martin Renvoize 2020-10-14 12:51:47 UTC
Created attachment 111613 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 105 Martin Renvoize 2020-10-14 12:51:58 UTC
Created attachment 111614 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 106 Martin Renvoize 2020-10-14 12:52:07 UTC
Created attachment 111615 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 107 Martin Renvoize 2020-10-14 12:52:28 UTC
Created attachment 111616 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 108 Martin Renvoize 2020-10-14 12:52:36 UTC
Created attachment 111617 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 109 Martin Renvoize 2020-10-14 12:52:45 UTC
Created attachment 111618 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 110 Martin Renvoize 2020-10-14 12:52:57 UTC
Created attachment 111619 [details] [review]
Bug 24786: (QA follow-up) POD Fixes
Comment 111 Martin Renvoize 2020-10-14 12:53:09 UTC
Created attachment 111620 [details] [review]
Bug 24786: (QA follow-up) Make QA script happy with html_helpers
Comment 112 Martin Renvoize 2020-10-14 13:37:50 UTC
Created attachment 111623 [details] [review]
Bug 24786: (QA follow-up) Fix Registers Plugin

For the QA script we do not set a userenv, so we result in a failure due
to a lack of checking for userenv prior to using it.
Comment 113 Katrin Fischer 2020-10-15 10:37:54 UTC
Hi Martin,

some things:

1) We are missing unit tests for Koha/Template/Plugin/Registers.pm.

2) I managed to trigger an explosion:
- Activated UseCashRegisters after testing without
- Went to my patron account
- Tried to do a partial payment of a fine without selecting a cash register

/cgi-bin/koha/members/paycollect.pl?borrowernumber=51&pay_individual=1&debit_type_code=PAYOUT&amount=10.00&amountoutstanding=6.00&accountlines_id=8&remote_user=change_given=

 [Account transaction requires a cash register] at /usr/share/perl5/Exception/Class/Base.pm line 88

It looks like the validation is not there. Stopping here to let you check.
Comment 114 Martin Renvoize 2020-10-15 12:43:42 UTC
Created attachment 111725 [details] [review]
Bug 24786: (QA follow-up) Add validation to paycollect

This patch adds conditional validation to the cash register field on
paycollect such that if 'CASH' is selected as the payment type and cash
registers are enabled, then a cash register will be required.
Comment 115 Martin Renvoize 2020-10-15 16:04:22 UTC
Created attachment 111757 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 116 Martin Renvoize 2020-10-15 16:04:33 UTC
Created attachment 111758 [details] [review]
Bug 24786: Allow selection of cash register at login

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 117 Martin Renvoize 2020-10-15 16:04:39 UTC
Created attachment 111759 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 118 Martin Renvoize 2020-10-15 16:04:51 UTC
Created attachment 111760 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 119 Martin Renvoize 2020-10-15 16:05:00 UTC
Created attachment 111761 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 120 Martin Renvoize 2020-10-15 16:05:11 UTC
Created attachment 111762 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 121 Martin Renvoize 2020-10-15 16:05:17 UTC
Created attachment 111763 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 122 Martin Renvoize 2020-10-15 16:05:22 UTC
Created attachment 111764 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 123 Martin Renvoize 2020-10-15 16:05:27 UTC
Created attachment 111765 [details] [review]
Bug 24786: (QA follow-up) POD Fixes
Comment 124 Martin Renvoize 2020-10-15 16:05:33 UTC
Created attachment 111766 [details] [review]
Bug 24786: (QA follow-up) Make QA script happy with html_helpers
Comment 125 Martin Renvoize 2020-10-15 16:05:39 UTC
Created attachment 111767 [details] [review]
Bug 24786: (QA follow-up) Fix Registers Plugin

For the QA script we do not set a userenv, so we result in a failure due
to a lack of checking for userenv prior to using it.
Comment 126 Martin Renvoize 2020-10-15 16:05:44 UTC
Created attachment 111768 [details] [review]
Bug 24786: (QA follow-up) Add validation to paycollect

This patch adds conditional validation to the cash register field on
paycollect such that if 'CASH' is selected as the payment type and cash
registers are enabled, then a cash register will be required.
Comment 127 Martin Renvoize 2020-10-15 16:05:51 UTC
Created attachment 111769 [details] [review]
Bug 24786: (QA follow-up) Unit tests for Registers plugin
Comment 128 Martin Renvoize 2020-10-15 16:10:08 UTC
Created attachment 111770 [details] [review]
Bug 24786: (QA follow-up) Unit tests for Registers plugin

To test:
1. Run the new unit test: t/db_dependent/Koha/Template/Plugin/Registers.t
Comment 129 Katrin Fischer 2020-10-15 17:36:10 UTC
Created attachment 111776 [details] [review]
Bug 24786: Allow setting a register for the session

This patch adds the ability to set a register for the current session
from the 'set library' page.

Upon entering the page, the current selection will be displayed.
Changing the branch will trigger the register select list to update to
display only those registers associated with the updated branch and will
automatically select either 'no register' or the 'branch default'
register.  The user can then override that selection to choose a
different register for the session.

Test plan
1/ Enable cash registers with the 'UseCashRegisters' system preference
2/ Select the 'Set library' option from the top right menu
3/ Note that you can now select a cash register from the subsequent page
4/ Change the branch and note that the cash register selection is
updated to reflect the change
5/ Note that the 'branch default' register is auto-selected upon branch
selection if one has been defined, otherwise '-- None --' is selected
6/ You can then alter the selection before submitting the form
7/ Once submitted note that you are returned to the page you were on
prior to attempting to change the library and register
8/ Note the present of the register name next to the library name at the
top of the screen.
9/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 130 Katrin Fischer 2020-10-15 17:36:18 UTC
Created attachment 111777 [details] [review]
Bug 24786: Allow selection of cash register at login

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 131 Katrin Fischer 2020-10-15 17:36:24 UTC
Created attachment 111778 [details] [review]
Bug 24786: Update point of sale to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the sale.

Test plan
1/ Enable cash registers via the 'UseCashRegisters' system preference
2/ Enable point of sale via the 'EnablePointOfSale' system preference
3/ Navigate to the point of sale page
4/ Note that if you are logged in at a branch with no cash registers yet
defined, then an alert should appear
5/ Note that when you are logged in at a branch with cash regsiters
defined, but without a cash register associated with your session then
the cash 'Cash register' select box is populated with '-- None --' and
you are required to select a register prior to submission
6/ Note that upon selection, the '-- None --' option is disabled
7/ Note that when you have a register associated with your session then
the 'Cash register' select box is pre-populated with that register.
8/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 132 Katrin Fischer 2020-10-15 17:36:31 UTC
Created attachment 111779 [details] [review]
Bug 24786: Update paycollect to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the payment.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 133 Katrin Fischer 2020-10-15 17:36:38 UTC
Created attachment 111780 [details] [review]
Bug 24786: Update borroaccount to use session register

This patch adds handling to allow for the use of the session cash
register by default if it has been set, otherwise it defaults to '--
None --' and requires the end user to select the register to proceed
with the refund or payout action.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 134 Katrin Fischer 2020-10-15 17:36:46 UTC
Created attachment 111781 [details] [review]
Bug 24786: (follow-up) Cache the register_name in the session

This leads to one DB hit less per page load in the staff client when
cash registers are enabled.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 135 Katrin Fischer 2020-10-15 17:36:53 UTC
Created attachment 111782 [details] [review]
Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library at login.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 136 Katrin Fischer 2020-10-15 17:36:59 UTC
Created attachment 111783 [details] [review]
Bug 24786: Add validation to point of sale

The Point of Sale page relied upon serverside validation prior to this
patch; As such with the introduction of the ability to select '--None--'
at the session register level (to require the librarian to pick their
register for every transaction) we could result in a server error page.

This patch introduced clientside validation to add checks for both the
'collected' and 'registerid' form fields.

Test plan:
1/ Select a branch with cash registers available
2/ Select the '--None--' option for the session cash register
3/ Navigate to the point of sale page
4/ Attempt to make a sale without having picked your cash register
5/ Note that the submission was prevented and the fiedl is highlighted
as required in red.
6/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 137 Katrin Fischer 2020-10-15 17:37:07 UTC
Created attachment 111784 [details] [review]
Bug 24786: (QA follow-up) POD Fixes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 138 Katrin Fischer 2020-10-15 17:37:14 UTC
Created attachment 111785 [details] [review]
Bug 24786: (QA follow-up) Make QA script happy with html_helpers

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 139 Katrin Fischer 2020-10-15 17:37:25 UTC
Created attachment 111786 [details] [review]
Bug 24786: (QA follow-up) Fix Registers Plugin

For the QA script we do not set a userenv, so we result in a failure due
to a lack of checking for userenv prior to using it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 140 Katrin Fischer 2020-10-15 17:37:35 UTC
Created attachment 111787 [details] [review]
Bug 24786: (QA follow-up) Add validation to paycollect

This patch adds conditional validation to the cash register field on
paycollect such that if 'CASH' is selected as the payment type and cash
registers are enabled, then a cash register will be required.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 141 Katrin Fischer 2020-10-15 17:37:48 UTC
Created attachment 111788 [details] [review]
Bug 24786: (QA follow-up) Unit tests for Registers plugin

To test:
1. Run the new unit test: t/db_dependent/Koha/Template/Plugin/Registers.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 142 Jonathan Druart 2020-11-04 10:55:32 UTC
1. I don't manage to have something else than "branch default" on the login page
2. Do we really want the register list to be public?
3. Why "branch default"? branch vs library
Comment 143 Katrin Fischer 2020-11-04 11:31:39 UTC
(In reply to Jonathan Druart from comment #142)
> 1. I don't manage to have something else than "branch default" on the login
> page
> 2. Do we really want the register list to be public?

I don't see this as a high risk thing. We have the list of libraries public... I don't see it as a blocker. Otherwise we'd need a pop-up or similar after login which could add lots of extra clicks.

> 3. Why "branch default"? branch vs library

I think library default woudl be better, I missed that, but easy fix in a follow-up.

Did you add multiple cash registers for your homebranch/login branch?
Comment 144 Martin Renvoize 2020-11-04 11:35:55 UTC
Sorry.. the 'library' vs 'branch' thing gets me every time :(.

I still think of 'library' being the whole organisation and 'branch' being the individual buildings that make up the organisation.

Happy to do a followup for that string fix here.
Comment 145 Martin Renvoize 2020-11-04 11:54:59 UTC
Created attachment 112985 [details] [review]
Bug 24786: (QA follow-up) String fix

This patch updates 'Branch default' to 'Library default' on the login
page to match the coding terminology guidelines.

We also update the table heading on the cash registers management page
to match the terminology above for clarity.
Comment 146 Katrin Fischer 2020-11-04 12:38:30 UTC
(In reply to Martin Renvoize from comment #144)
> Sorry.. the 'library' vs 'branch' thing gets me every time :(.
> 
> I still think of 'library' being the whole organisation and 'branch' being
> the individual buildings that make up the organisation.
> 
> Happy to do a followup for that string fix here.

Think consortia and independent branches - they might not be branches of the same organisation and still sharing the same Koha. ( I think that was the reasoning )
Comment 147 Martin Renvoize 2020-11-04 12:55:55 UTC
Created attachment 112988 [details] [review]
Bug 24786: (QA follow-up) Remove trailing space in classes

The trailing space after branch in the class attribute for the register
select options cause issues in the 'hasClass' javascript selector

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 148 Martin Renvoize 2020-11-04 13:03:43 UTC
Created attachment 112989 [details] [review]
Bug 24786: (QA follow-up) Remove trailing space in classes

The trailing space after branch in the class attribute for the register
select options cause issues in the 'hasClass' javascript selector

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 149 Jonathan Druart 2020-11-06 10:04:25 UTC
(In reply to Jonathan Druart from comment #142)
> 1. I don't manage to have something else than "branch default" on the login
> page

This is still valid, Martin.

https://snipboard.io/ZblsR6.jpg
Comment 150 Martin Renvoize 2020-11-06 10:57:19 UTC
Created attachment 113226 [details] [review]
Bug 24786: (QA follow-up) Handle no defined registers

This patch hides the register selection option from the login page if no
registers have yet been defined on the system.
Comment 151 Martin Renvoize 2020-11-06 10:57:24 UTC
Created attachment 113227 [details] [review]
Bug 24786: (QA follow-up) Hide archived registers

This patch hides archived registers from the list when useing the
Registers template plugin.  It also includes a check for
UseCashRegisters so that if the preference is disabled after some
registers have been defined then the plugin will no longer return the
list regardless.
Comment 152 Martin Renvoize 2020-11-06 11:53:28 UTC
Created attachment 113241 [details] [review]
Bug 24786: (QA follow-up) Do not use 'hidden' attribute

The hidden attribute for loading an element hidden is known to have
issues and inconsistencies accross browsers.

This patch instead updates the relevent input options to use an inline
style of 'display: none' to hide the elements on page load and then
.show, .hide for subsquent changes linked to the library branch picker
change.
Comment 153 Martin Renvoize 2020-11-06 14:07:21 UTC
Created attachment 113251 [details] [review]
Bug 24786: (QA follow-up) Reset beenSubmitted on validation failure

When the form submision fails due to validation errors we need to also
reset the preventFormDoubleSubmit state to allow for a second submission
with corrected form fields.
Comment 154 Martin Renvoize 2020-11-06 14:44:30 UTC
Created attachment 113253 [details] [review]
Bug 24786: (QA follow-up) Ensure tests pass with existing data

The tests for Koha::Template::Plugin::Registers assumed that no
registers were pre-set in the database. This patch updates the test to
ignore pre-existing data or take it into account in totals.
Comment 155 Jonathan Druart 2020-11-06 14:56:09 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 156 Jonathan Druart 2020-11-06 16:03:50 UTC
Created attachment 113256 [details] [review]
Bug 24786: Fix Script_cron.t
Comment 157 Jonathan Druart 2020-11-06 16:04:58 UTC
Created attachment 113257 [details] [review]
Bug 24786: Fix Script_cron.t and t/Koha/Script.t
Comment 158 Martin Renvoize 2020-11-06 16:20:59 UTC
Created attachment 113260 [details] [review]
Bug 24786: (QA follow-up) Mock UseCashRegister in tests
Comment 159 Jonathan Druart 2020-11-09 10:44:40 UTC
Last two patches pushed to master for 20.11.
Comment 160 Lucas Gass 2020-11-16 22:17:39 UTC
enhancement will not be backported to 20.05.x