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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 26 Nov 2018 06:27:32 +0000 (07:27 +0100)
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>
(cherry picked from commit bf8b4e773c089a4094b18c62af91711b8af99f82)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cb7db6fcd45d956d28596d86de312ee5502333a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

acqui/addorder.pl

index c102779..2e69504 100755 (executable)
@@ -280,14 +280,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( $orderinfo->{ordernumber}, @order_users );
 
     # now, add items if applicable
     if ($basket->effective_create_items eq 'ordering') {