From 7a97ed31c38e975c6548083039ff2ce31c6d8cf3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 7 Oct 2005 02:25:41 +0000 Subject: add require_taxclasses config flag --- FS/FS/Conf.pm | 7 +++++++ FS/FS/part_pkg.pm | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'FS') diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 0bf1afeeb..30aa1e7ab 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1257,6 +1257,13 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'require_taxclasses', + 'section' => 'billing', + 'description' => 'Require a taxclass to be entered for every package', + 'type' => 'checkbox', + }, + { 'key' => 'welcome_email', 'section' => '', diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index db31e456f..73f3bae04 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -441,6 +441,10 @@ sub check { return 'Unknown plan '. $self->plan unless exists($plans{$self->plan}); + my $conf = new FS::Conf; + return 'Taxclass is required' + if ! $self->taxclass && $conf->exists('require_taxclasses'); + ''; } -- cgit v1.2.1