Bug 26540

Summary: Server error when attempting to issue cash credit with UseCashRegisters
Product: Koha Reporter: Kelly McElligott <kelly>
Component: Fines and feesAssignee: Martin Renvoize <martin.renvoize>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lucas, martin.renvoize
Version: 20.05   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 24786    
Bug Blocks: 13985    
Attachments: Bug 26540: Remove 'CASH' type from 'refund' and 'payout'

Description Kelly McElligott 2020-09-25 17:39:22 UTC
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.
Comment 1 Martin Renvoize 2020-09-29 19:35:44 UTC
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.
Comment 2 Kelly McElligott 2020-09-30 18:28:22 UTC
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.
Comment 3 Martin Renvoize 2020-10-02 11:49:38 UTC
Created attachment 111137 [details] [review]
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.
Comment 4 Martin Renvoize 2020-10-02 11:52:44 UTC
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.
Comment 5 Lucas Gass 2023-02-03 17:39:26 UTC
no longer applies cleanly to master