From 143cbc24d4e0a36d2b917827f6187045dccbd959 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 1 Mar 2017 13:49:52 +0100 Subject: [PATCH] Bug 18187: finishreceive.pl: Save bookseller name into items acquisition source field Content-Type: text/plain; charset=utf-8 Currently, finishreceive saves the literal booksellerid (a number) into the item text field labeled as "Source of acquisition", unfortunately called booksellerid. (This is the case for AcqCreateItem == receiving.) I opened up another report for renaming this item field (18188). On this report we make finishreceive.pl save the name of the bookseller into the item field. This is more informative. But I could imagine that we need a broader solution: [1] Do we really always want that information in an item? [2] Should orderreceive not put this information in the item field? Now we postpone that to finishreceive; finishreceive just overwrites these fields, completely ignoring what was there. Any feedback is welcome. Test plan: [1] Set AcqCreateItem to receiving. [2] Receive an order. Check 952$e in the resulting item. --- acqui/finishreceive.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 2c6340c..920bbd4 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -146,9 +146,11 @@ if ($quantityrec > $origquantityrec ) { } } +my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); +my $booksellername = $bookseller ? $bookseller->name : ''; ModItem( { - booksellerid => $booksellerid, + booksellerid => $booksellername, dateaccessioned => $datereceived, price => $unitprice, replacementprice => $order->{rrp}, -- 2.1.4