To recreate: 1 - Create a basket set to create items on ordering 2 - Add to this basket, confirm items are created 3 - Add to this basket from the prevous order 4 - Note no new items are created
In our testing, a new item was created if biblio.serial was null but not if biblio.serial was 0.
(In reply to Andrew from comment #1) > In our testing, a new item was created if biblio.serial was null but not if > biblio.serial was 0. Oops, sorry, disregard this. Mis-remembered our testing. No items were created for any value of biblio.serial.
Created attachment 85473 [details] [review] Bug 22390: (bug 15184 follow-up) Use aqorders.subscriptionid instead of biblio.serial It seems that we made a wrong assumption on bug 15184, see commit d658cb6f7ecb18845a78d4708ee63ad1126f220f Bug 15184: Do copy items for not a serial OR if items are created on ordering To know if an order has been created from a subscription we should check $order->subscriptionid instead of the $biblio->serial flag
(In reply to Andrew from comment #2) > (In reply to Andrew from comment #1) > > In our testing, a new item was created if biblio.serial was null but not if > > biblio.serial was 0. > > Oops, sorry, disregard this. Mis-remembered our testing. No items were > created for any value of biblio.serial. Should have been copied for biblio.serial set to 1, but it seems that this behavior was wrong, please test the patch.
This seems to have improved things - If I copy an order from a basket where effective create items is 'ordering' then a new item is created. However If I copy from a basket that did create items to a new basket that where effective create items is 'cataloging' an item is created, though it should not be. I think the correct condition might be if ( (!$self->subscriptionid) && ($self->basket->effective_create_items eq 'ordering') ) { # Do copy items if not a serial AND if items are created on ordering in this basket
Created attachment 86027 [details] [review] Bug 22390: Never copy items if original order has been created from a subscription
Created attachment 86523 [details] [review] Bug 22390: (bug 15184 follow-up) Use aqorders.subscriptionid instead of biblio.serial It seems that we made a wrong assumption on bug 15184, see commit d658cb6f7ecb18845a78d4708ee63ad1126f220f Bug 15184: Do copy items for not a serial OR if items are created on ordering To know if an order has been created from a subscription we should check $order->subscriptionid instead of the $biblio->serial flag Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 86524 [details] [review] Bug 22390: Never copy items if original order has been created from a subscription Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice catch and followup. Signing Off.
Created attachment 87560 [details] [review] Bug 22390: (bug 15184 follow-up) Use aqorders.subscriptionid instead of biblio.serial It seems that we made a wrong assumption on bug 15184, see commit d658cb6f7ecb18845a78d4708ee63ad1126f220f Bug 15184: Do copy items for not a serial OR if items are created on ordering To know if an order has been created from a subscription we should check $order->subscriptionid instead of the $biblio->serial flag Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 87561 [details] [review] Bug 22390: Never copy items if original order has been created from a subscription Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Tiny change to the code comment: serial => subscription order
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
missing dependency, not backporting to 18.05.x
This would be a great enhancement if only it would allow you to change the quantity. Typically we only order 1 copy initially, but if the item is popular, when we re-order we would want to add 2 or 3 (or more) copies. I don't see much advantage of having to replicate this process multiple times, versus just creating a new order with the number of items needed.
Sandre, the use case laid out in the original bug 15184 was focused on cases where you would be copying the whole order exactly -- like serials or databases, where generally you're only going to have a quantity of 1 anyway and it will stay consistent order-to-order. I agree that this is not going to be the easiest way to do what you're doing. For that I'd probably just add to basket from the existing bib.