From f7bbdd4976f138e60939b30b7c23815c3cd11a86 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 11 Jun 2026 16:39:39 +0100 Subject: [PATCH] Bug 12278: Add unit tests Signed-off-by: Coleen Lilly Signed-off-by: Andrew Fuerste Henry Sponsored-by: Anne Arundel County Public Library Signed-off-by: Pedro Amorim --- t/db_dependent/Acquisition/Invoices.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/db_dependent/Acquisition/Invoices.t b/t/db_dependent/Acquisition/Invoices.t index 0c130d94ea..42408fd047 100755 --- a/t/db_dependent/Acquisition/Invoices.t +++ b/t/db_dependent/Acquisition/Invoices.t @@ -186,6 +186,18 @@ is( $invoices[1]->{invoicenumber}, 'invoice2', 'GetInvoices() to search by only is( scalar @invoices, 1, 'GetInvoices() to filter by closedate' ); is( $invoices[0]->{invoicenumber}, 'invoice_close', 'GetInvoices() to filter by closedate' ); +subtest 'GetInvoices() returns financial totals' => sub { + plan tests => 4; + + my @inv = GetInvoices( invoicenumber => 'invoice2' ); + my $inv2 = $inv[0]; + + ok( exists $inv2->{total_tax_excluded}, 'GetInvoices returns total_tax_excluded' ); + ok( exists $inv2->{total_tax_included}, 'GetInvoices returns total_tax_included' ); + ok( exists $inv2->{total_adj}, 'GetInvoices returns total_adj' ); + cmp_ok( $inv2->{total_tax_included}, '>=', 0, 'total_tax_included is non-negative' ); +}; + my $invoicesummary1 = GetInvoice($invoiceid1); is( $invoicesummary1->{'invoicenumber'}, 'invoice1', 'GetInvoice retrieves correct invoice' ); is(