Bug 40371: Remove warnings from Budgets.t output
t/db_dependent/Budgets.t .. 153/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 154/156 Use of uninitialized value in multiplication (*) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 543.
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 554.
t/db_dependent/Budgets.t .. 155/156 Use of uninitialized value in addition (+) at /kohadevbox/koha/Koha/Acquisition/Order.pm line 510.
This change seems correct, but I am not 100% sure it won't introduce a
regression. What about 0 vs undef?
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 15a8f0444d)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
35267ecfa8
commit
e5eba4f13f
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue