Bug 15184: Change permission (+x) on .pl
[koha.git] / acqui / finishreceive.pl
index 484f562..c72da15 100755 (executable)
@@ -20,8 +20,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
 use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Output;
@@ -49,6 +48,7 @@ my $origquantityrec  = $input->param('origquantityrec');
 my $quantityrec      = $input->param('quantityrec');
 my $quantity         = $input->param('quantity');
 my $unitprice        = $input->param('unitprice');
+my $replacementprice = $input->param('replacementprice');
 my $datereceived     = $input->param('datereceived'),
 my $invoiceid        = $input->param('invoiceid');
 my $invoice          = GetInvoice($invoiceid);
@@ -60,9 +60,10 @@ my $order            = GetOrder($ordernumber);
 my $new_ordernumber  = $ordernumber;
 
 $unitprice = Koha::Number::Price->new( $unitprice )->unformat();
+$replacementprice = Koha::Number::Price->new( $replacementprice )->unformat();
 my $basket = Koha::Acquisition::Orders->find( $ordernumber )->basket;
 
-#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
+#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 ($basket->effective_create_items eq 'ordering') {
@@ -86,6 +87,7 @@ if ($quantityrec > $origquantityrec ) {
 
     $order->{order_internalnote} = $input->param("order_internalnote");
     $order->{tax_rate_on_receiving} = $input->param("tax_rate");
+    $order->{replacementprice} = $replacementprice;
     $order->{unitprice} = $unitprice;
 
     $order = C4::Acquisition::populate_order_with_prices(
@@ -157,7 +159,7 @@ ModItem(
         dateaccessioned      => $datereceived,
         datelastseen         => $datereceived,
         price                => $unitprice,
-        replacementprice     => $order->{rrp},
+        replacementprice     => $replacementprice,
         replacementpricedate => $datereceived,
     },
     $biblionumber,