X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=50262e82c47f04a928ef07bde0289d66ce4d1502;hb=ecf1c9cc0a20be6e489657e005ea771977b9f69c;hp=caac3a956c355b682f3c2e445ded05bb355b8779;hpb=cccd0b7cd38a88c131e19981be38434f87abe194;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index caac3a956..50262e82c 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -1,424 +1,344 @@
-<%
-
-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!* !;
-
-%>
-
-
Billing information
- <%= &ntable("#cccccc") %>
-
-
- <%=$r%>Billing type |
+% my $r = qq!* !;
-
-
-
-
-
- <%
-
- 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' =>
-
- '',
-
- );
-
-
- 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',
- 'COMP' => 'Complimentary',
- );
- if ( $cust_main->custnum ) { #don't offer CASH and WEST initial payment types
- # when editing customer
- delete $allopt{$_} for qw(CASH WEST);
- }
-
- 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} || 'CARD',
- 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
- );
-
- %>
-
- <%= $widget->html %>
-
-
+my $money_char = $conf->config('money_char') || '$';
- <%= $r %> required fields
+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];
+}
-<% } %>
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
+%init>
|