[Koha-patches] [PATCH] wr69607 - fixed conditions for display of tax details
Chris Cormack
chrisc at catalyst.net.nz
Tue Apr 20 00:17:32 CEST 2010
From: Robin Sheat <robin at catalyst.net.nz>
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.
---
acqui/supplier.pl | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/acqui/supplier.pl b/acqui/supplier.pl
index e2d0a73..c3a5db4 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 => "<option value=\"$currencies[$i]->{'currency'}\">$currencies[$i]->{'currency'}</option>"};
}
}
- my $GST = $booksellers[0]->{'gstrate'} || C4::Context->preference("gist");
- $GST *= 100;
$template->param(
id => $id,
name => $booksellers[0]->{'name'},
--
1.6.3.3
More information about the Koha-patches
mailing list