[Bug 26540] New: Issue Credit with Cash Registers
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Bug ID: 26540 Summary: Issue Credit with Cash Registers Change sponsored?: --- Product: Koha Version: 20.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: kelly@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org If a library system has enabled Cash Registers but one branch does not use this. When using the Issue Credit - CASH option from the Accounting Module, an Internal Server Error will occur. 1. Turn on Cash Registers 2. Set up a Cash Register for branch A 3. Log into Branch B and try to issue credit with CASH - this will not work and give an ISE. Other options, such as Check, Credit card, etc will work but not the option for Cash. Understandably, it is because there is not a place for the cash to come from if no cash register is enabled. But I can see this an issue for multi-branch systems where some want to use the Cash register option,but others do not. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm, you are indeed correct and the error is partially deliberate to ensure a cash register is set if the preference is set to use registers. So, are you suggesting that some branches may not want to use registers even though the global preference is set to require them. I'm just trying to understand how to correctly catch when one is missing but should be present... Should one be able to pay out in cash without a register but at a branch that does have at least one register for example? Should the 'UseCashRegisters' preference be set at the branch level? Or, should we just check for the presence of at least one register at a branch and fall into the required mode then? Happy to chat and code it up. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #2 from Kelly McElligott <kelly@bywatersolutions.com> --- Martin, Thank you for commenting. I would say, making the 'UseCashRegisters' preference be set at the branch level would probably be ideal. Because I can see some branches not using cash registers and this would cause issues. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13985 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13985 [Bug 13985] Cash Management - Koha as 'Point of Sale' -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 111137 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111137&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction typy, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24786 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24786 [Bug 24786] Allow setting a cash register for a login session -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This first patch just adds appropriate alerts and disabled the CASH type from being selected if the branch does not yet have registers associated with it. I'm still contemplating how to set the preference at a branch level.. Options: Set the preference at the branch level so if enabled for a branch but a branch is lacking register definitions we alert and require at least one register to be added... or.. leave the preference at system level but drop the error message for if no registers are defined at a branch yet. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Issue Credit with Cash |Server error when |Registers |aattempting to issue cash | |credit with | |UseCashRegisters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Server error when |Server error when |aattempting to issue cash |attempting to issue cash |credit with |credit with |UseCashRegisters |UseCashRegisters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Bug 26540 depends on bug 24786, which changed state. Bug 24786 Summary: Allow setting a cash register for a login session and configuring library-default cash registers https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24786 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31513 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |lucas@bywatersolutions.com --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- no longer applies cleanly to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111137|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168234 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168234&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction typy, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Rebased and ready for testing again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kelly@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |esther.melander@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168234|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168239&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction type, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. Test plan 1) Enable 'UseCashRegisters' 2) Add a credit to a user account 3) Attempt to 'Issue payout' of the credit to the user and note 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal 4) Add at least one new 'PAYMENT_TYPE' authorized value 5) Repeat step 3 5a) Note the blue info message still appears 5b) You may now select a payment type as defined in step 4, however the 'Cash' option is not available. 5c) There is still not an option to select a cash register 6) Add a cash register for your branch 7) Repeat step 3 7a) You will no longer see the blue info box 7b) You should be able to select 'Cash' from the 'Payment type' options 7c) You will be able to select your cash register Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |shi-yao.wang@inLibro.com Status|Needs Signoff |Patch doesn't apply --- Comment #9 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Patch does not apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|20.05 |unspecified -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168239|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173152&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction type, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. Test plan 1) Enable 'UseCashRegisters' 2) Add a credit to a user account 3) Attempt to 'Issue payout' of the credit to the user and note 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal 4) Add at least one new 'PAYMENT_TYPE' authorized value 5) Repeat step 3 5a) Note the blue info message still appears 5b) You may now select a payment type as defined in step 4, however the 'Cash' option is not available. 5c) There is still not an option to select a cash register 6) Add a cash register for your branch 7) Repeat step 3 7a) You will no longer see the blue info box 7b) You should be able to select 'Cash' from the 'Payment type' options 7c) You will be able to select your cash register Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- When a quick fix isn't quick :S Another rebase for the mill -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173152|0 |1 is obsolete| | --- Comment #12 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Created attachment 179011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179011&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction type, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. Test plan 1) Enable 'UseCashRegisters' 2) Add a credit to a user account 3) Attempt to 'Issue payout' of the credit to the user and note 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal 4) Add at least one new 'PAYMENT_TYPE' authorized value 5) Repeat step 3 5a) Note the blue info message still appears 5b) You may now select a payment type as defined in step 4, however the 'Cash' option is not available. 5c) There is still not an option to select a cash register 6) Add a cash register for your branch 7) Repeat step 3 7a) You will no longer see the blue info box 7b) You should be able to select 'Cash' from the 'Payment type' options 7c) You will be able to select your cash register Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #13 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Created attachment 179012 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179012&action=edit Bug 26540: (follow-up) Update patch with CSRF protections -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #14 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Rebased on main but CSRF protections and, I guess, modal rework broke the use of form inside the modal (which is a form). Hence I had rework the button/form into a single link. The rest is working as described, except the message is not blue /o/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179011|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187219&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction type, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. Test plan 1) Enable 'UseCashRegisters' 2) Add a credit to a user account 3) Attempt to 'Issue payout' of the credit to the user and note 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal 4) Add at least one new 'PAYMENT_TYPE' authorized value 5) Repeat step 3 5a) Note the blue info message still appears 5b) You may now select a payment type as defined in step 4, however the 'Cash' option is not available. 5c) There is still not an option to select a cash register 6) Add a cash register for your branch 7) Repeat step 3 7a) You will no longer see the blue info box 7b) You should be able to select 'Cash' from the 'Payment type' options 7c) You will be able to select your cash register Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179012|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187220&action=edit Bug 26540: (follow-up) Update patch with CSRF protections Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #17 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- When I go to tidy this the script catches a stray </p> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #18 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal After this step I press confirm in the modal and get: Exception 'Koha::Exceptions::MissingParameter' thrown 'The payout_type parameter is mandatory' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #19 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> ---
After this step I press confirm in the modal and get:
Exception 'Koha::Exceptions::MissingParameter' thrown 'The payout_type parameter is mandatory'
But at this point I have not configured a cash register for my logged in branch. So maybe this is wanted behavior? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|13985 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13985 [Bug 13985] [Omnibus] Cash Management - Koha as 'Point of Sale' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13985 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13985 [Bug 13985] [Omnibus] Cash Management - Koha as 'Point of Sale' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43910 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187219|0 |1 is obsolete| | Attachment #187220|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #20 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 209735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209735&action=edit Bug 26540: Remove 'CASH' type from 'refund' and 'payout' This patch removes the 'CASH' transaction type, hides the register selection and adds an alert to the Payout and Refund modals on the boraccount page if there are no cash registers yet defined at the for the current branch. Test plan 1) Enable 'UseCashRegisters' 2) Add a credit to a user account 3) Attempt to 'Issue payout' of the credit to the user and note 3a) A new blue info message appears in the modal letting you know that you cannot issue a payout of type 'Cash' to the user without first adding a cash register. (If you have the correct permissions, you will also see a button in that info box allowing you to add said register) 3b) You will not see either the payment type or registers pulldown in the modal 4) Add at least one new 'PAYMENT_TYPE' authorized value 5) Repeat step 3 5a) Note the blue info message still appears 5b) You may now select a payment type as defined in step 4, however the 'Cash' option is not available. 5c) There is still not an option to select a cash register 6) Add a cash register for your branch 7) Repeat step 3 7a) You will no longer see the blue info box 7b) You should be able to select 'Cash' from the 'Payment type' options 7c) You will be able to select your cash register Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #21 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 209736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209736&action=edit Bug 26540: (follow-up) Update patch with CSRF protections Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #22 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- (In reply to Lucas Gass (lukeg) from comment #19)
After this step I press confirm in the modal and get:
Exception 'Koha::Exceptions::MissingParameter' thrown 'The payout_type parameter is mandatory'
But at this point I have not configured a cash register for my logged in branch. So maybe this is wanted behavior?
In testing today it is impossible to add a credit without adding a new type that is not cash - using that when issuing the refund with no register avoids this error so I think this has been mitigated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k Status|Passed QA |Failed QA --- Comment #23 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, This breaks the cash register page in Point of sale. includes/transaction_types.inc is also used by pos/register.tt, where registers is not the same kind of list as on boraccount.tt. To reproduce: 1) Set 'UseCashRegisters' to 'Use' 2) Go to http://localhost:8081/cgi-bin/koha/admin/cash_registers.pl, click 'New cash register', enter 'Test' as the name, choose 'Centerville' as the library and click 'Add' 3) Go to http://localhost:8081/cgi-bin/koha/pos/register.pl 4) Confirm the page fails with an error about Koha::Cash::Registers->size -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #24 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211331&action=edit Bug 26540: (QA follow-up) Don't rely on the caller's registers variable in transaction_types.inc transaction_types.inc checked "registers.size" to decide whether CASH should be offered for payouts and refunds. That variable is set by the including page: the patron account pages get an array from the Registers.all plugin, but pos/register.pl passed a Koha::Cash::Registers resultset, which has no "size" method. The POS register page failed with: The method Koha::Cash::Registers->size is not covered by tests! The include now asks the Registers plugin itself whether the current library has any register, so it behaves the same wherever it is used. pos/register.pl no longer passes the "registers" template parameter, which register.tt never used. To test: 1. Set UseCashRegisters to 'Use' 2. Add a cash register for your library (Administration > Cash registers) 3. Go to Point of sale > Register details for that register => The page loads (before this patch: Internal Server Error) 4. Open a patron's accounting page with a credit and a paid debit => The payout and refund type selects offer 'Cash' 5. Archive the register so your library has none => On the accounting page 'Cash' is no longer offered, and the prompt to create a cash register is shown 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #25 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hi all, Thanks Pedro, good catch on the POS register page. I could reproduce it here: with UseCashRegisters on and a register at the library, pos/register.pl?registerid=1 fails with "The method Koha::Cash::Registers->size is not covered by tests!" from includes/transaction_types.inc. The cause is that the new check in the shared include reads the "registers" variable from whichever page includes it. The patron account pages (boraccount, mancredit, paycollect, pos/pay) get it from the Registers.all plugin, which returns an array. pos/register.pl passes a Koha::Cash::Registers resultset instead, which has no "size", so it blows up. register.tt never actually used that "registers" param. It only uses the single "register" and the error_registers flag, so it was a leftover from the original register details page. The include is used there for the Issue refund modal. I have attached a follow-up patch that: - makes transaction_types.inc independent of the caller. It now asks the Registers plugin itself whether the current library has any register before hiding CASH for payout and refund. That keeps it as one include with the same result on every page. - removes the unused "registers" template parameter from pos/register.pl. Testing done: pos/register.pl now loads and the refund modal still offers CASH. On the patron account page, payout and refund still offer CASH when the library has a register, and CASH is hidden when it has none. Two notes for later: - Passing an array in some templates and a resultset in others is what caused this. It would be better to have the Registers plugin return a resultset too, but that touches the plugin, the options_for_registers block and about seven templates, so I'd rather do that on a separate bug. - pos/register.pl does not scope the registerid parameter to the current library. If someone opens a register from another library and their own library has none, CASH would be hidden on that refund modal. It's an edge case and not new in this patch, so I haven't changed it here. Setting this back to Passed QA for Pedro's queue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26540 --- Comment #26 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org