Bug 9374: (follow-up) add FIXME suggesting that use of a regexp is not the long-term...
[koha.git] / acqui / addorderiso2709.pl
index c4f889f..abfb870 100755 (executable)
@@ -222,12 +222,8 @@ if ($op eq ""){
             my $basket     = GetBasket( $orderinfo{basketno} );
             my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
             $orderinfo{gstrate} = $bookseller->{gstrate};
-            if ( $bookseller->{listincgst} ) {
-                $orderinfo{ecost} = $price;
-            } else {
-                $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} );
-            }
-            $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} );
+            $orderinfo{rrp}   = $price;
+            $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} / 100 );
             $orderinfo{listprice} = $orderinfo{rrp};
             $orderinfo{unitprice} = $orderinfo{ecost};
             $orderinfo{total} = $orderinfo{ecost};
@@ -429,11 +425,11 @@ sub batch_info {
                                               'current_matcher_description' => $matcher->description());
         }
     }
-    add_matcher_list($batch->{'matcher_id'});
+    add_matcher_list($batch->{'matcher_id'}, $template);
 }
 
 sub add_matcher_list {
-    my $current_matcher_id = shift;
+    my ($current_matcher_id, $template) = @_;
     my @matchers = C4::Matcher::GetMatcherList();
     if (defined $current_matcher_id) {
         for (my $i = 0; $i <= $#matchers; $i++) {