summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/part_pkg_taxproduct/cch.html2
-rwxr-xr-xhttemplate/browse/part_pkg_taxproduct/suretax.html36
-rw-r--r--httemplate/edit/log_email.html11
-rw-r--r--httemplate/edit/msgcat.html2
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi9
-rw-r--r--httemplate/edit/process/prospect_main.html11
-rw-r--r--httemplate/edit/process/quick-charge.cgi21
-rw-r--r--httemplate/edit/prospect_main.html1
-rw-r--r--httemplate/edit/quick-charge.html28
-rwxr-xr-xhttemplate/misc/cancel_pkg.html30
-rwxr-xr-xhttemplate/misc/process/cancel_pkg.html10
-rwxr-xr-xhttemplate/search/cust_main.cgi2
-rw-r--r--httemplate/search/log.html8
-rwxr-xr-xhttemplate/view/cust_main.cgi9
-rw-r--r--httemplate/view/cust_main/menu.html9
-rw-r--r--httemplate/view/cust_main/packages/package.html10
-rw-r--r--httemplate/view/cust_main/packages/services.html17
-rwxr-xr-xhttemplate/view/quotation.html10
18 files changed, 169 insertions, 57 deletions
diff --git a/httemplate/browse/part_pkg_taxproduct/cch.html b/httemplate/browse/part_pkg_taxproduct/cch.html
index b901bad9f..1f4f53d5f 100755
--- a/httemplate/browse/part_pkg_taxproduct/cch.html
+++ b/httemplate/browse/part_pkg_taxproduct/cch.html
@@ -97,7 +97,7 @@ $cgi->delete('tax_customer');
if ( $tax_group || $tax_item || $tax_provider || $tax_customer ) {
- push @menubar, 'View all tax products' => $p.'browse/part_pkg_taxproduct.cgi';
+ push @menubar, 'View all tax products' => $p.'browse/part_pkg_taxproduct/cch.html';
}
$cgi->param('dummy', 1);
diff --git a/httemplate/browse/part_pkg_taxproduct/suretax.html b/httemplate/browse/part_pkg_taxproduct/suretax.html
index 667c07ee9..9c00c5c69 100755
--- a/httemplate/browse/part_pkg_taxproduct/suretax.html
+++ b/httemplate/browse/part_pkg_taxproduct/suretax.html
@@ -16,9 +16,6 @@
'nohtmlheader' => 1,
'disable_total' => 1,
&>
-<style>
-input { float: right}
-</style>
<script src="<% $fsurl %>elements/jquery.js"></script>
<script>
var category_labels = <% encode_json(\%category_labels) %>;
@@ -69,20 +66,31 @@ function select_taxproduct(taxproductnum, description) {
}
</script>
-<DIV STYLE="width: 50%">
+<BR>
<FORM NAME="myform">
- <label for="new_taxproduct">New tax product code</label>
- <input type="text" size="6" name="new_taxproduct" id="new_taxproduct">
- <br>
- <label for="new_category_desc">Category</label>
- <input type="text" name="new_category_desc" id="new_category_desc" disabled=1>
- <br>
- <label for="new_taxproduct_desc">Product</label>
- <input type="text" name="new_taxproduct_desc" id="new_taxproduct_desc">
- <br>
+ <FONT SIZE="+1"><B><% emt('Add tax product') %></B></FONT>
+ <% ntable('#cccccc', 2) %>
+ <& /elements/tr-input-text.html,
+ 'label' => emt('Product code'),
+ 'field' => 'new_taxproduct',
+ 'id' => 'new_taxproduct',
+ 'size' => 6,
+ 'maxlength' => 6,
+ &>
+ <& /elements/tr-input-text.html,
+ 'label' => emt('Category'),
+ 'field' => 'new_category_desc',
+ 'id' => 'new_category_desc',
+ 'disabled' => 1
+ &>
+ <& /elements/tr-input-text.html,
+ 'label' => emt('Product'),
+ 'field' => 'new_taxproduct_desc',
+ 'id' => 'new_taxproduct_desc',
+ &>
+ </table>
<input type="button" id="new_taxproduct_submit" disabled=1 value="Add">
</FORM>
-</DIV>
<%shared>
# populate dropdown
diff --git a/httemplate/edit/log_email.html b/httemplate/edit/log_email.html
index 709a24069..0c98046d3 100644
--- a/httemplate/edit/log_email.html
+++ b/httemplate/edit/log_email.html
@@ -8,6 +8,12 @@
'labels' => { '' => '(all)', map { $_ => $_ } @contexts },
'curr_value' => scalar($cgi->param('context')),
},
+ { 'field' => 'context_height',
+ 'type' => 'checkbox',
+ 'postfix' => 'Only match most specific context',
+ 'value' => 1,
+ 'curr_value' => scalar($cgi->param('context_height')),
+ },
{ 'field' => 'min_level',
'type' => 'select',
'options' => [ 0..7 ],
@@ -24,6 +30,7 @@
],
'labels' => {
'context' => 'Context',
+ 'context_height' => '',
'min_level' => 'Min. Level',
'to_addr' => 'To',
'msgnum' => 'Message',
@@ -44,6 +51,10 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]);
my $msgnum = $cgi->param('msgnum');
+
+# XXX This attempt to set a default message isn't working, not sure why
+# $msgnum gets set correctly, but isn't selected in the popup window...fix later
+
unless ($msgnum) {
my ($msg_template) = qsearch('msg_template',{ msgname => 'System log' });
# doesn't seem worth having a config just for the default selected template
diff --git a/httemplate/edit/msgcat.html b/httemplate/edit/msgcat.html
index 4e2edd6d8..5ca118ad7 100644
--- a/httemplate/edit/msgcat.html
+++ b/httemplate/edit/msgcat.html
@@ -3,7 +3,7 @@
table => 'msgcat',
fields => [ { field=>'msgcode', type=>'fixed' },
{ field=>'locale', type=>'fixed' },
- 'msg',
+ { field => 'msg', type => 'text', size => 60 },
],
labels => { 'msgnum' => 'String',
'msgcode' => 'Code',
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index 99c7f90b8..04516e984 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -188,6 +188,15 @@ if ( $cgi->param('residential_commercial') eq 'Residential' ) {
}
+# kind of a hack, but some tax data vendors require a status and others
+# don't.
+my $vendor = $conf->config('tax_data_vendor');
+if ( $vendor eq 'avalara' or $vendor eq 'suretax' ) {
+ if ( ! $cgi->param('taxstatusnum') ) {
+ $error ||= 'Tax status required';
+ }
+}
+
#perhaps this stuff should go to cust_main.pm
if ( $new->custnum eq '' or $duplicate_of ) {
diff --git a/httemplate/edit/process/prospect_main.html b/httemplate/edit/process/prospect_main.html
index 7c8cc276e..b2ae88eba 100644
--- a/httemplate/edit/process/prospect_main.html
+++ b/httemplate/edit/process/prospect_main.html
@@ -1,5 +1,6 @@
<% include('elements/process.html',
'table' => 'prospect_main',
+ 'precheck_callback' => $precheck,
'args_callback' => $args_callback,
'agent_virt' => 1,
'process_o2m' => {
@@ -11,6 +12,16 @@
%>
<%init>
+my $precheck = sub {
+ my $cgi = shift;
+ my $vendor = FS::Conf->new->config('tax_data_vendor');
+ if ( $vendor eq 'avalara' or $vendor eq 'suretax' ) {
+ if ( ! $cgi->param('taxstatusnum') ) {
+ return 'Tax status required';
+ }
+ }
+};
+
my $args_callback = sub {
my( $cgi, $object ) = @_;
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
index 8ee182141..d1b8e1086 100644
--- a/httemplate/edit/process/quick-charge.cgi
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -1,13 +1,4 @@
-% if ( $error ) {
-% $cgi->param('error', $error );
-<% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %>
-% } else {
-<% header(emt($message)) %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY></HTML>
-% }
+<% $cgi->redirect($redirect) %>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -157,4 +148,14 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge
}
+my $redirect;
+if ( $error ) {
+ $cgi->param('error', $error );
+ $redirect = $p.'quick-charge.html?'. $cgi->query_string;
+} elsif ( $quotation ) {
+ $redirect = $fsurl.'view/quotation.html?' . $quotation->quotationnum;
+} else {
+ $redirect = $fsurl.'view/cust_main.cgi?custnum=' . $cust_main->custnum . ';show=last';
+}
+
</%init>
diff --git a/httemplate/edit/prospect_main.html b/httemplate/edit/prospect_main.html
index fb6751532..7c02538f8 100644
--- a/httemplate/edit/prospect_main.html
+++ b/httemplate/edit/prospect_main.html
@@ -50,6 +50,7 @@
},
{ 'field' => 'taxstatusnum',
'type' => 'select-tax_status',
+ 'required' => 1,
'empty_label' => ' ',
},
],
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 14c3f51e6..2bbbe43d8 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -1,4 +1,4 @@
-<& /elements/header-popup.html, mt('One-time charge'), '',
+<& /elements/header.html, mt('One-time charge'), '',
( ($quotationnum || $cgi->param('error')) ? '' : 'onload="addRow()"' ),
&>
@@ -93,6 +93,18 @@ function bill_now_changed (what) {
</SCRIPT>
+<P>
+% if ( $cust_main ) {
+<& /elements/small_custview.html,
+ $cust_main->custnum,
+ scalar($conf->config('countrydefault')),
+ 1, #no balance
+&>
+% } else {
+<& /elements/small_prospect_view.html, $prospect_main &>
+% }
+</P>
+
<FORM ACTION = "process/quick-charge.cgi"
NAME = "QuickChargeForm"
ID = "QuickChargeForm"
@@ -183,7 +195,10 @@ function bill_now_changed (what) {
<& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &>
- <& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum') &>
+ <& /elements/tr-select-taxproduct.html,
+ 'label' => emt('Tax product'),
+ 'curr_value' => $part_pkg->get('taxproductnum')
+ &>
% }
% } else { # new one-time charge
@@ -307,9 +322,14 @@ function bill_now_changed (what) {
<& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass') &>
-<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') &>
+<& /elements/tr-select-taxproduct.html,
+ 'label' => emt('Tax product'),
+ 'curr_value' => $cgi->param('taxproductnum')
+&>
-<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &>
+<& /elements/tr-select-taxoverride.html,
+ 'curr_value' => $cgi->param('tax_override')
+&>
% } # if !$cust_pkg
diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
index c80b2b278..c802897bb 100755
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@ -45,12 +45,38 @@
} &>
<& /elements/tr-checkbox.html,
- 'label' => mt("Uncancel even if a service can't be re-provisioned"),
+ 'label' => mt("Uncancel even if service reprovisioning fails"),
'field' => 'svc_not_fatal',
'value' => 'Y',
&>
% $date_init = 1;
+% my @uncancel_svcs = sort { $b->{'reprovisionable'} <=> $a->{'reprovisionable'} }
+% sort { $a->{'svcpart'} <=> $b->{'svcpart'} }
+% $cust_pkg->uncancel_svc_summary();
+% if (@uncancel_svcs) {
+<TR><TD COLSPAN="2">&nbsp;</TD></TR>
+<TR><TH ALIGN="right"><% emt("Re-provision the following services") %></TH><TD></TD>
+% foreach my $uncancel_svc (@uncancel_svcs) {
+% my $uncancel_curr_value = $uncancel_svc->{'uncancel_svcnum'};
+% my $uncancel_disabled = '';
+% if ($cgi->param('error')) {
+% $uncancel_curr_value = '' unless grep { $_ == $uncancel_svc->{'_uncancel_svcnum'} } $cgi->param('only_svcnum');
+% }
+% unless ($uncancel_svc->{'reprovisionable'}) {
+% $uncancel_curr_value = '';
+% $uncancel_disabled = 1;
+% }
+ <& /elements/tr-checkbox.html,
+ 'label' => $uncancel_svc->{'svc'} . ': ' . $uncancel_svc->{'label'},
+ 'field' => 'only_svcnum',
+ 'value' => $uncancel_svc->{'uncancel_svcnum'},
+ 'curr_value' => $uncancel_curr_value,
+ 'disabled' => $uncancel_disabled,
+ 'cell_style' => 'font-weight: normal;'
+ &>
+% }
+% }
% }
% unless ( $method eq 'resume' || $method eq 'uncancel' ) {
@@ -62,7 +88,7 @@
&>
% }
-% if ( $method eq 'adjourn' || $method eq 'suspend' ) {
+% if (( $method eq 'adjourn' || $method eq 'suspend' ) && $curuser->access_right('Customize billing during suspension')) {
<TR><TD COLSPAN=2>
% if ( $part_pkg->option('suspend_bill', 1) ) {
<& /elements/checkbox.html, name=>'no_suspend_bill', value=>'Y' &>
diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html
index c7a43979d..eb3b2efe6 100755
--- a/httemplate/misc/process/cancel_pkg.html
+++ b/httemplate/misc/process/cancel_pkg.html
@@ -33,8 +33,10 @@ $method =~ /^(cancel|expire|suspend|adjourn|resume|uncancel)$/
$method = $1;
my $past_method = $past{$method};
+my $curuser = $FS::CurrentUser::CurrentUser;
+
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right($right{$method});
+ unless $curuser->access_right($right{$method});
#untaint pkgnum
my $pkgnum = $cgi->param('pkgnum');
@@ -60,7 +62,8 @@ if ( $method eq 'suspend' ) { #or 'adjourn'
$options = { map { $_ => scalar($cgi->param($_)) }
qw( suspend_bill no_suspend_bill )
- };
+ }
+ if $curuser->access_right('Customize billing during suspension');
}
my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} );
@@ -82,6 +85,8 @@ my $bill =
my $svc_fatal = ( $cgi->param('svc_not_fatal') ne 'Y' );
+my $only_svcnum = ($method eq 'uncancel') ? [ $cgi->param('only_svcnum') ] : undef;
+
$error ||= $cust_pkg->$method( 'reason' => $reasonnum,
'date' => $date,
'resume_date' => $resume_date,
@@ -89,6 +94,7 @@ $error ||= $cust_pkg->$method( 'reason' => $reasonnum,
'bill' => $bill,
'svc_fatal' => $svc_fatal,
'options' => $options,
+ 'only_svcnum' => $only_svcnum,
);
if ($error) {
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 62231a120..da6c89d44 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -501,7 +501,7 @@ if ( $cgi->param('browse')
);
}
- @cust_main = grep { $_->num_ncancelled_pkgs || ! $_->num_pkgs } @cust_main
+ @cust_main = grep { $_->status ne 'cancelled' } @cust_main
if ! $cgi->param('cancelled')
&& (
$cgi->param('showcancelledcustomers') eq '0' #see if it was set by me
diff --git a/httemplate/search/log.html b/httemplate/search/log.html
index b607f505d..111200f55 100644
--- a/httemplate/search/log.html
+++ b/httemplate/search/log.html
@@ -101,6 +101,12 @@ a:visited {text-decoration: none}
labels => { map {$_, $_} @contexts },
curr_value => ($cgi->param('context') || ''),
&>
+ <BR><& /elements/checkbox.html,
+ 'field' => 'context_height',
+ 'postfix' => 'Only match most specific context',
+ 'value' => 1,
+ 'curr_value' => scalar($cgi->param('context_height')),
+ &>
</TD>
</TR>
<TR>
@@ -214,7 +220,7 @@ $cgi->param('max_level', 7) unless defined($cgi->param('max_level'));
my %search = ();
$search{'date'} = [ FS::UI::Web::parse_beginning_ending($cgi) ];
$search{'level'} = [ $cgi->param('min_level'), $cgi->param('max_level') ];
-foreach my $param (qw(agentnum context tablename tablenum custnum message)) {
+foreach my $param (qw(agentnum context context_height tablename tablenum custnum message)) {
if ( $cgi->param($param) ) {
$search{$param} = $cgi->param($param);
}
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index fac126f92..c5ee9203c 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -262,6 +262,15 @@ $views{$conf->config('cust_main-custom_title') || emt('Custom')} = 'custom'
my %viewname = reverse %views;
my $view = $cgi->param('show') || $curuser->default_customer_view;
+
+if ($view eq 'last') {
+ # something took us away from the page and is now bouncing back
+ $view = get_page_pref('last_view', $custnum);
+} else {
+ # remember which view is open so we _can_ bounce back
+ set_page_pref('last_view', $custnum, $view);
+}
+
$view = 'basics' if $view eq 'jumbo';
my $ie_compat = $conf->config('ie-compatibility_mode');
diff --git a/httemplate/view/cust_main/menu.html b/httemplate/view/cust_main/menu.html
index ab2d69d34..9e194f42d 100644
--- a/httemplate/view/cust_main/menu.html
+++ b/httemplate/view/cust_main/menu.html
@@ -131,8 +131,6 @@
</style>
-<& /elements/one_time_charge_link.html, form_only=>1 &>
-
<ul id="customer_menu">
% foreach my $submenu (@processed_menu) {
<li>
@@ -358,12 +356,7 @@ my @menu = (
{
# it's just a popup, but there's some freaky CCH tax stuff in it
label => 'One-time charge',
- content => sub {
- include( '/elements/one_time_charge_link.html',
- custnum => shift->custnum,
- no_form => 1,
- );
- },
+ url => "edit/quick-charge.html?custnum=$custnum",
acl => 'One-time charge',
},
{
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index e167e2625..0a5305ed5 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -350,14 +350,8 @@ sub pkg_change_link {
sub onetime_change_link {
my $cust_pkg = shift;
my $pkgnum = $cust_pkg->pkgnum;
- include( '/elements/popup_link-cust_pkg.html',
- 'action' => $p. "edit/quick-charge.html?change_pkgnum=$pkgnum",
- 'label' => emt('Modify one-time charge'),
- 'actionlabel' => emt('Modify'),
- 'cust_pkg' => $cust_pkg,
- 'width' => 690,
- 'height' => 440,
- );
+ '<A HREF="' . $fsurl . "edit/quick-charge.html?change_pkgnum=$pkgnum" .
+ '">' . emt('Modify one-time charge') . '</A>'
}
sub pkg_change_location_link {
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index 39055f49a..352f5ea9d 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -105,9 +105,22 @@ function clearhint_search_cust_svc(obj, str) {
</TD>
</TR>
-% }
+% }
+
+% } #foreach part_svc
+
+% if ($cust_pkg->get('cancel')) {
+% foreach my $svc (sort { $a->{'svcpart'} <=> $b->{'svcpart'} }
+% $cust_pkg->uncancel_svc_summary('summarize_size' => $opt{'cust_pkg-large_pkg_size'})
+% ) {
+% next unless $svc->{'reprovisionable'};
+ <TR>
+ <TD ALIGN="right" VALIGN="top"><% $svc->{'svc'} |h %></TD>
+ <TD STYLE="padding-bottom:0px; font-style: italic"><% $svc->{'label'} |h %></TD>
+ </TR>
+% }
+% }
-% }
</TABLE>
</TD>
diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html
index 5646fb973..7221d53cd 100755
--- a/httemplate/view/quotation.html
+++ b/httemplate/view/quotation.html
@@ -23,9 +23,13 @@ function areyousure(href, message) {
% if ( $curuser->access_right('One-time charge') ) {
<% $inrow ? ' | ' : '' %>
- <& /elements/one_time_charge_link.html,
- map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
- &>
+% my $query = 'quotationnum=' . $quotation->get('quotationnum');
+% if ($quotation->custnum) {
+% $query .= ';custnum=' . $quotation->custnum;
+% } else {
+% $query .= ';prospectnum=' . $quotation->prospectnum;
+% }
+ <A HREF="<% $fsurl . 'edit/quick-charge.html?' . $query %>"><% emt('One-time charge') %></A>
% $inrow++;
% }