summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg_taxclass.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-11-07 16:24:16 -0800
committerMark Wells <mark@freeside.biz>2016-11-07 16:25:48 -0800
commit863c878cadb95fcad0603f66298473841340926b (patch)
treed310dd9fc5c81a4ed394a28cc8ebb34586af1526 /FS/FS/part_pkg_taxclass.pm
parent33235cef6314b6a79e1e91829bdae6e4e391720f (diff)
revise process for updating WA sales taxes, #73185 and #73226
Conflicts: FS/FS/Conf.pm
Diffstat (limited to 'FS/FS/part_pkg_taxclass.pm')
-rw-r--r--FS/FS/part_pkg_taxclass.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/FS/FS/part_pkg_taxclass.pm b/FS/FS/part_pkg_taxclass.pm
index 055c778..d8ddb15 100644
--- a/FS/FS/part_pkg_taxclass.pm
+++ b/FS/FS/part_pkg_taxclass.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw( @ISA );
use Scalar::Util qw( blessed );
use FS::UID qw( dbh );
-use FS::Record; # qw( qsearch qsearchs );
+use FS::Record qw(qsearch); # qsearchs );
use FS::cust_main_county;
@ISA = qw(FS::Record);
@@ -219,6 +219,26 @@ sub _upgrade_data { # class method
}
+=head1 CLASS METHODS
+
+=over 4
+
+=item taxclass_names
+
+Returns a list of all the non-disabled tax classes. If tax classes aren't
+enabled, returns a single empty string.
+
+=cut
+
+sub taxclass_names {
+ if ( FS::Conf->new->exists('enable_taxclasses') ) {
+ return map { $_->get('taxclass') }
+ qsearch('part_pkg_taxclass', { disabled => '' });
+ } else {
+ return ( '' );
+ }
+}
+
=head1 BUGS
Other tables (cust_main_county, part_pkg, agent_payment_gateway) have a text