X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=618e1913a95bfc7dbfc4fabaa799a9b29f2adcb6;hb=90e15da7354b55cc5461b58ac087096ed47e0240;hp=1f44905f8d3364d4e3fcfd201d59925980942cad;hpb=933897259d1e64fdc12c612f924db3b039a9ffdf;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 1f44905f8..618e1913a 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -1,123 +1,7 @@
-%if ( $payby_default eq 'HIDE' ) {
-% $cust_main->payby('BILL') unless $cust_main->payby;
-% my $payby = $cust_main->payby;
-
-
-
-
-
-% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate billday )) {
-
-
-
-% }
-
-% #false laziness w/elements/select-month_year.html & view/cust_main/billing.html
-% my( $mon, $year );
-% my $date = $cust_main->paydate || '12-2037';
-% if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
-% ( $mon, $year ) = ( $2, $1 );
-% } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
-% ( $mon, $year ) = ( $1, $3 );
-% } else {
-% die "unrecognized expiration date format: $date";
-% }
-
-
-
-
-
-
-
-
-% } else {
-%
% my $r = qq!* !;
-
<% mt('Billing information') |h %>
- <% &ntable("#cccccc") %>
-
-
- <%$r%><% mt('Billing type') |h %> |
-
- <& /elements/init_overlib.html &>
+
<% mt('Billing information') |h %>
-% my $payby = $cust_main->payby;
-% my $paytype = $cust_main->paytype;
-% my( $account, $aba ) = split('@', $payinfo);
-% my $branch = '';
-% ($branch,$aba) = split('\.',$aba)
-% if $conf->config('echeck-country') eq 'CA';
-%
-% my $disabled = 'DISABLED style="background-color: #dddddd"';
-% my $text_disabled = 'style="color: #999999"';
-%
-% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) {
-% $disabled = 'style="background-color: #ffffff"';
-% $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 $card_billday_style = $payby eq 'CARD' ? '' : 'style="color: #999999"';
-% my $chek_billday_style = $payby eq 'CHEK' ? '' : 'style="color: #999999"';
-% my $card_billday_select_disabled = $payby eq 'CARD' ? '' : 'DISABLED';
-% my $chek_billday_select_disabled = $payby eq 'CHEK' ? '' : 'DISABLED';
-%
-% #false laziness w/view/cust_main/billing.html and misc/payment.cgi
-% my $routing_label = $conf->config('echeck-country') eq 'US'
-% ? 'ABA/Routing number'
-% : 'Routing number';
-% my $routing_size = $conf->config('echeck-country') eq 'CA' ? 4 : 10;
-% my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9;
-%
-%
-% my %payby = (
-%
-% 'CARD' =>
-%
-% ''.
-%
-% qq!${r}!.emt('Card number').qq! | !.
-% qq! |
!.
-%
-% qq!${r}!.emt('Expiration').qq! | !.
-% ''.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'CARD_exp',
-% 'selected_date' =>
-% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ),
-% ).
-%
-% ' |
'.
-%
-% qq!!.emt('CVV2').qq! !.
-%
-% qq!(!.emt('help').qq!)!.
-% qq! | !.
-% ''.
-%
-% qq! |
!.emt('Start date').qq! | !.
-% ''.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'CARD_paystart',
-% 'disabled' => $disabled,
-% 'empty_option' => 1,
-% 'start_year' => 2000,
-% 'end_year' => (localtime())[5] + 1900,
-% 'selected_date' => (
-% ( $payby =~ /^(CARD|DCRD)$/
-% && cardtype($payinfo) =~ /^(Switch|Solo)$/ )
-% ? $cust_main->paystart_month. '-'.
-% $cust_main->paystart_year
-% : ''
-% )
-% ).
-%
-% qq!!.emt('or Issue number').qq! !.
-% ' |
!.
-%
-% qq!${r}!.emt('Exact name on card').qq! | !.
-% qq! |
!.
-%
-% qq!!.
-% qq! !.
-% emt('Charge future payments to this [_1] automatically','credit card').' |
'.
-%
-% ( $conf->exists('cust_main-select-billday') ?
-% qq!
-% Charge on this day of each month |
-% |
!
-% : ''
-% ).
-%
-% '
',
-%
-% 'CHEK' =>
-%
-% '',
-%
-% 'LECB' =>
-%
-% '',
-%
-% 'BILL' =>
-%
-% '',
-%
-% 'COMP' =>
-%
-% '',
-%
-% 'CASH' =>
-%
-% '',
-%
-% 'WEST' =>
-%
-% '',
-%
-% 'MCRD' =>
-%
-% '',
-%
-% );
-%
-% #this should use FS::payby
-% my @allopt = qw( CARD CHEK LECB BILL CASH WEST MCRD COMP );
-%
-% my %allopt = map { $_ => FS::payby->shortname($_) } @allopt;
-%
-% if ( $cust_main->custnum ) {
-% #don't offer CASH/WEST/MCRD initial payment types when editing customer
-% delete $allopt{$_} for qw(CASH WEST MCRD);
-% }
-%
-% my @options = grep exists( $allopt{$_} ), @payby;
-%
-% my %payby2option = (
-% ( map { $_ => $_ } @options ),
-% 'DCRD' => 'CARD',
-% 'DCHK' => 'CHEK',
-% );
-
-
- <& /elements/selectlayers.html,
- 'field' => 'payby',
- 'curr_value' => $payby2option{$payby || $payby_default || $payby[0] },
- 'options' => \@options,
- 'labels' => \%allopt,
- 'html_between' => ' |
',
- 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- 'onchange' => 'init_payauto_changed();',
+
+
+% 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,
&>
- <% &ntable("#cccccc") %>
+% } else {
- |
+
+
+% }
+
+% ###
+% # tax exemptions
+% ###
-% my $curuser = $FS::CurrentUser::CurrentUser;
% 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')
@@ -457,9 +55,13 @@
% } else {
-
- tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %> |
-
+ <& /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,
+ &>
% }
@@ -469,91 +71,154 @@
% #escape $exempt_group for NAME etc.
% my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group"));
- onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes) |
+ onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes) |
- Exemption number exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>> |
-% }
+% } #"
% }
-% unless ( $conf->exists('emailinvoiceonly') ) {
-
-
- > <% mt('Postal mail invoices') |h %>
+% ###
+% # postal invoices
+% ###
- |
-
+% unless ( $conf->exists('emailinvoiceonly') ) {
-
- 'postal_invoice',
+ label => emt('Postal mail invoices'),
+ value => 'Y',
+ curr_value => $cust_main->postal_invoice,
+ box_first => 1,
+ &>
- ( grep { $_ eq 'FAX' } @invoicing_list )
- ? 'CHECKED'
- : ''
+% }
- %>> <% mt('Fax invoices') |h %>
+% ###
+% # 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,
+ &>
% }
-
- invoice_noemail eq 'Y' )
- ? ''
- : 'CHECKED'
+ <& /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,
+ &>
- %>> <% mt('Email invoices') |h %>
+% ###
+% # prorate_day
+% ###
+% if ( $conf->exists('cust_main-select-prorate_day') ) {
+ |
+ <% mt('Prorate day') |h %>
+ |
+
+ <& /elements/checkbox.html,
+ field => 'force_prorate_day',
+ value => 'Y',
+ curr_value => $cust_main->force_prorate_day
+ &>
+
|
-% unless ( $conf->exists('cust-email-high-visibility')) {
-
-
- <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
- ? $r : '' %>Email address(es)
- |
-
- message_noemail eq 'Y' )
- ? 'CHECKED'
- : ''
- %>> <% emt('Do not send notices') %>
- |
-
+% 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 .= "";
+% }
+% $ret;
+% }
+
+% } else {
+
% }
-% if ( $conf->exists('cust_main-select-prorate_day') ) {
+% ###
+% # billday
+% ###
+
- <% mt('Prorate day (1-28)') |h %> |
+ <% mt('Charge card/e-check on this day of the month') |h %>
|
-
+
|
-% } else {
-
-% }
+
+% 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;
+% }
+
+% ###
+% # invoice_terms
+% ###
- <% mt('Invoice terms') |h %> |
+ <% mt('Invoice terms') |h %>
|
- <& /elements/select-terms.html,
- 'curr_value' => $cust_main->invoice_terms,
- &>
+% if ( $curuser->access_right('Edit customer invoice terms') ) {
+ <& /elements/select-terms.html,
+ 'curr_value' => $cust_main->invoice_terms,
+ 'agentnum' => $cust_main->agentnum,
+ &>
+% } else {
+%
+% my $terms =
+% $cust_main->invoice_terms
+% || emt('Default').' ('.
+% ( $conf->config('invoice_default_terms', $cust_main->agentnum)
+% || emt('Payable upon receipt')
+% ).
+% ')';
+ <% $terms |h %>
+
+ <& /elements/hidden.html,
+ 'field' => 'invoice_terms',
+ 'curr_value' => $cust_main->invoice_terms,
+ &>
+% }
|
+% ###
+% # credit_limit
+% ###
+
- <% mt('Credit limit') |h %> |
+ <% mt('Credit limit') |h %>
|
-
-<%once>
+ <% mt('Payment information') |h %>
+ <& cust_payby.html, 'cust_main'=>$cust_main, &>
-my $paystate_label = FS::Msgcat::_gettext('paystate');
-$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/;
-
-%once>
<%init>
my( $cust_main, %options ) = @_;
my @invoicing_list = @{ $options{'invoicing_list'} };
-my $payinfo = $options{'payinfo'};
my $conf = new FS::Conf;
-my $payby_default = $conf->config('payby-default');
my $money_char = $conf->config('money_char') || '$';
-my @payby = grep /\w/, $conf->config('payby');
-#@payby = (qw( CARD DCRD CHEK DCHK BILL CASH WEST COMP ))
-@payby = (qw( CARD DCRD CHEK DCHK BILL CASH COMP ))
- unless @payby;
-
my $show_term = '';
if ( $cust_main->custnum ) {
#false laziness w/view/cust_main/billing.html
|