From 32f058aaee6fafc787527bed925b11d4ac6653f6 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Tue, 20 Apr 2010 10:17:32 +1200 Subject: [PATCH] wr69607 - fixed conditions for display of tax details Previously, if the tax rate for a particular seller was '0.000' it couldn't be edited. Now, the tax information always is shown if there is a default system one, or one for that seller. Signed-off-by: Galen Charlton --- acqui/supplier.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/acqui/supplier.pl b/acqui/supplier.pl index e2d0a734c2..c3a5db428e 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -41,6 +41,7 @@ To know the bookseller this script has to display details. =cut use strict; +use warnings; use C4::Auth; use C4::Acquisition; use C4::Contract; @@ -66,7 +67,10 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( debug => 1, } ); -my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist"); +my $seller_gstrate = $booksellers[0]->{'gstrate'}; +# A perl-ism: '0'==false, '0.000'==true, but 0=='0.000' - this accounts for that +undef $seller_gstrate if ($seller_gstrate == 0); +my $GST = $seller_gstrate || C4::Context->preference("gist"); $GST *= 100; my @contracts = GetContracts($id); @@ -139,8 +143,6 @@ elsif ($op eq 'delete') { push @loop_invoicecurrency, { currency => ""}; } } - my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist"); - $GST *= 100; $template->param( id => $id, name => $booksellers[0]->{'name'}, -- 2.20.1