Bug 31144 - When modifying an order we should not load the vendor default discount
Summary: When modifying an order we should not load the vendor default discount
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-12 18:38 UTC by Nick Clemens
Modified: 2023-12-28 20:43 UTC (History)
6 users (show)

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


Attachments
Bug 31144: When modifying an order we should not load the vendor default discount (1.91 KB, patch)
2022-07-12 18:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 31144: When modifying an order we should not load the vendor default discount (1.97 KB, patch)
2022-07-12 18:53 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 31144: When modifying an order we should not load the vendor default discount (2.04 KB, patch)
2022-07-15 15:06 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 Nick Clemens 2022-07-12 18:38:59 UTC
After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
Comment 1 Nick Clemens 2022-07-12 18:40:19 UTC
Created attachment 137651 [details] [review]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation
Comment 2 ByWater Sandboxes 2022-07-12 18:53:21 UTC
Created attachment 137652 [details] [review]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 3 Martin Renvoize 2022-07-15 15:06:37 UTC
Created attachment 137770 [details] [review]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2022-07-15 15:06:55 UTC
Trivial fix, Passing QA
Comment 5 Tomás Cohen Arazi 2022-07-18 17:55:55 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass 2022-08-23 19:23:55 UTC
Backported to 22.05.x for 22.05.05
Comment 7 Arthur Suzuki 2022-08-30 09:23:08 UTC
thx pushed to 21.11.x for 21.11.12
Comment 8 Victor Grousset/tuxayo 2022-09-14 19:08:10 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Maybe something to document.
Comment 9 Caroline Cyr La Rose 2023-02-27 15:35:34 UTC
This is a bug fix, nothing to document that I can see.