diff options
| author | Mark Wells <mark@freeside.biz> | 2015-05-30 15:12:07 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-05-30 15:12:07 -0700 |
| commit | 817c1ce0e1cbcfd1f684222c66f46dd13b2d6dd7 (patch) | |
| tree | 25fd80fae19bbe1b4ec2c892a35a631cf232d590 /httemplate/elements/tr-part_pkg-taxproducts.html | |
| parent | 3846acae1c2a7ecb275e400cf3802ada6bc89ed2 (diff) | |
SureTax, #31639, #33015, #34598
Diffstat (limited to 'httemplate/elements/tr-part_pkg-taxproducts.html')
| -rw-r--r-- | httemplate/elements/tr-part_pkg-taxproducts.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/httemplate/elements/tr-part_pkg-taxproducts.html b/httemplate/elements/tr-part_pkg-taxproducts.html new file mode 100644 index 000000000..274dc3b48 --- /dev/null +++ b/httemplate/elements/tr-part_pkg-taxproducts.html @@ -0,0 +1,34 @@ +<TR> + <TH COLSPAN=2>Tax products</TH> +</TR> +% foreach my $usage_class (@classes) { +% my $classnum = $usage_class->classnum; +% my $curr_value = +% $cgi->param("usage_taxproductnum_$classnum") +% || $pkg_options{"usage_taxproductnum_$classnum"} +% || ''; +<TR> + <TD><% $usage_class->classname %></TD> + <TD><& select-taxproduct.html, + %opt, + 'field' => $field.'_'.$classnum, + 'curr_value' => $curr_value + &> + </TD> +</TR> +% } +<%init> +my %opt = @_; +my $field = delete($opt{field}) || 'taxproductnum'; +my $pkgpart = delete($opt{pkgpart}); +my $part_pkg = FS::part_pkg->by_key($pkgpart); +my %pkg_options = $part_pkg->options; +$pkg_options{'usage_taxproductnum_'} = $part_pkg->taxproductnum; + +my @classes = qsearch('usage_class', { 'disabled' => '' }); +unshift @classes, + FS::usage_class->new({ 'classnum' => '', 'classname' => '(default)', }), + FS::usage_class->new({ 'classnum' => 'setup', 'classname' => 'Setup', }), + FS::usage_class->new({ 'classnum' => 'recur', 'classname' => 'Recur', }), +; +</%init> |
