Bug 19551 - Cash register report has bad erroneous results from wrong order of operations
Summary: Cash register report has bad erroneous results from wrong order of operations
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 6934
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-31 13:17 UTC by Nick Clemens
Modified: 2019-10-14 19:55 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19551 - Fix wrong order of operations iun cash register report (1.31 KB, patch)
2017-10-31 13:20 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 19551 - Fix wrong order of operations in cash register report (1.36 KB, patch)
2017-11-01 03:06 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 19551 - Fix wrong order of operations in cash register report (1.45 KB, patch)
2017-11-27 12:12 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.