can't find any indication this did anything back to 3.x
[freeside.git] / httemplate / edit / cust_main / billing.html
index d25e887..5714f9a 100644 (file)
@@ -15,7 +15,7 @@
 
   <BR><FONT CLASS="fsinnerbox-title"><% mt('Billing information') |h %></FONT>
 
-  <% &ntable("#cccccc") %>
+  <TABLE CLASS="fsinnerbox">
 
 %   my $curuser = $FS::CurrentUser::CurrentUser;
 
 
 %   if ( $curuser->access_right('Complimentary customer') ) {
 
-      <TR>
-        <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="complimentary" VALUE="Y" <% $cust_main->complimentary eq "Y" ? 'CHECKED' : '' %>>Complimentary customer
-      </TR>
+    <& /elements/tr-checkbox.html,
+      field       => 'complimentary',
+      label       => emt('Complimentary customer'),
+      value       => 'Y',
+      curr_value  => $cust_main->complimentary,
+      box_first   => 1,
+    &>
 
 %   } else {
 
 
 %   } else {
 
-      <TR>
-        <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" <% $cust_main->tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %></TD>
-      </TR>
+    <& /elements/tr-checkbox.html,
+      field       => 'tax',
+      label       => emt('Tax Exempt' . (scalar(@exempt_groups) ? '(all taxes)' : '') ),
+      value       => 'Y',
+      curr_value  => $cust_main->tax,
+      box_first   => 1,
+    &>
 
 %   }
 
 %       #escape $exempt_group for NAME etc.
 %       my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group"));
         <TR>
-          <TD>&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" ID="tax_<% $exempt_group %>" VALUE="Y" <% $checked ? 'CHECKED' : '' %> onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)</TD>
+          <TD STYLE="white-space:nowrap">&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" ID="tax_<% $exempt_group %>" VALUE="Y" <% $checked ? 'CHECKED' : '' %> onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)</TD>
           <TD> - Exemption number <INPUT TYPE="text" NAME="tax_<% $exempt_group %>_num" ID="tax_<% $exempt_group %>_num" VALUE="<% $cgi->param("tax_$exempt_group".'_num') || ( $cust_main_exemption ? $cust_main_exemption->exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>></TD>
         </TR>
-%     }
+%     } #"
 %   }
 
 %   ###
 
 % unless ( $conf->exists('emailinvoiceonly') ) {
 
-    <TR>
-      <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST" <%
-
-        ( grep { $_ eq 'POST' } @invoicing_list )
-
-          ? 'CHECKED'
-          : ''
-
-        %>> <% mt('Postal mail invoices') |h %> 
-
-      </TD>
-    </TR>
+    <& /elements/tr-checkbox.html,
+      field       => 'postal_invoice',
+      label       => emt('Postal mail invoices'),
+      value       => 'Y',
+      curr_value  => $cust_main->postal_invoice,
+      box_first   => 1,
+    &>
 
 % }
 
 %   # email invoices
 %   ###
 
-    <TR>
-      <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoice_email" VALUE="Y" <%
-
-        ( $cust_main->invoice_noemail eq 'Y' )
-          ? ''
-          : 'CHECKED'
-
-        %>> <% mt('Email invoices') |h %> 
-
-      </TD>
-    </TR>
+    <& /elements/tr-checkbox.html,
+      field       => 'invoice_noemail',
+      label       => emt('Do not send email invoices'),
+      value       => 'Y',
+      curr_value  => $cust_main->invoice_noemail,
+      box_first   => 1,
+    &>
 
-% unless ( $conf->exists('cust-email-high-visibility')) {
-   <TR>
-      <TD ALIGN="right" WIDTH="200">
-        <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) 
-            ? $r : '' %>Email address(es)
-      </TD>
-      <TD WIDTH="408"><INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
-      <INPUT TYPE="checkbox" NAME="message_noemail" VALUE="Y" <%
-        ( $cust_main->message_noemail eq 'Y' )
-          ? 'CHECKED'
-          : ''
-        %>> <% emt('Do not send notices') %>
-      </TD>
-    </TR>
-% }
+    <& /elements/tr-checkbox.html,
+      field       => 'message_noemail',
+      label       => emt('Do not send other email notices'),
+      value       => 'Y',
+      curr_value  => $cust_main->message_noemail,
+      box_first   => 1,
+    &>
 
 %   ###
 %   # prorate_day
 
 % if ( $conf->exists('cust_main-select-prorate_day') ) {
     <TR>
-      <TD ALIGN="right" WIDTH="200"><% mt('Prorate day (1-28)') |h %> </TD>
+      <TH ALIGN="right" WIDTH="200"><% mt('Prorate day') |h %> </TD>
       <TD>
-        <INPUT TYPE="text" NAME="prorate_day" VALUE="<% $cust_main->prorate_day %>" SIZE=3 MAXLENGTH=2>
+        <SELECT NAME="prorate_day">
+          <% prorate_day_options($cust_main->prorate_day) %>
+        </SELECT>
+        <& /elements/checkbox.html,
+          field       => 'force_prorate_day',
+          value       => 'Y',
+          curr_value  => $cust_main->force_prorate_day
+        &>
+        <label><% emt('Force all packages to this day') %></label>
       </TD>
     </TR>
+
+%   sub prorate_day_options {
+%     my $curr_value = shift;
+%     my $ret = '';
+%     for my $prorate_day ( 1 .. 28 ) {
+%       my $sel = '';
+%       $sel = "SELECTED='SELECTED'" if $curr_value == $prorate_day;
+%       $ret .= "<OPTION VALUE='$prorate_day' $sel>$prorate_day</OPTION>";
+%     }
+%     $ret;
+%    }
+
 % } else {
     <INPUT TYPE="hidden" NAME="prorate_day" VALUE="<% $cust_main->prorate_day %>">
 % }
 %   ###
 
     <TR>
-      <TD ALIGN="right" WIDTH="200"><% mt('Charge card/e-check on this day of the month') |h %> </TD>
+      <TH ALIGN="right" WIDTH="200"><% mt('Charge card/e-check on this day of the month') |h %> </TD>
       <TD>
         <SELECT NAME="billday">
           <% billday_options($cust_main->billday) %>
 %   ###
 
     <TR>
-      <TD ALIGN="right" WIDTH="200"><% mt('Invoice terms') |h %> </TD>
+      <TH ALIGN="right" WIDTH="200"><% mt('Invoice terms') |h %> </TD>
       <TD WIDTH="408">
         <& /elements/select-terms.html,
              'curr_value' => $cust_main->invoice_terms,
 %   ###
 
     <TR>
-      <TD ALIGN="right" WIDTH="200"><% mt('Credit limit') |h %> </TD>
+      <TH ALIGN="right" WIDTH="200"><% mt('Credit limit') |h %> </TD>
       <TD WIDTH="408">
         <SCRIPT TYPE="text/javascript">
 function toggle(obj) {
@@ -198,12 +209,14 @@ function toggle(obj) {
                VALUE = 1
                onClick="toggle(this)"
                <% length($cust_main->credit_limit) ? '' : ' CHECKED'%>
-        > <% $default_credit_limit
+        > <FONT SIZE="-1" COLOR="#333333">
+          <% $default_credit_limit
                ? "Default ($money_char". sprintf("%.2f", $default_credit_limit).
                  ")"
                : mt('Unlimited')
             |h
-          %> 
+          %>
+          </FONT> 
       </TD>
     </TR>
 
@@ -211,14 +224,6 @@ function toggle(obj) {
 %   # CDR flags / options
 %   ###
 
-% if ( $conf->exists('voip-cust_cdr_spools') ) { 
-      <TR>
-       <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="spool_cdr" VALUE="Y" <% $cust_main->spool_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Spool CDRs') |h %></TD>
-      </TR>
-% } else { 
-      <INPUT TYPE="hidden" NAME="spool_cdr" VALUE="<% $cust_main->spool_cdr %>">
-% }
-
 % if ( $conf->exists('voip-cust_cdr_squelch') ) { 
       <TR>
        <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="squelch_cdr" VALUE="Y" <% $cust_main->squelch_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt($conf->exists('voip-cdr_email') ? 'Omit CDRs from printed invoices' : 'Omit CDRs from invoices') |h %></TD>
@@ -227,9 +232,9 @@ function toggle(obj) {
       <INPUT TYPE="hidden" NAME="squelch_cdr" VALUE="<% $cust_main->squelch_cdr %>">
 % }
 
-% if ( $conf->exists('voip-cust_email_csv_cdr') ) { 
+% if ( my $attach = $conf->config('voip-cdr_email_attach') ) {
       <TR>
-       <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="email_csv_cdr" VALUE="Y" <% $cust_main->email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as CSV to emailed invoices') |h %></TD>
+       <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="email_csv_cdr" VALUE="Y" <% $cust_main->email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as '. uc($attach). ' to emailed invoices') |h %></TD>
       </TR>
 % } else { 
       <INPUT TYPE="hidden" NAME="email_csv_cdr" VALUE="<% $cust_main->email_csv_cdr %>">
@@ -250,7 +255,7 @@ function toggle(obj) {
 
 % if ( $show_term || $cust_main->cdr_termination_percentage ) {
       <TR>
-       <TD ALIGN="right"><% mt('CDR termination settlement') |h %></TD>
+       <TH ALIGN="right"><% mt('CDR termination settlement') |h %></TD>
        <TD><INPUT TYPE  = "text"
                   NAME  = "cdr_termination_percentage"
                   SIZE  = 6
@@ -319,7 +324,6 @@ function toggle(obj) {
 
 my( $cust_main, %options ) = @_;
 my @invoicing_list = @{ $options{'invoicing_list'} };
-my $payinfo = $options{'payinfo'};
 my $conf = new FS::Conf;
 
 my $money_char = $conf->config('money_char') || '$';