Bug 22565 - Partially receiving order and adding internal note on invoice updates note on every order on the system
Summary: Partially receiving order and adding internal note on invoice updates note on...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 18.11
Hardware: All All
: P5 - low blocker (vote)
Assignee: Martin Renvoize
QA Contact: Josef Moravec
URL:
Keywords:
Depends on: 21467
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-22 16:14 UTC by Janet McGowan
Modified: 2019-10-14 19:59 UTC (History)
7 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 22565: Do NOT replace all internalnote's on receive (1.29 KB, patch)
2019-03-25 10:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22565: Add test for ModReceiveOrder regression (1.46 KB, patch)
2019-03-25 11:06 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22565: Do NOT replace all internalnote's on receive (1.35 KB, patch)
2019-03-25 11:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22565: Add test for ModReceiveOrder regression (1.51 KB, patch)
2019-03-25 11:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22565: (QA follow-up) Fix test Acquisition.t (1.22 KB, patch)
2019-03-25 11:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22565: (QA follow-up) Fix test Acquisition.t (1.29 KB, patch)
2019-03-25 11:55 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janet McGowan 2019-03-22 16:14:32 UTC
Tested on 18.11.01 and 18.11.03

If you have an order for multiple copies and only receipt one or more of those copies but not the entire number, and edit the internal note field on the invoice screen, the internal note field then updates every order on the system. 
The internal note is applied to all orders but also it overwrites any other note that was there.
Comment 1 Katrin Fischer 2019-03-24 12:18:11 UTC
Data loss bug - updating severity.
Comment 2 Martin Renvoize 2019-03-25 10:43:08 UTC
Looks like this was caused by bug 21467. There's a really clear mistake in the Update statement that's called in that it's missing a WHERE clause... Ooops.
Comment 3 Martin Renvoize 2019-03-25 10:52:49 UTC
Created attachment 86965 [details] [review]
Bug 22565: Do NOT replace all internalnote's on receive

Bug 21467 introduced a but whereby setting any order_internalnote on
receive one would end up setting all orders to have that internalnote.

This patch adds the missing WHERE clause to the database query which was
likely lost during a rebase?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2019-03-25 11:06:09 UTC
Created attachment 86966 [details] [review]
Bug 22565: Add test for ModReceiveOrder regression

This test checks that order_internalnote is only updated for the given
orderline in ModReceiveOrder.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Josef Moravec 2019-03-25 11:25:38 UTC
Created attachment 86967 [details] [review]
Bug 22565: Do NOT replace all internalnote's on receive

Bug 21467 introduced a but whereby setting any order_internalnote on
receive one would end up setting all orders to have that internalnote.

This patch adds the missing WHERE clause to the database query which was
likely lost during a rebase?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2019-03-25 11:25:41 UTC
Created attachment 86968 [details] [review]
Bug 22565: Add test for ModReceiveOrder regression

This test checks that order_internalnote is only updated for the given
orderline in ModReceiveOrder.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2019-03-25 11:25:44 UTC
Created attachment 86969 [details] [review]
Bug 22565: (QA follow-up) Fix test Acquisition.t

Test plan:
prove t/db_dependent/Acquisition.t
should pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Martin Renvoize 2019-03-25 11:55:03 UTC
Created attachment 86970 [details] [review]
Bug 22565: (QA follow-up) Fix test Acquisition.t

Test plan:
prove t/db_dependent/Acquisition.t
should pass

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2019-03-25 11:56:12 UTC
Thanks Josef, looking good.
Comment 10 Nick Clemens 2019-03-25 12:14:16 UTC
Awesome work all!

Pushed to master for 19.05
Comment 11 Martin Renvoize 2019-03-25 15:09:43 UTC
Pushed to 18.11.x for 18.11.04
Comment 12 Lucas Gass 2019-04-01 15:47:40 UTC
missing dependency for 18.05.x, not backporting.