Bug 19130: (followup) Controller scripts should preserve behaviour
[koha.git] / acqui / finishreceive.pl
index 10a0e0c..71a07f6 100755 (executable)
@@ -28,11 +28,11 @@ use C4::Output;
 use C4::Context;
 use C4::Acquisition;
 use C4::Biblio;
-use C4::Bookseller;
 use C4::Items;
 use C4::Search;
 
-use Koha::Acquisition::Bookseller;
+use Koha::Number::Price;
+use Koha::Acquisition::Booksellers;
 
 use List::MoreUtils qw/any/;
 
@@ -58,7 +58,9 @@ my $bookfund         = $input->param("bookfund");
 my $order            = GetOrder($ordernumber);
 my $new_ordernumber  = $ordernumber;
 
-#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
+$unitprice = Koha::Number::Price->new( $unitprice )->unformat();
+
+#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
 if ($quantityrec > $origquantityrec ) {
     my @received_items = ();
     if(C4::Context->preference('AcqCreateItem') eq 'ordering') {
@@ -84,8 +86,6 @@ if ($quantityrec > $origquantityrec ) {
     $order->{tax_rate_on_receiving} = $input->param("tax_rate");
     $order->{unitprice} = $unitprice;
 
-    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
-
     $order = C4::Acquisition::populate_order_with_prices(
         {
             order => $order,
@@ -153,6 +153,7 @@ ModItem(
     {
         booksellerid         => $booksellerid,
         dateaccessioned      => $datereceived,
+        datelastseen         => $datereceived,
         price                => $unitprice,
         replacementprice     => $order->{rrp},
         replacementpricedate => $datereceived,