<TR>
<TD ALIGN="right" WIDTH="200">Invoice terms </TD>
<TD WIDTH="408">
- <SELECT NAME="invoice_terms">
- <OPTION VALUE="">Default (<% $conf->config('invoice_default_terms') || 'Payable upon receipt' %>)
-% foreach my $term ( 'Payable upon receipt',
-% ( map "Net $_", 0, 10, 15, 20, 30, 45, 60 ),
-% ) {
- <OPTION VALUE="<% $term %>" <% $cust_main->invoice_terms eq $term ? ' SELECTED' : '' %>><% $term %>
-% }
- </SELECT>
+ <% include('/elements/select-terms.html',
+ 'curr_value' => $cust_main->invoice_terms,
+ )
+ %>
</TD>
</TR>
<INPUT TYPE="hidden" NAME="squelch_cdr" VALUE="<% $cust_main->squelch_cdr %>">
% }
+% if ( $conf->exists('voip-cust_email_csv_cdr') ) {
+ <TR>
+ <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="email_csv_cdr" VALUE="Y" <% $cust_main->email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> Attach CDRs as CSV to emailed invoices</TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="email_csv_cdr" VALUE="<% $cust_main->email_csv_cdr %>">
+% }
% if ( $show_term || $cust_main->cdr_termination_percentage ) {
<TR>
@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];
+}
</%init>