Bug 24665

Summary: Add ability to run cash register report with new cash register feature
Product: Koha Reporter: Kelly McElligott <kelly>
Component: ReportsAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, jonathan.druart, lucas, sally.healey
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement exposes the ability to refine the cash register report by cash register the transactions have taken place upon if you are using the 'UseCashRegisters' feature.
Version(s) released in:
20.11.00
Circulation function:
Bug Depends on: 24786    
Bug Blocks: 13985    
Attachments: Bug 24665: Add support for filtering by cash register
Bug 24665: Add support for filtering by cash register
Bug 24665: Add support for filtering by cash register
Bug 24665: Add support for filtering by cash register
Bug 24665: Add support for filtering by cash register
Bug 24665: (QA follow-up) Fix selection default
Bug 24665: (QA follow-up) Add tests for 'selected'

Description Kelly McElligott 2020-02-14 14:44:39 UTC
With the introduction of Cash Registers in 19.11, it would be ideal if a library could run the "Cash register" report (found under Statistic Wizard in Reports) and specifically choose to refine the report to a specific Cash Register.
Comment 1 Martin Renvoize (ashimema) 2020-03-06 17:01:59 UTC
What did you have in mind Kelly...

I must admit, I've never really used that report.  Having just taken a look at it, are you simply suggesting adding the ability to limit the results by a particular cash register via a select menu?
Comment 2 Martin Renvoize (ashimema) 2020-07-21 13:54:48 UTC
Created attachment 107150 [details] [review]
Bug 24665: Add support for filtering by cash register
Comment 3 Martin Renvoize (ashimema) 2020-07-21 13:55:42 UTC
Didn't get much of a brief here, so I've just added filtering for now, but let me know what additional requirements you might have.. I wasn't sure if you also wanted it in the standard output of the report too?
Comment 4 ByWater Sandboxes 2020-07-21 16:17:49 UTC
Created attachment 107164 [details] [review]
Bug 24665: Add support for filtering by cash register

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 5 Kelly McElligott 2020-07-21 16:20:27 UTC
Martin,
Great!  This will be helpful to those libraries that use this built in report!  Of course any other type of report if needed can be created using MySql in the Koha report module.
Comment 6 Katrin Fischer 2020-08-16 22:26:19 UTC
Blocked by depending bug 24786 currently in need of a sign-off!
Comment 7 Martin Renvoize (ashimema) 2020-10-01 13:42:55 UTC
Dont' suppose you fancied testing/signing off on bug 24786 did you Kelly?  It's a dependency here so you effectively tested it whilst testing this one.
Comment 8 Martin Renvoize (ashimema) 2020-11-03 09:27:58 UTC
Created attachment 112901 [details] [review]
Bug 24665: Add support for filtering by cash register

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 9 Martin Renvoize (ashimema) 2020-11-03 09:28:13 UTC
Rebased, ready for QA
Comment 10 Katrin Fischer 2020-11-03 22:31:32 UTC
Created attachment 112960 [details] [review]
Bug 24665: Add support for filtering by cash register

This patch makes it possible to filter on cash register
on the cash register statistics page.

To test:
- Activate UseCashRegisters
- Create a cash register or more to use
- Create some manual fees and fines
- Pay some of them off
- Go to Tools > Cash register statistics
- Test if the new filter for cash registers works as it should

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Jonathan Druart 2020-11-06 10:26:26 UTC
"--None--" is actually a "All" filter.
Should not it be "All" or "" instead?
Comment 12 Martin Renvoize (ashimema) 2020-11-06 12:24:19 UTC
(In reply to Jonathan Druart from comment #11)
> "--None--" is actually a "All" filter.
> Should not it be "All" or "" instead?

Hmm, fair comment.. challenge is that the default value comes from the html_helper.

I've already worked around this once in the dependency bug as the same issue was present on the login page (i.e Library default vs '--None--'.

I'll take a look at simplifying it here
Comment 13 Martin Renvoize (ashimema) 2020-11-06 12:53:22 UTC
Created attachment 113247 [details] [review]
Bug 24665: Add support for filtering by cash register

This patch makes it possible to filter on cash register
on the cash register statistics page.

To test:
- Activate UseCashRegisters
- Create a cash register or more to use
- Create some manual fees and fines
- Pay some of them off
- Go to Tools > Cash register statistics
- Test if the new filter for cash registers works as it should

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Martin Renvoize (ashimema) 2020-11-06 12:53:26 UTC
Created attachment 113248 [details] [review]
Bug 24665: (QA follow-up) Fix selection default

This patch updates the html_helper for the cash register selection block
to remove the 'empty option' such that it can be correclty set for each
select case and updates all existing cases where we used the process
block previously to include the relevant blank option '-- Select an
option --', '-- None --', 'Library default' and finally the new '-- All
--' options introduced with this bug.
Comment 15 Martin Renvoize (ashimema) 2020-11-06 12:53:58 UTC
:) - Much cleaner now.
Comment 16 Jonathan Druart 2020-11-06 14:56:05 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 17 Martin Renvoize (ashimema) 2020-11-06 16:29:00 UTC
Created attachment 113261 [details] [review]
Bug 24665: (QA follow-up) Add tests for 'selected'

Add a unit test to prove the 'selected' param passed to
Koha::Template::Plugin::Registers is adhered to.
Comment 18 Jonathan Druart 2020-11-09 10:44:06 UTC
(In reply to Martin Renvoize from comment #17)
> Created attachment 113261 [details] [review] [review]
> Bug 24665: (QA follow-up) Add tests for 'selected'
> 
> Add a unit test to prove the 'selected' param passed to
> Koha::Template::Plugin::Registers is adhered to.

Pushed to master for 20.11.
Comment 19 Lucas Gass (lukeg) 2020-11-16 22:18:24 UTC
enhancement will not be backported to 20.05.x