@@ -, +, @@ if no discount on vendor 0 - Have a vendor with a discount of 0% specified (no discount) 1 - Export a record from your Koha 2 - Stage the record for import and match on biblionumber 3 - Add to a basket in acq from the staged file 4 - Select the title, and set order price to $10 and do not fill the discount field 5 - Add the order - note $0 order line 6 - Repeat with another vendor with a 10% discount and confirm that is correct 7 - Apply patch 8 - Repeat 2-4 9 - Add the order and confirm $10 price --- acqui/addorderiso2709.pl | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) --- a/acqui/addorderiso2709.pl +++ a/acqui/addorderiso2709.pl @@ -275,12 +275,10 @@ if ($op eq ""){ $price = Koha::Number::Price->new($price)->unformat; $orderinfo{tax_rate_on_ordering} = $bookseller->tax_rate; $orderinfo{tax_rate_on_receiving} = $bookseller->tax_rate; - my $c = $c_discount ? $c_discount : $bookseller->discount; - $orderinfo{discount} = $c; - if ( $c ) { - $orderinfo{ecost} = $price * ( 1 - $c / 100 ); - $orderinfo{rrp} = $price; - } + my $order_discount = $c_discount ? $c_discount : $bookseller->discount; + $orderinfo{discount} = $order_discount; + $orderinfo{rrp} = $price; + $orderinfo{ecost} = $order_discount ? $price * ( 1 - $order_discount / 100 ) : $price; $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate; $orderinfo{unitprice} = $orderinfo{ecost}; } else { @@ -324,12 +322,10 @@ if ($op eq ""){ $c_price = Koha::Number::Price->new($c_price)->unformat; $orderinfo{tax_rate_on_ordering} = $bookseller->tax_rate; $orderinfo{tax_rate_on_receiving} = $bookseller->tax_rate; - my $c = $c_discount ? $c_discount : $bookseller->discount; - $orderinfo{discount} = $c; - if ( $c ) { - $orderinfo{ecost} = $c_price * ( 1 - $c / 100 ); - $orderinfo{rrp} = $c_price; - } + my $order_discount = $c_discount ? $c_discount : $bookseller->discount; + $orderinfo{discount} = $order_discount; + $orderinfo{rrp} = $c_price; + $orderinfo{ecost} = $order_discount ? $c_price * ( 1 - $order_discount / 100 ) : $c_price; $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate; $orderinfo{unitprice} = $orderinfo{ecost}; } else { --