- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript">
- function OLiframeContent(src, width, height, name) {
- return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
- +(name?' name="'+name+'" id="'+name+'"':'')+' scrolling="auto">'
- +'<div>[iframe not supported]</div></iframe>');
- }
- </SCRIPT>
-%
-%
-% my($payby, $paymask, $payname)=(
-% $cust_main->payby,
-% $cust_main->paymask,
-% $cust_main->payname,
-% );
-% my( $account, $aba ) = split('@', $paymask);
-%
-% my $disabled = 'DISABLED style="background-color: #dddddd"';
-% my $text_disabled = 'style="color: #999999"';
-%
-% # this is not going to work unless the mask-generation recognizes
-% # Switch/Solo cards
-% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($paymask) =~ /^(Switch|Solo)$/ ) {
-% $disabled = 'style="background-color: #ffffff"';
-% $text_disabled = 'style="color: #000000";'
-% }
-%
-% my %payby = (
-%
-% 'CARD' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Card number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $paymask : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'exp',
-% 'selected_date' =>
-% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ),
-% ).
-%
-% '</TD></TR>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">CVV2 !.
-%
-% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
-% qq!</TD>!.
-% '<TD WIDTH="408"><INPUT TYPE="text" NAME="paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ && !$cust_main->is_encrypted($cust_main->paycvv) ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'.
-%
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200"><SPAN ID="paystart_label" $text_disabled>Start date </SPAN></TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'paystart',
-% 'disabled' => $disabled,
-% 'empty_option' => 1,
-% 'start_year' => 2000,
-% 'end_year' => (localtime())[5] + 1900,
-% 'selected_date' => (
-% ( $payby =~ /^(CARD|DCRD)$/
-% && cardtype($paymask) =~ /^(Switch|Solo)$/ ) #also
-% ? $cust_main->paystart_month. '-'.
-% $cust_main->paystart_year
-% : ''
-% )
-% ).
-%
-% qq!<SPAN ID="payissue_label" $text_disabled> or Issue number </SPAN>!.
-% '<INPUT TYPE="text" NAME="payissue" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payissue : '' ). qq!" SIZE=3 MAXLENGTH=2 $disabled></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Exact name on card </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-%
-% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCRD' ? '' : 'CHECKED' ). '> Charge future payments to this card automatically</TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'CHEK' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Account number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" SIZE=10 NAME="payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD></TR>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}ABA/Routing number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
-% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
-% qq!</TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Bank name </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-%
-% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'LECB' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Phone number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->paymask : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-% qq!<INPUT TYPE="hidden" NAME="payname" VALUE="">!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'BILL' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">P.O. </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->paymask : '' ). qq!"></TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">Attention </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'COMP' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Approved by </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE=""></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'exp',
-% 'selected_date' =>
-% ( $payby eq 'COMP' ? $cust_main->paydate : '' ),
-% ).
-%
-% '</TD></TR>'.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'CASH' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'CASH' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'WEST' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'WEST' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'MCRD' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'MCRD' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% );
-%
-% #this should use FS::payby
-% my %allopt = (
-% 'CARD' => 'Credit card',
-% 'CHEK' => 'Electronic check',
-% 'LECB' => 'Phone bill billing',
-% 'BILL' => 'Billing',
-% 'CASH' => 'Cash', # initial payment, then billing',
-% 'WEST' => 'Western Union', # initial payment, then billing',
-% 'MCRD' => 'Manual credit card', # initial payment, then billing',
-% 'COMP' => 'Complimentary',
-% );
-% if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types
-% # when editing customer
-% delete $allopt{$_} for qw(CASH WEST MCRD);
-% }
-%
-% tie my %options, 'Tie::IxHash',
-% map { $_ => $allopt{$_} }
-% grep { exists $allopt{$_} }
-% @payby;
-%
-% my %payby2option = (
-% ( map { $_ => $_ } keys %options ),
-% 'DCRD' => 'CARD',
-% 'DCHK' => 'CHEK',
-% );
-%
-% my $widget = new HTML::Widgets::SelectLayers(
-% 'options' => \%options,
-% #'form_name' => 'dummy',
-% #'form_action' => 'nothingyet',
-% #chops bottom of page in IE# 'under_position' => 'absolute',
-% 'html_between' => '</TD></TR></TABLE>',
-% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
-% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
-% );
-%
-%
-
-
- <TD WIDTH="408"><% $widget->html %>
-
- <FORM NAME="billing_bottomform" STYLE="margin-top: 0; margin-bottom: 0">
-
- <% &ntable("#cccccc") %>
-
- <TR><TD> </TD></TR>
-
+ <BR><FONT CLASS="fsinnerbox-title"><% mt('Billing information') |h %></FONT>
+
+ <TABLE CLASS="fsinnerbox">
+
+% my $curuser = $FS::CurrentUser::CurrentUser;
+
+% ###
+% # complimentry flag
+% ###
+
+% if ( $curuser->access_right('Complimentary customer') ) {
+
+ <& /elements/tr-checkbox.html,
+ field => 'complimentary',
+ label => emt('Complimentary customer'),
+ value => 'Y',
+ curr_value => $cust_main->complimentary,
+ box_first => 1,
+ &>
+
+% } else {
+
+ <INPUT TYPE="hidden" NAME="complimentary" VALUE="<% $cust_main->complimentary eq 'Y' ? 'Y' : '' %>">
+
+% }
+
+% ###
+% # tax exemptions
+% ###
+
+% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
+% if ( $conf->exists('cust_class-tax_exempt')
+% || $conf->exists('tax-cust_exempt-groups-require_individual_nums')
+% || $conf->config('tax-cust_exempt-groups-num_req') =~ /\w/
+% || ! $curuser->access_right('Edit customer tax exemptions')
+% )
+% {
+
+ <INPUT TYPE="hidden" NAME="tax" VALUE="<% $cust_main->tax eq 'Y' ? 'Y' : '' %>">
+
+% } else {
+
+ <& /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,
+ &>
+
+% }
+
+% if ( $curuser->access_right('Edit customer tax exemptions') ) {
+% foreach my $exempt_group ( @exempt_groups ) {
+% my $cust_main_exemption = $cust_main->tax_exemption($exempt_group);
+% #escape $exempt_group for NAME etc.
+% my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group"));
+ <TR>
+ <TD STYLE="white-space:nowrap"> <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>
+% } #"
+% }
+
+% ###
+% # postal invoices
+% ###
+
+% unless ( $conf->exists('emailinvoiceonly') ) {
+
+ <& /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
+% ###
+
+ <& /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,
+ &>
+
+% if ( $conf->config_bool('allow_payment_receipt_noemail', $cust_main->agentnum) ) {
+ <& /elements/tr-checkbox.html,
+ field => 'paymentreceipt_noemail',
+ label => emt('Do not send email payment receipts'),
+ value => 'Y',
+ curr_value => $cust_main->paymentreceipt_noemail,
+ box_first => 1,
+ &>
+% }
+
+ <& /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') ) {