From 03fc4f3173a9442c1aaf91431ad481565b2b4420 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Mon, 10 Jul 2017 16:27:59 +0100 Subject: [PATCH] Bug 18267 Add tests for all price methods Add test for price_gross in addition to price_net in Invoices Test price_info and price_info_inclusive in quotes NB test is that price_info_inclusive returns undef which we expect to be the normal condition Signed-off-by: Kyle M Hall --- t/EdiInvoice.t | 6 +++++- t/Edifact.t | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/t/EdiInvoice.t b/t/EdiInvoice.t index 6ed0dbb..877ce5a 100755 --- a/t/EdiInvoice.t +++ b/t/EdiInvoice.t @@ -3,7 +3,7 @@ use strict; use warnings; use FindBin qw( $Bin ); -use Test::More tests => 20; +use Test::More tests => 21; BEGIN { use_ok('Koha::Edifact') } @@ -70,6 +70,10 @@ my $lineprice = $lines->[7]->price_net; is( $lineprice, 4.55, 'correct net line price returned' ); +my $lineprice = $lines->[7]->price_gross; + +is( $lineprice, 7.99, 'correct gross line price returned' ); + my $tax = $lines->[7]->tax; is( $tax, 0, 'correct tax amount returned' ); diff --git a/t/Edifact.t b/t/Edifact.t index cc20539..8c82b73 100755 --- a/t/Edifact.t +++ b/t/Edifact.t @@ -3,7 +3,7 @@ use strict; use warnings; use FindBin qw( $Bin ); -use Test::More tests => 34; +use Test::More tests => 36; BEGIN { use_ok('Koha::Edifact') } @@ -51,6 +51,8 @@ my $test_line = $lin->[-1]; is( $test_line->line_item_number, 18, 'correct line number returned' ); is( $test_line->item_number_id, '9780273761006', 'correct ean returned' ); is( $test_line->quantity, 1, 'quantity returned' ); +is( $test_line->price_info, 114.97, 'price returned' ); +is( $test_line->price_info_inclusive, undef, 'discounted price undefined as expected' ); my $test_title = 'International business [electronic resource]'; my $marcrec = $test_line->marc_record; -- 2.10.2