X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=7c053dcfb6dea8006a657fbbaaa3b0d510977220;hb=068d47b904109160356cc3307a8f469a5eb77116;hp=4c4be23c015c07833eaa1fa77005944414f397e8;hpb=a67fd3bbfeec137ebf494e36eaa920145b8509a1;p=freeside.git diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 4c4be23c0..7c053dcfb 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -96,6 +96,14 @@ return true; } + function payauto_changed(payauto_field){ + var f = (payauto_field.name == 'CARD_payauto') ? 'card_billday' : 'chek_billday'; + f = document.getElementById(f); + if ( f == null) return; + if(payauto_field.checked) f.style.display = 'inline'; + else f.style.display = 'none'; + } + <% include('/elements/init_overlib.html') %> @@ -112,6 +120,27 @@ % $text_disabled = 'style="color: #000000";' % } % +% my $disable_payauto = $conf->exists('disable_payauto_default'); +% my $CARD_payauto_checked = $payby eq 'DCRD' ? '' +% : $payby eq 'CARD' ? 'CHECKED' +% : $disable_payauto ? '' : 'CHECKED'; +% my $CHEK_payauto_checked = $payby eq 'DCHK' ? '' +% : $payby eq 'CHEK' ? 'CHECKED' +% : $disable_payauto ? '' : 'CHECKED'; +% +% sub billday_options { +% my $curr_value = shift; +% my $ret = ''; +% for my $billday ( 1 .. 28 ) { +% my $sel = ''; +% $sel = "SELECTED='SELECTED'" if $curr_value == $billday; +% $ret .= ""; +% } +% $ret; +% } +% my $billday_card_display = $payby eq 'CARD' ? 'inline' : 'none'; +% my $billday_chek_display = $payby eq 'CHEK' ? 'inline' : 'none'; +% % my %payby = ( % % 'CARD' => @@ -163,7 +192,14 @@ % qq!${r}Exact name on card !. % qq!!. % -% qq! Charge future payments to this card automatically'. +% qq! Charge future payments to this card automatically!. +% +% ( $conf->exists('cust_main-select-billday') ? +% qq! +% Charge on the day of each month! +% : '' +% ). % % '', % @@ -201,7 +237,14 @@ % ). % % -% qq! Charge future payments to this electronic check automatically'. +% qq! Charge future payments to this electronic check automatically!. +% +% ( $conf->exists('cust_main-select-billday') ? +% qq! +% Charge on the day of each month! +% : '' +% ). % % ' '. % ' '. @@ -240,7 +283,7 @@ % qq!!. % % qq!Attention !. -% qq!!. +% qq!!. % % ' '. % ' '. @@ -411,14 +454,23 @@ Invoice terms - + <% include('/elements/select-terms.html', + 'curr_value' => $cust_main->invoice_terms, + ) + %> + + + + + Credit limit + + + credit_limit) %><% length($cust_main->credit_limit) ? '' : ' DISABLED' %>> + credit_limit) ? '' : ' CHECKED'%>> Unlimited @@ -432,12 +484,32 @@ % if ( $conf->exists('voip-cust_cdr_squelch') ) { - squelch_cdr eq "Y" ? 'CHECKED' : '' %>> Omit CDRs from invoices + squelch_cdr eq "Y" ? 'CHECKED' : '' %>> Omit CDRs from printed invoices % } else { % } +% if ( $conf->exists('voip-cust_email_csv_cdr') ) { + + email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> Attach CDRs as CSV to emailed invoices + +% } else { + +% } + +% if ( $conf->exists('voip-cust_accountcode_cdr') ) { + + + accountcode_cdr eq "Y" ? 'CHECKED' : '' %> + > Breakdown CDRs by accountcode + +% } else { + +% } % if ( $show_term || $cust_main->cdr_termination_percentage ) { @@ -477,10 +549,13 @@ my @payby = grep /\w/, $conf->config('payby'); @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) unless @payby; -#false laziness w/view/cust_main/billing.html -my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1"; -my $term_sth = dbh->prepare($term_sql) or die dbh->errstr; -$term_sth->execute($cust_main->custnum) or die $term_sth->errstr; -my $show_term = $term_sth->fetchrow_arrayref->[0]; +my $show_term = ''; +if ( $cust_main->custnum ) { + #false laziness w/view/cust_main/billing.html + my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1"; + my $term_sth = dbh->prepare($term_sql) or die dbh->errstr; + $term_sth->execute($cust_main->custnum) or die $term_sth->errstr; + $show_term = $term_sth->fetchrow_arrayref->[0]; +}