Bug 15741: (regression tests) Rounding is not calculated correctly
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
parent
541a03cf6d
commit
f1e1eaa328
1 changed files with 30 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
use Modern::Perl;
|
||||
|
||||
use Test::More tests => 58;
|
||||
use Test::More tests => 59;
|
||||
use Test::MockModule;
|
||||
use Data::Dumper;
|
||||
use C4::Context;
|
||||
|
@ -245,6 +245,35 @@ ok( $borrower->{userid}, 'A userid should have been generated correctly' );
|
|||
is( Check_Userid( C4::Context->config('user'), '' ), 0,
|
||||
'Check_Userid should return 0 for the DB user (Bug 12226)');
|
||||
|
||||
subtest 'GetMemberAccountRecords' => sub {
|
||||
|
||||
plan tests => 2;
|
||||
|
||||
my $borrowernumber = $builder->build({ source => 'Borrower' })->{ borrowernumber };
|
||||
my $accountline_1 = $builder->build({
|
||||
source => 'Accountline',
|
||||
value => {
|
||||
borrowernumber => $borrowernumber,
|
||||
amountoutstanding => 64.60
|
||||
}
|
||||
});
|
||||
|
||||
my ($total,undef,undef) = GetMemberAccountRecords( $borrowernumber );
|
||||
is( $total , 64.60, "Rounding works correctly in total calculation (single value)" );
|
||||
|
||||
my $accountline_2 = $builder->build({
|
||||
source => 'Accountline',
|
||||
value => {
|
||||
borrowernumber => $borrowernumber,
|
||||
amountoutstanding => 10.65
|
||||
}
|
||||
});
|
||||
|
||||
($total,undef,undef) = GetMemberAccountRecords( $borrowernumber );
|
||||
is( $total , 75.25, "Rounding works correctly in total calculation (multiple values)" );
|
||||
|
||||
};
|
||||
|
||||
subtest 'GetMemberAccountBalance' => sub {
|
||||
|
||||
plan tests => 10;
|
||||
|
|
Loading…
Reference in a new issue