From 770f3de705fc2e0723547a5f781de915dd38b6fa Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Fri, 7 Sep 2018 13:46:12 -0300
Subject: [PATCH] Bug 15184: Set created_by to the logged in user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
---
 Koha/Acquisition/Order.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm
index dfb5ad9008..045a933192 100644
--- a/Koha/Acquisition/Order.pm
+++ b/Koha/Acquisition/Order.pm
@@ -274,7 +274,8 @@ sub duplicate_to {
                 $order_info->{$field} = $value;
             }
 
-            # FIXME $order_info->{created_by} = logged_in_user?
+            my $userenv = C4::Context->userenv;
+            $order_info->{created_by} = $userenv->{number};
             $order_info->{basketno} = $basket->basketno;
 
             $new_order = Koha::Acquisition::Order->new($order_info)->store;
-- 
2.11.0