diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index 289e4a3115..7f097cc596 100644 --- a/Koha/Acquisition/Order.pm +++ b/Koha/Acquisition/Order.pm @@ -503,12 +503,13 @@ sub populate_with_prices_for_ordering { my $discount = $self->discount || 0; $discount /= 100 if $discount > 1; + my $unitprice = $self->unitprice // 0; if ( $bookseller->listincgst ) { # The user entered the prices tax included - $self->unitprice( $self->unitprice + 0 ); - $self->unitprice_tax_included( $self->unitprice ); + $self->unitprice($unitprice); + $self->unitprice_tax_included($unitprice); $self->rrp_tax_included( $self->rrp ); # price tax excluded = price tax included / ( 1 + tax rate ) @@ -536,7 +537,7 @@ sub populate_with_prices_for_ordering { } else { # The user entered the prices tax excluded - $self->unitprice_tax_excluded( $self->unitprice ); + $self->unitprice_tax_excluded($unitprice); $self->rrp_tax_excluded( $self->rrp ); # price tax included = price tax excluded * ( 1 - tax rate ) diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t index 309c949ddf..590c8673f2 100755 --- a/t/db_dependent/Budgets.t +++ b/t/db_dependent/Budgets.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 156; +use Test::More tests => 157; +use Test::NoWarnings; use JSON; BEGIN {