X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=db30d3ecc8d50719ddceff8991ae55e391810248;hb=7efc882e67c25728c07990e852a590cbddfc1dc6;hp=42e1e61773320dafd359131295eb0233679d755a;hpb=17856ff5c299e4db21da28116f2666655c03f2c7;p=freeside.git diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 42e1e6177..db30d3ecc 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -1,122 +1,76 @@ <% 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{'MCRD'} ) -% ) -% { +% && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) +% && $FS::CurrentUser::CurrentUser->access_right('Post payment') +% ) +% { % my $s = 0; - Post -% if ( $payby{'BILL'} ) { + Post - - <% $s++ ? ' | ' : '' %> - check -% } -% if ( $payby{'CASH'} ) { +% if ( $payby{'BILL'} ) { + <% $s++ ? ' | ' : '' %> + check +% } - - <% $s++ ? ' | ' : '' %> - cash -% } -% if ( $payby{'WEST'} ) { +% if ( $payby{'CASH'} ) { + <% $s++ ? ' | ' : '' %> + cash +% } - - <% $s++ ? ' | ' : '' %> - Western Union -% } -% if ( $payby{'MCRD'} ) { +% if ( $payby{'WEST'} ) { + <% $s++ ? ' | ' : '' %> + Western Union +% } - - <% $s++ ? ' | ' : '' %> - manual credit card -% } +% if ( $payby{'MCRD'} ) { + <% $s++ ? ' | ' : '' %> + manual credit card +% } + payment against this invoice

- payment against this invoice
% } -Re-print this invoice -% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { +% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { - | Re-email - this invoice -% } -% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { + 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 +% } + +

- | Re-fax - this invoice % } -

% if ( $conf->exists('invoice_latex') ) { View typeset invoice

% } -% #false laziness with search/cust_bill_event.cgi -% unless ( $templatename ) { - - - <% table() %> - - Event - Date - Status - -% foreach my $cust_bill_event ( -% sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event -% ) { -% -% my $status = $cust_bill_event->status; -% $status .= ': '. encode_entities($cust_bill_event->statustext) -% if $cust_bill_event->statustext; -% my $part_bill_event = $cust_bill_event->part_bill_event; -% - - - <% $part_bill_event->event %> -% if ( $part_bill_event->templatename ) { -% my $alt_templatename = $part_bill_event->templatename; -% my $alt_link = "$alt_templatename-$invnum"; -% - - ( view - | view - typeset - | re-print -% if ( grep { $_ ne 'POST' } -% $cust_bill->cust_main->invoicing_list ) { - - | re-email -% } -% if ( $conf->exists('hylafax') -% && length($cust_bill->cust_main->fax) ) { - | re-fax +% my $br = 0; +% if ( $cust_bill->num_cust_event ) { $br++; +( View invoice events ) % } +% if ( $cust_bill->num_cust_bill_event ) { $br++; +( View deprecated, old-style invoice events ) +% } - ) -% } +<% $br ? '

' : '' %> - - - <% time2str("%a %b %e %T %Y", $cust_bill_event->_date) %> - <% $status %> - -% } - - - -
-% } % if ( $conf->exists('invoice_html') ) { <% join('', $cust_bill->print_html('', $templatename) ) %>