Bug 17667 - Standing orders - cancelling a receipt increase the original quantity
Summary: Standing orders - cancelling a receipt increase the original quantity
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: PC All
: P2 major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 15531
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-22 09:31 UTC by Jonathan Druart
Modified: 2020-02-14 02:17 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08, 18.11.14


Attachments
Example (110.34 KB, image/png)
2019-12-18 16:02 UTC, Diane Westerfield
Details
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled (4.43 KB, patch)
2019-12-18 17:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled (4.31 KB, patch)
2019-12-27 16:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17667: Add tests (1.16 KB, patch)
2019-12-27 16:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled (4.37 KB, patch)
2020-01-13 15:11 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17667: Add tests (1.22 KB, patch)
2020-01-13 15:11 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled (4.43 KB, patch)
2020-01-19 22:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17667: Add tests (1.28 KB, patch)
2020-01-19 22:01 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-11-22 09:31:45 UTC
When cancelling a receipt, the quantity of the original order is increased.
That does not sound correct.
Comment 1 Diane Westerfield 2019-12-18 15:59:16 UTC
Have run into this bug when I accidentally received the same title twice on one invoice, then tried to cancel/unreceive the duplicate. Very frustrating.
Comment 2 Diane Westerfield 2019-12-18 16:02:55 UTC
Created attachment 96427 [details]
Example
Comment 3 Jonathan Druart 2019-12-18 17:13:04 UTC
Created attachment 96433 [details] [review]
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled

When cancelling a receipt, the quantity of the original order is
increased.

Test plan:
Create a basket, mark is as "standing orders"
Create an order
receive it
cancel the receipt
=> Without this patch the quantity of the original order is 2
=> With this patch applied the quantity it always 1
Comment 4 Jonathan Druart 2019-12-18 17:14:35 UTC
It surprises me that this bug did not get attention earlier.
Comment 5 Katrin Fischer 2019-12-22 13:16:04 UTC
Should the warn not be removed?

+            warn "setting ".
+                $order->{'quantity'} + $parent_order->{'quantity'} . " to $parent_ordernumber";
Comment 6 Jonathan Druart 2019-12-27 16:26:32 UTC
Created attachment 96663 [details] [review]
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled

When cancelling a receipt, the quantity of the original order is
increased.

Test plan:
Create a basket, mark is as "standing orders"
Create an order
receive it
cancel the receipt
=> Without this patch the quantity of the original order is 2
=> With this patch applied the quantity it always 1
Comment 7 Jonathan Druart 2019-12-27 16:26:35 UTC
Created attachment 96664 [details] [review]
Bug 17667: Add tests
Comment 8 ByWater Sandboxes 2020-01-13 15:11:41 UTC
Created attachment 97317 [details] [review]
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled

When cancelling a receipt, the quantity of the original order is
increased.

Test plan:
Create a basket, mark is as "standing orders"
Create an order
receive it
cancel the receipt
=> Without this patch the quantity of the original order is 2
=> With this patch applied the quantity it always 1

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 9 ByWater Sandboxes 2020-01-13 15:11:43 UTC
Created attachment 97318 [details] [review]
Bug 17667: Add tests

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 10 Katrin Fischer 2020-01-19 22:01:35 UTC
Created attachment 97593 [details] [review]
Bug 17667: Do not modify quantity of the original standing order when a receipt is cancelled

When cancelling a receipt, the quantity of the original order is
increased.

Test plan:
Create a basket, mark is as "standing orders"
Create an order
receive it
cancel the receipt
=> Without this patch the quantity of the original order is 2
=> With this patch applied the quantity it always 1

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2020-01-19 22:01:39 UTC
Created attachment 97594 [details] [review]
Bug 17667: Add tests

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Martin Renvoize 2020-01-20 14:01:49 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 13 Martin Renvoize 2020-01-20 14:04:11 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 14 Joy Nelson 2020-01-31 23:47:33 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 15 Lucas Gass 2020-02-13 16:52:27 UTC
backported to 19.05.x for 19.05.08
Comment 16 Hayley Mapley 2020-02-14 02:17:17 UTC
Backported to 18.11.x for 18.11.14.