Bug 21587: don't drop patrons to notify in order creation
authorVictor Grousset <victor.grousset@biblibre.com>
Thu, 18 Oct 2018 09:54:58 +0000 (11:54 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 26 Oct 2018 16:43:15 +0000 (16:43 +0000)
It only worked on modification.

== Test plan ==
1. have/create a active budget
2. have/create a fund
3. have/create a vendor with minimal info
4. create a basket with minimal info
5. add an order line to the basket
     Add a user in "To notify on receiving"
6. Modify the order
7. The patrons isn't here. This is the bug
8. Add a user in "To notify on receiving"
9. Save
10. Modify the order
11. The patron is here now
12. Apply this patch
13. Retry step 5 to 11 and patron should be saved on order creation
14. Celebrate! :D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

acqui/addorder.pl

index 17b50e6..2c269e0 100755 (executable)
@@ -290,14 +290,13 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) {
     my $order = Koha::Acquisition::Order->new($orderinfo);
     if ( $orderinfo->{ordernumber} ) {
         ModOrder($orderinfo);
-        my $order_users_ids = $input->param('users_ids');
-        my @order_users = split( /:/, $order_users_ids );
-
-        ModOrderUsers( $orderinfo->{ordernumber}, @order_users );
     }
     else { # else, it's a new line
         $order->store;
     }
+    my $order_users_ids = $input->param('users_ids');
+    my @order_users = split( /:/, $order_users_ids );
+    ModOrderUsers( $order->ordernumber, @order_users );
 
     # now, add items if applicable
     if ($basket->effective_create_items eq 'ordering') {