X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=2ce294e9a87202d4cfcdda45bfb3352df91909bf;hb=fb8915cce4be9520c00cc53c659e34abfb6172e1;hp=39c1a191f75b2187f9e4d26dad8d87a78316c64b;hpb=8d5366cf84513ed7e7832315fb3d36c49f4f9a8a;p=freeside.git
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 39c1a191f..2ce294e9a 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -1,111 +1,154 @@
-<%
+<& /elements/header.html, mt('Invoice View'), menubar(
+ emt("View this customer (#[_1])",$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');
+ <% mt('Delete this invoice') |h %>
+
-#my $printed = $cust_bill->printed;
+% }
+
+% if ( $cust_bill->owed > 0
+% && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) )
+% && $curuser->access_right(['Post payment', 'Post check payment', 'Post cash payment'])
+% && ! $conf->exists('pkg-balances')
+% )
+% {
+% my $s = 0;
+
+ <% mt('Post') |h %>
+
+% if ( $payby{'BILL'} && $curuser->access_right(['Post payment', 'Post check payment']) ) {
+ <% $s++ ? ' | ' : '' %>
+ <% mt('check') |h %>
+% }
+
+% if ( $payby{'CASH'} && $curuser->access_right(['Post payment', 'Post cash payment']) ) {
+ <% $s++ ? ' | ' : '' %>
+ <% mt('cash') |h %>
+% }
-my $link = $templatename ? "$templatename-$invnum" : $invnum;
+% if ( $payby{'WEST'} && $curuser->access_right(['Post payment']) ) {
+ <% $s++ ? ' | ' : '' %>
+ <% mt('Western Union') |h %>
+% }
-%>
-<%= header('Invoice View', menubar(
- "Main Menu" => $p,
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
-)) %>
+% if ( $payby{'MCRD'} && $curuser->access_right(['Post payment']) ) {
+ <% $s++ ? ' | ' : '' %>
+ <% mt('manual credit card') |h %>
+% }
-<% if ( $cust_bill->owed > 0 ) { %>
- Enter payments (check/cash) against this invoice |
-<% } %>
+ <% mt('payment against this invoice') |h %>
-Reprint this invoice
+% }
-<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %>
- | Re-email
- this invoice
-<% } %>
+% if ( $curuser->access_right('Resend invoices') ) {
-<% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { %>
- | Re-fax
- this invoice
-<% } %>
+ <% mt('Re-print this invoice') |h %>
-
+% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
+ | <% mt('Re-email this invoice') |h %>
+% }
-<% if ( $conf->exists('invoice_latex') ) { %>
- View typeset invoice
+% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
+ | <% mt('Re-fax this invoice') |h %>
+% }
+
+
+
+% }
+
+% if ( $conf->exists('invoice_latex') ) {
+
+ <% mt('View typeset invoice PDF') |h %>
-<% } %>
-
-<% #false laziness with search/cust_bill_event.cgi
- unless ( $templatename ) { %>
-
- <%= table() %>
-
<%= $cust_bill->print_text('', $templatename) %>-<% } %> - -