X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=ce8d96a950e7f7aae59608e99e506f4d2425c3e9;hb=611624bc08f525d19e1bd548a7d005aa73a53145;hp=d149cf1720a6e1d410b6bf9fcf095041bf6fd6e4;hpb=684a478c0f88e5bf6d1d3f32f4618089146b5709;p=freeside.git
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index d149cf172..ce8d96a95 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -1,108 +1,151 @@
-<%
+<% include("/elements/header.html",'Invoice View', menubar(
+ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
+)) %>
-#untaint invnum
-my($query) = $cgi->keywords;
-$query =~ /^((.+)-)?(\d+)$/;
-my $templatename = $2;
-my $invnum = $3;
+% if ( $conf->exists('deleteinvoices')
+% && $curuser->access_right('Delete invoices' )
+% )
+% {
-my $conf = new FS::Conf;
+
-my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
-die "Invoice #$invnum not found!" unless $cust_bill;
-my $custnum = $cust_bill->getfield('custnum');
+ Delete this invoice
+
-#my $printed = $cust_bill->printed;
+% }
-my $link = $templatename ? "$templatename-$invnum" : $invnum;
+% if ( $cust_bill->owed > 0
+% && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) )
+% && $curuser->access_right('Post payment')
+% && ! $conf->exists('pkg-balances')
+% )
+% {
+% my $s = 0;
-%>
-<%= header('Invoice View', menubar(
- "Main Menu" => $p,
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
-)) %>
+ Post
+
+% if ( $payby{'BILL'} ) {
+ <% $s++ ? ' | ' : '' %>
+ check
+% }
+
+% if ( $payby{'CASH'} ) {
+ <% $s++ ? ' | ' : '' %>
+ cash
+% }
-<% if ( $cust_bill->owed > 0 ) { %>
- Enter payments (check/cash) against this invoice |
-<% } %>
+% if ( $payby{'WEST'} ) {
+ <% $s++ ? ' | ' : '' %>
+ Western Union
+% }
-Re-print this invoice
+% if ( $payby{'MCRD'} ) {
+ <% $s++ ? ' | ' : '' %>
+ manual credit card
+% }
-<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %>
- | Re-email
- this invoice
-<% } %>
+ payment against this invoice
-<% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { %>
- | Re-fax
- this invoice
-<% } %>
+% }
-
+% if ( $curuser->access_right('Resend invoices') ) {
-<% if ( $conf->exists('invoice_latex') ) { %>
- View typeset invoice
+ Re-print this invoice
+
+% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
+ | Re-email this invoice
+% }
+
+% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
+ | Re-fax this invoice
+% }
+
+
+
+% }
+
+% if ( $conf->exists('invoice_latex') ) {
+
+ View typeset invoice PDF
-<% } %>
-
-<% #false laziness with search/cust_bill_event.cgi
- unless ( $templatename ) { %>
-
- <%= table() %>
-
<%= join('', $cust_bill->print_text('', $templatename) ) %>-<% } %> - -