Description
Martin Renvoize (ashimema)
2020-03-03 11:37:37 UTC
Created attachment 107145 [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 Created attachment 107146 [details] [review] Bug 24786: Allow selection of cash register at login Created attachment 107147 [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 Created attachment 107148 [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. Created attachment 107149 [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. 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 Created attachment 107739 [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 Created attachment 107740 [details] [review] Bug 24786: Allow selection of cash register at login Created attachment 107741 [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 Created attachment 107742 [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. Created attachment 107743 [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. Rebased Hold off testing here until the next upload.. I'm going to rebase it upon bug 24201 as that's nearly hit PQA now. Created attachment 107754 [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 Created attachment 107755 [details] [review] Bug 24786: Allow selection of cash register at login Created attachment 107756 [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 Created attachment 107757 [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. Created attachment 107758 [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. Created attachment 107759 [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. This should be ready for testing again now. 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 Created attachment 107958 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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 Created attachment 108061 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. Ready for testing, rebased now that the dependant bug is in master. 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 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 Created attachment 108511 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. Rebased, ready for testing again. 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 Created attachment 110163 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. Rebased ready for testing... again 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" (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 Rebase error.. working on it. 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 Created attachment 110188 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. Thanks for testing Andrew.. it should now be working with this freshly rebased set :) Just checked, still applies. Still applies. 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 Thanks for testing Andrew.. it looks like I missed something when rebasing for bug 26194. 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 Created attachment 111067 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. Ready for testing again :) 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 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 Created attachment 111127 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. 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 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 Created attachment 111221 [details] [review] Bug 24786: Allow selection of cash register at login 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 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. 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. 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. 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. 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 It sounds like this wasn't applying.. rebased again and added a branch link: https://gitlab.com/mrenvoize/Koha/-/commits/bug_24786 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> Created attachment 111229 [details] [review] Bug 24786: Allow selection of cash register at login Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> 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> 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> 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> 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> 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> 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> 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 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> Created attachment 111612 [details] [review] Bug 24786: Allow selection of cash register at login Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> 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> 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> 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> 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> 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> 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> Created attachment 111619 [details] [review] Bug 24786: (QA follow-up) POD Fixes Created attachment 111620 [details] [review] Bug 24786: (QA follow-up) Make QA script happy with html_helpers 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. 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. 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. 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> Created attachment 111758 [details] [review] Bug 24786: Allow selection of cash register at login Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> 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> 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> 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> 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> 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> 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> Created attachment 111765 [details] [review] Bug 24786: (QA follow-up) POD Fixes Created attachment 111766 [details] [review] Bug 24786: (QA follow-up) Make QA script happy with html_helpers 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. 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. Created attachment 111769 [details] [review] Bug 24786: (QA follow-up) Unit tests for Registers plugin 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 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> 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> 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> 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> 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> 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> 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> 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> Created attachment 111784 [details] [review] Bug 24786: (QA follow-up) POD Fixes Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> 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> 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> 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> 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> 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 (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? 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. 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. (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 ) 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> 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> (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 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. 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. 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. 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. 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. Pushed to master for 20.11, thanks to everybody involved! Created attachment 113256 [details] [review] Bug 24786: Fix Script_cron.t Created attachment 113257 [details] [review] Bug 24786: Fix Script_cron.t and t/Koha/Script.t Created attachment 113260 [details] [review] Bug 24786: (QA follow-up) Mock UseCashRegister in tests Last two patches pushed to master for 20.11. enhancement will not be backported to 20.05.x |