X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=ba10929eddb3e1d27d50fda7521a5649ffe5b1ee;hb=4aead372bfa01314c4e3734b5ce00b6eeb1e35d9;hp=6168fa97e41bf76ad57eb00514642f8724905d67;hpb=f10cd68f08a6bfbd565a83b40bacc3f55a1265b3;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 6168fa97e..ba10929ed 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -1,71 +1,54 @@
-<%
+%if ( $payby_default eq 'HIDE' ) {
+%
+% $cust_main->payby('BILL') unless $cust_main->payby;
-my( $cust_main ) = @_;
-my $conf = new FS::Conf;
-my $payby_default = $conf->config('payby-default');
-
-my @payby = $conf->config('payby');
-#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
-@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
- unless grep /\w/, @payby;
-
-if ( $payby_default eq 'HIDE' ) {
-
- $cust_main->payby('BILL') unless $cust_main->payby;
-
-%>
-
-
+
-
-<% } else {
-
- my @invoicing_list = $cust_main->invoicing_list;
-
- my $r = qq!* !;
-
-%>
+% } else {
+%
+% my $r = qq!* !;
Billing information
- <%= &ntable("#cccccc") %>
+ <% &ntable("#cccccc") %>
- <%=$r%>Billing type |
+ <%$r%>Billing type |
- <%
-
- my($payby, $payinfo, $payname)=(
- $cust_main->payby,
- $cust_main->payinfo,
- $cust_main->payname,
- );
- my( $account, $aba ) = split('@', $payinfo);
-
- 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 %payby = (
-
- 'CARD' =>
-
- '',
-
- 'CHEK' =>
-
- '',
-
- 'LECB' =>
-
- '',
-
- 'BILL' =>
-
- '',
-
- 'COMP' =>
-
- '',
-
- 'CASH' =>
-
- '',
-
- 'WEST' =>
-
- '',
-
- 'MCRD' =>
-
- '',
-
- );
-
-
- 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' => '
',
- 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
- 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- );
-
- %>
-
- <%= $widget->html %>
+% my $payby = $cust_main->payby;
+% my( $account, $aba ) = split('@', $payinfo);
+%
+% 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 %payby = (
+%
+% 'CARD' =>
+%
+% '',
+%
+% 'CHEK' =>
+%
+% '',
+%
+% 'LECB' =>
+%
+% '',
+%
+% 'BILL' =>
+%
+% '',
+%
+% 'COMP' =>
+%
+% '',
+%
+% 'CASH' =>
+%
+% '',
+%
+% 'WEST' =>
+%
+% '',
+%
+% 'MCRD' =>
+%
+% '',
+%
+% );
+%
+% #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' => ' | ',
+% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
+% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
+% );
+%
+%
+
+
+ <% $widget->html %>
- <%= $r %> required fields
+ <% $r %> required fields
+% }
+
+<%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 @payby = grep /\w/, $conf->config('payby');
+#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
+@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
+ unless @payby;
+%init>
|