From 4104f4e3d1b387296b16b4a035b4b7f42e0c5977 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 1 Apr 2008 00:54:44 +0000 Subject: checkpoint of new tax rating system --- httemplate/edit/part_pkg.cgi | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index b1851a7ba..84f7498e1 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -3,6 +3,11 @@ )) %> % #), ' onLoad="visualize()"'); + + + + + <% include('/elements/error.html') %>
@@ -81,6 +86,34 @@ Tax information % } +% if ( $conf->exists('enable_taxproducts') ) { + + + <% ntable("#cccccc", 2) %> + + Tax product + + + + + + + + + + <% $tax_override ? 'Edit tax overrides' : 'Override taxes' %> + + + + + + +% } else { + + + +% } +
@@ -234,7 +267,7 @@ Line-item revenue recognition %#} else { %# push @fixups, 'taxclass'; #hidden %#} -%my @form_elements = ( 'classnum', 'taxclass', 'agent_type' ); +%my @form_elements = ( 'classnum', 'taxclass', 'agent_type', 'tax_override' ); % %my @form_radio = ( 'pkg_svc_primary' ); % @@ -252,6 +285,7 @@ Line-item revenue recognition % 'form_elements' => \@form_elements, % 'form_text' => [ qw(pkg comment promo_code clone pkgnum pkgpart), % qw(pay_weight credit_weight), #keys(%weight), +% qw(taxproductnum), % @fixups, % ], % 'form_checkbox' => [ qw(setuptax recurtax disabled) ], @@ -409,12 +443,14 @@ my ($query) = $cgi->keywords; my $conf = new FS::Conf; my $part_pkg = ''; my @agent_type = (); +my $tax_override; my @all_agent_types = map {$_->typenum} qsearch('agent_type',{}); if ( $cgi->param('error') ) { $part_pkg = new FS::part_pkg ( { map { $_, scalar($cgi->param($_)) } fields('part_pkg') } ); (@agent_type) = $cgi->param('agent_type'); + $tax_override = $cgi->param('tax_override'); } my $action = ''; @@ -430,6 +466,9 @@ if ( $cgi->param('clone') ) { } elsif ( $query && $query =~ /^(\d+)$/ ) { (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{'pkgpart'=>$1}) unless $part_pkg; + $tax_override = + join (",", map {$_->taxnum} qsearch('part_pkg_taxoverride',{'pkgpart'=>$1})) + unless $part_pkg; $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); $pkgpart = $part_pkg->pkgpart; } else { @@ -447,5 +486,6 @@ unless ( $part_pkg->plan ) { #backwards-compat } $action ||= $part_pkg->pkgpart ? 'Edit' : 'Add'; my $hashref = $part_pkg->hashref; +my $taxproduct_description = $part_pkg->taxproduct_description; -- cgit v1.2.1