summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorjeff <jeff>2008-08-28 07:38:40 +0000
committerjeff <jeff>2008-08-28 07:38:40 +0000
commit669bd6b315633c99ac61441198c2c4e45401c36b (patch)
treeaf72b9ad7bf116b147700f63f5b2895b0c9c9e5b /httemplate/edit/process
parent2c37cd91ea7951b70ea5d420e989128d78ce0a80 (diff)
multiple usage classes checkpoint
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi23
1 files changed, 23 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index 91ae97132..d338b8299 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -84,6 +84,13 @@ my $args_callback = sub {
}
@options;
+ foreach ( split(',', $cgi->param('taxproductnums') ) ) {
+ my $value = $cgi->param("taxproductnum_$_");
+ $error ||= "Illegal taxproductnum_$_: $value"
+ unless ( $value =~ /^\d*$/ );
+ $options{"usage_taxproductnum_$_"} = $value;
+ }
+
$options{$_} = scalar( $cgi->param($_) )
for (qw( setup_fee recur_fee ));
@@ -146,6 +153,22 @@ my @process_m2m = (
},
);
+foreach my $override_class ($cgi->param) {
+ next unless $override_class =~ /^tax_override_(\w+)$/;
+ my $class = $1;
+
+ my (@tax_overrides) = (grep "$_", split (",", $1))
+ if $cgi->param($override_class) =~ /^([\d,]+)$/;
+
+ push @process_m2m, {
+ 'link_table' => 'part_pkg_taxoverride',
+ 'target_table' => 'tax_class',
+ 'hashref' => { 'usage_class' => $class },
+ 'params' => \@tax_overrides,
+ };
+
+}
+
my $conf = new FS::Conf;
if ( $cgi->param('pkgpart') || ! $conf->exists('agent_defaultpkg') ) {