move header() to include(/elements/header.html) so it can be changed in one place...
[freeside.git] / httemplate / view / cust_bill.cgi
index 8dcbd3a..45e19d4 100755 (executable)
@@ -8,10 +8,10 @@ my $invnum = $3;
 
 my $conf = new FS::Conf;
 
-my @payby = $conf->config('payby');
+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 grep /\w/, @payby;
+  unless @payby;
 my %payby = map { $_=>1 } @payby;
 
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
@@ -23,13 +23,13 @@ my $custnum = $cust_bill->getfield('custnum');
 my $link = $templatename ? "$templatename-$invnum" : $invnum;
 
 %>
-<%= header('Invoice View', menubar(
+<%= include("/elements/header.html",'Invoice View', menubar(
   "Main Menu" => $p,
   "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
 )) %>
 
 <% if ( $cust_bill->owed > 0
-        && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} )
+        && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} )
       )
    {
      my $s = 0;
@@ -58,6 +58,13 @@ my $link = $templatename ? "$templatename-$invnum" : $invnum;
   
   <% } %>
 
+  <% if ( $payby{'MCRD'} ) { %>
+  
+    <%= $s++ ? ' | ' : '' %>
+    <A HREF="<%= $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<%= $invnum %>">manual credit card</A>
+  
+  <% } %>
+
   payment against this invoice<BR>
 
 <% } %>