diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-10-03 21:25:42 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-10-03 21:25:42 -0500 |
commit | a181b24a0050bfca2ec220421f4cbc347533119f (patch) | |
tree | 0d4a23a4c2f76046dac065319e1d0399b5ae63f3 /httemplate | |
parent | 29ed5abdfcc723bf8a3c29a0ae71775a07477033 (diff) |
72157: Monthly recurring field is missing [ajax only for cust with many packages]
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/view/cust_main/billing.html | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index a94b5c15a..7ee05a357 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -31,8 +31,7 @@ 'subs' => [ 'get_display_recurring'] &> <SCRIPT> -<&| /elements/onload.js &> -get_display_recurring('custnum',<% $cust_main->custnum %>, function (xmlresult) { +function set_display_recurring (xmlresult) { var recurring = JSON.parse(xmlresult); var rlabel = document.getElementById('recurring_label'); var rvalue = document.getElementById('recurring_value'); @@ -63,10 +62,23 @@ get_display_recurring('custnum',<% $cust_main->custnum %>, function (xmlresult) } else { rrow.parentNode.removeChild(rrow); } -}); -</&> +} </SCRIPT> +% # 10 is an arbitrary number, use ajax for customers with many packages +% if ( $cust_main->num_billing_pkgs > 10 ) { +<& '/elements/xmlhttp.html', + 'url' => $fsurl.'misc/xmlhttp-cust_main-display_recurring.html', + 'subs' => [ 'get_display_recurring'] &> +<SCRIPT> +get_display_recurring('custnum',<% $cust_main->custnum %>,set_display_recurring); +</SCRIPT> +% } else { +<SCRIPT> +set_display_recurring(<% encode_json({'display_recurring' => [ $cust_main->display_recurring ]}) |js_string %>); +</SCRIPT> +% } + % if ( $conf->exists('cust_main-select-prorate_day') ) { <TR> <TH ALIGN="right"><% mt('Prorate day of month') |h %></TH> |