ffzg/recall_notices.pl: added --interval and --dedup
[koha.git] / acqui / neworderempty.pl
index 6326eaf..9ca2b5b 100755 (executable)
@@ -94,6 +94,7 @@ use Koha::MarcSubfieldStructures;
 use Koha::ItemTypes;
 use Koha::Patrons;
 use Koha::RecordProcessor;
+use Koha::Subscriptions;
 
 our $input           = new CGI;
 my $booksellerid    = $input->param('booksellerid');   # FIXME: else ERROR!
@@ -164,9 +165,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){
         exit;
     }
     #from this point: add a new record
-        if (C4::Context->preference("BiblioAddsAuthorities")){
-            my $headings_linked=BiblioAutoLink($marcrecord, $params->{'frameworkcode'});
-        }
         my $bibitemnum;
         $params->{'frameworkcode'} or $params->{'frameworkcode'} = "";
         ( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $params->{'frameworkcode'} );
@@ -371,9 +369,9 @@ if ( defined $from_subscriptionid ) {
         $data->{tax_rate}       = $lastOrderReceived->{tax_rate_on_ordering};
         $data->{discount}       = $lastOrderReceived->{discount};
         $data->{rrp}            = $lastOrderReceived->{rrp};
+        $data->{replacementprice} = $lastOrderReceived->{replacementprice};
         $data->{ecost}          = $lastOrderReceived->{ecost};
         $data->{quantity}       = $lastOrderReceived->{quantity};
-        $data->{unitprice}      = $lastOrderReceived->{unitprice};
         $data->{order_internalnote} = $lastOrderReceived->{order_internalnote};
         $data->{order_vendornote}   = $lastOrderReceived->{order_vendornote};
         $data->{sort1}          = $lastOrderReceived->{sort1};
@@ -382,7 +380,11 @@ if ( defined $from_subscriptionid ) {
         $basket = GetBasket( $input->param('basketno') );
     }
 
-    $template->param( subscriptionid => $from_subscriptionid );
+    my $subscription = Koha::Subscriptions->find($from_subscriptionid);
+    $template->param(
+        subscriptionid => $from_subscriptionid,
+        subscription   => $subscription,
+    );
 }
 
 # Find the items.barcode subfield for barcode validations
@@ -454,12 +456,12 @@ $template->param(
     quantity         => $quantity,
     quantityrec      => $quantity,
     rrp              => $data->{'rrp'},
+    replacementprice => $data->{'replacementprice'},
     gst_values       => \@gst_values,
     tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->tax_rate ? $bookseller->tax_rate+0.0 : 0,
     listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
     total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
     ecost            => sprintf( "%.2f", $data->{ecost} || 0),
-    unitprice        => sprintf( "%.2f", $data->{unitprice} || 0),
     publishercode    => $data->{'publishercode'},
     barcode_subfield => $barcode_subfield,
     import_batch_id  => $import_batch_id,