Bug 19551

Summary: Cash register report has bad erroneous results from wrong order of operations
Product: Koha Reporter: Nick Clemens <nick>
Component: ReportsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, m.de.rooy, marjorie.barry-vila
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 6934    
Bug Blocks:    
Attachments: Bug 19551 - Fix wrong order of operations iun cash register report
Bug 19551 - Fix wrong order of operations in cash register report
Bug 19551 - Fix wrong order of operations in cash register report

Description Nick Clemens 2017-10-31 13:17:16 UTC
in reports/cash_register_stats.pl
$whereTType = q{ AND accounttype = 'FOR' OR accounttype = 'W' };
needs parens to combine the OR, better yet:
$whereTType = q{ AND accounttype IN ('FOR','W') };
Comment 1 Nick Clemens 2017-10-31 13:20:17 UTC
Created attachment 68857 [details] [review]
Bug 19551 - Fix wrong order of operations iun cash register report

To test:
1 - Find or create a fine for a patron
2 - Write it off
3 - Run the cash register report for current date, see your write off
4 - Run the cash register report for previous dates, still see your
write off
5 - Apply patch
6 - Run cash register for current date, writee off shows (good)
7 - Run cash register report for previous dates, write off does not show
(good)
8 - Sign off
Comment 2 Mark Tompsett 2017-11-01 03:06:15 UTC
Created attachment 68876 [details] [review]
Bug 19551 - Fix wrong order of operations in cash register report

To test:
1 - Find or create a fine for a patron
2 - Write it off
3 - Home -> Reports -> Cash register
4 - Fill in current date and transaction type 'Write off'
5 - Click Submit
-- see your write off
6 - Fill in previous dates and transaction type 'Write off'
7 - Click Submit
-- see your write off (bad)
8 - Apply patch
9 - Rerun steps 3-7
-- write only visible for current date.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 Marcel de Rooy 2017-11-27 12:12:11 UTC
Created attachment 69371 [details] [review]
Bug 19551 - Fix wrong order of operations in cash register report

To test:
1 - Find or create a fine for a patron
2 - Write it off
3 - Home -> Reports -> Cash register
4 - Fill in current date and transaction type 'Write off'
5 - Click Submit
-- see your write off
6 - Fill in previous dates and transaction type 'Write off'
7 - Click Submit
-- see your write off (bad)
8 - Apply patch
9 - Rerun steps 3-7
-- write only visible for current date.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Jonathan Druart 2017-12-07 14:24:58 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 5 Nick Clemens 2017-12-14 12:34:44 UTC
Pushed to stable for 17.11.01, awesome work all!
Comment 6 Fridolin Somers 2017-12-21 08:04:12 UTC
Code has changed a lot because of Bug 19061 that is not in 17.05.x.
If this is needed for 17.05.x, please provide a rebased patch.