X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=b9dc23cbc78584cbe9b2e86cc254812278d4b033;hb=f1242ee84dba33d2e58e86ad329f8e3d519c153d;hp=bbcf87fc248e976330ae8c32d5d7d2b0b97497ce;hpb=c14a267229fc0d6f2d2afdebab3bd34d825df2ef;p=freeside.git diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index bbcf87fc2..b9dc23cbc 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -1,52 +1,111 @@ <% -# - -use strict; -use vars qw ( $cgi $query $invnum $cust_bill $custnum $printed $p ); -use IO::File; -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(header popurl menubar); -use FS::Record qw(qsearchs); -use FS::cust_bill; - -$cgi = new CGI; -&cgisuidsetup($cgi); #untaint invnum -($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -$invnum = $1; +my($query) = $cgi->keywords; +$query =~ /^((.+)-)?(\d+)$/; +my $templatename = $2; +my $invnum = $3; -$cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); +my $conf = new FS::Conf; + +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Invoice #$invnum not found!" unless $cust_bill; -$custnum = $cust_bill->getfield('custnum'); +my $custnum = $cust_bill->getfield('custnum'); + +#my $printed = $cust_bill->printed; -$printed = $cust_bill->printed; +my $link = $templatename ? "$templatename-$invnum" : $invnum; -$p = popurl(2); -print header('Invoice View', menubar( +%> +<%= header('Invoice View', menubar( "Main Menu" => $p, "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", -)); +)) %> -print qq!Enter payments (check/cash) against this invoice | ! - if $cust_bill->owed > 0; +<% if ( $cust_bill->owed > 0 ) { %> + Enter payments (check/cash) against this invoice | +<% } %> -print <Reprint this invoice - (Printed $printed times) - -END +Reprint this invoice -print $cust_bill->print_text; +<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %> + | Re-email + this invoice +<% } %> - #formatting - print < -
-END +Reprint this invoice -print $cust_bill->print_text; +<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %> + | Re-email + this invoice +<% } %> - #formatting - print < -