From 24c164b829dce551badd130dba51b011342676f2 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 7 Sep 2016 21:36:07 -0500 Subject: RT#72157: Monthly recurring field is missing --- .../misc/xmlhttp-cust_main-display_recurring.html | 29 +++++++++++ httemplate/view/cust_main/billing.html | 57 +++++++++++++++++----- 2 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 httemplate/misc/xmlhttp-cust_main-display_recurring.html diff --git a/httemplate/misc/xmlhttp-cust_main-display_recurring.html b/httemplate/misc/xmlhttp-cust_main-display_recurring.html new file mode 100644 index 000000000..dd9ed3bb5 --- /dev/null +++ b/httemplate/misc/xmlhttp-cust_main-display_recurring.html @@ -0,0 +1,29 @@ +<% encode_json($return) %>\ +<%init> + +my %arg = $cgi->param('arg'); +my $custnum = delete($arg{'custnum'}); + +my $error; +my $return; + +$error = "No customer specified" unless $custnum =~ /^\d+$/; + +my $curuser = $FS::CurrentUser::CurrentUser; + +$error = "access denied" + unless $error or $curuser->access_right('View customer'); + +my $cust_main; +$cust_main = qsearchs( { + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $custnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}) unless $error; +$error = "Customer not found!" unless $error or $cust_main; + +$return = $error + ? { 'error' => $error } + : { 'display_recurring' => [ $cust_main->display_recurring ] }; + + diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 894b2dfc0..a94b5c15a 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -21,18 +21,51 @@ <% $balance %> -% #54: just an arbitrary number i pulled out of my goober. ideally we'd like -% # to consider e.g. a histogram of num_ncancelled_packages for the entire -% # customer base, and compare it to a graph of the overhead for generating this -% # information. (and optimize it better, we could get it more from SQL) -% if ( $cust_main->num_ncancelled_pkgs < 54 ) { -% foreach my $freq_info ($cust_main->display_recurring) { - - <% emt( ucfirst($freq_info->{'freq_pretty'}). ' recurring' ) %> - <% $money_char. sprintf('%.2f', $freq_info->{'amount'}) %> - -% } -% } + + <% emt( 'Recurring' ) %> + + + +<& '/elements/xmlhttp.html', + 'url' => $fsurl.'misc/xmlhttp-cust_main-display_recurring.html', + 'subs' => [ 'get_display_recurring'] &> + + % if ( $conf->exists('cust_main-select-prorate_day') ) { -- cgit v1.2.1 From 6df492990ea195513430f3a56d537e57e50b6913 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Thu, 8 Sep 2016 00:14:03 -0500 Subject: 72393: High-priority: Tags history --- httemplate/elements/change_history_common.html | 7 +++++++ httemplate/view/cust_main/change_history.html | 1 + 2 files changed, 8 insertions(+) diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index e228e6555..5aaf6e691 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -197,6 +197,12 @@ my $svc_labelsub = sub { $label. ': '. encode_entities($item->label($item->history_date)). ''; }; +my $tag_labelsub = sub { + my($item, $label) = @_; + my $part_tag = qsearchs('part_tag',{ tagnum => $item->tagnum }); + $label. ': '. encode_entities($part_tag->tagname). ''; +}; + my %h_table_labelsub = ( 'h_cust_pkg' => $pkg_labelsub, 'h_svc_acct' => $svc_labelsub, @@ -208,6 +214,7 @@ my %h_table_labelsub = ( 'h_svc_external' => $svc_labelsub, 'h_svc_phone' => $svc_labelsub, #'h_phone_device' + 'h_cust_tag' => $tag_labelsub, ); my $discounts = {}; diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html index d46a4ffde..a781c7372 100644 --- a/httemplate/view/cust_main/change_history.html +++ b/httemplate/view/cust_main/change_history.html @@ -46,6 +46,7 @@ tie my %tables, 'Tie::IxHash', 'phone_device' => 'Phone device', 'cust_pkg_discount' => 'Discount', #? it gets provisioned anyway 'phone_avail' => 'Phone', + 'cust_tag' => 'Tag', ; my $pkg_join = "JOIN cust_pkg USING ( pkgnum )"; -- cgit v1.2.1