When cancelling a receipt, the quantity of the original order is increased. That does not sound correct.
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.
Created attachment 96427 [details] Example
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
It surprises me that this bug did not get attention earlier.
Should the warn not be removed? + warn "setting ". + $order->{'quantity'} + $parent_order->{'quantity'} . " to $parent_ordernumber";
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
Created attachment 96664 [details] [review] Bug 17667: Add tests
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>
Created attachment 97318 [details] [review] Bug 17667: Add tests Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
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>
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>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.03
backported to 19.05.x for 19.05.08
Backported to 18.11.x for 18.11.14.