summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-05-30 15:12:07 -0700
committerMark Wells <mark@freeside.biz>2015-05-30 15:12:07 -0700
commit817c1ce0e1cbcfd1f684222c66f46dd13b2d6dd7 (patch)
tree25fd80fae19bbe1b4ec2c892a35a631cf232d590 /httemplate/elements
parent3846acae1c2a7ecb275e400cf3802ada6bc89ed2 (diff)
SureTax, #31639, #33015, #34598
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/menu.html8
-rw-r--r--httemplate/elements/select-taxproduct.html2
-rw-r--r--httemplate/elements/tr-part_pkg-taxproducts.html34
-rw-r--r--httemplate/elements/tr-select-tax_status.html2
-rw-r--r--httemplate/elements/tr-select-taxproduct.html2
5 files changed, 41 insertions, 7 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 9c9b2de64..7d34d427e 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -375,7 +375,7 @@ if( $curuser->access_right('Financial reports') ) {
$report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ];
$report_financial{'Prepaid Income'} = [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ];
- my $taxproducts = $conf->exists('enable_taxproducts');
+ my $taxproducts = $conf->config('tax_data_vendor');
$report_financial{'Tax Liability'. ($taxproducts ? ' (internal tax data)' : '')} = [ $fsurl.'search/report_tax.html', 'Tax liability report (internal tax data)' ];
$report_financial{'Tax Liability (vendor tax data)'} = [ $fsurl.'search/report_newtax.html', 'Tax liability report (vendor tax data)' ]
if $taxproducts;
@@ -458,7 +458,7 @@ tie my %tools_importing, 'Tie::IxHash',
'Phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ],
'Call Detail Records (CDRs)' => [ $fsurl.'misc/cdr-import.html', '' ],
;
-if ( $conf->exists('enable_taxproducts') ) {
+if ( $conf->config('tax_data_vendor') eq 'cch' ) {
if ( $conf->exists('taxdatadirectdownload') ) {
$tools_importing{'Tax rates from vendor site'} =
[ $fsurl.'misc/tax-fetch_and_import.cgi', '' ];
@@ -680,13 +680,13 @@ if ( $curuser->access_right('Configuration') ) {
$config_billing{'separator2'} = ''; #its a separator!
my $config_taxes_name = 'Locales and tax rates'.
- ( $conf->exists('enable_taxproducts')
+ ( $conf->config('tax_data_vendor')
? ' (internal tax class system)'
: ''
);
$config_billing{$config_taxes_name} = [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ];
$config_billing{'Tax rates (vendor data tax products system)'} = [ $fsurl.'browse/tax_rate.cgi', 'Edit tax rates for the vendor data tax products system' ]
- if $conf->exists('enable_taxproducts');
+ if $conf->config('tax_data_vendor');
$config_billing{'Tax classes'} = [ $fsurl. 'browse/part_pkg_taxclass.html', 'Tax classes' ];
if ( $conf->config('currencies') ) {
diff --git a/httemplate/elements/select-taxproduct.html b/httemplate/elements/select-taxproduct.html
index 07e554927..5feb71d80 100644
--- a/httemplate/elements/select-taxproduct.html
+++ b/httemplate/elements/select-taxproduct.html
@@ -24,7 +24,7 @@ unless ( $description || ! $value ) {
}
my $conf = FS::Conf->new;
-my $vendor = lc($conf->config('enable_taxproducts'));
+my $vendor = lc($conf->config('tax_data_vendor'));
my $onclick = $opt{onclick} ||
"overlib( OLiframeContent('${p}/browse/part_pkg_taxproduct/$vendor.html?_type=select&id=${name}&taxproductnum='+document.getElementById('${name}').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;";
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>
diff --git a/httemplate/elements/tr-select-tax_status.html b/httemplate/elements/tr-select-tax_status.html
index 9c2de154f..1e0ea8a98 100644
--- a/httemplate/elements/tr-select-tax_status.html
+++ b/httemplate/elements/tr-select-tax_status.html
@@ -17,7 +17,7 @@
<%shared>
my $conf = FS::Conf->new;
-my $vendor = $conf->config('enable_taxproducts');
+my $vendor = $conf->config('tax_data_vendor');
</%shared>
<%init>
my %opt = @_;
diff --git a/httemplate/elements/tr-select-taxproduct.html b/httemplate/elements/tr-select-taxproduct.html
index 759d0c01c..547f06626 100644
--- a/httemplate/elements/tr-select-taxproduct.html
+++ b/httemplate/elements/tr-select-taxproduct.html
@@ -1,4 +1,4 @@
-% if ( $conf->exists('enable_taxproducts') ) {
+% if ( $conf->config('tax_data_vendor') ) { # still not quite right
<%include('tr-td-label.html', @_) %>
<TD <% $cell_style %>><% include('select-taxproduct.html', @_) %></TD>
</TR>