[freeside-commits] freeside/httemplate/view cust_statement.html, 1.1, 1.2 cust_statement-pdf.cgi, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Thu Aug 20 02:47:07 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv25242/httemplate/view
Modified Files:
cust_statement.html
Added Files:
cust_statement-pdf.cgi
Log Message:
email statements, RT#4860
--- NEW FILE: cust_statement-pdf.cgi ---
<% $pdf %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View invoices');
#untaint statementnum
my($query) = $cgi->keywords;
$query =~ /^((.+)-)?(\d+)(.pdf)?$/;
my $templatename = $2 || 'statement'; #XXX configure... via event?? eh..
my $statementnum = $3;
my $cust_statement = qsearchs({
'select' => 'cust_statement.*',
'table' => 'cust_statement',
'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
'hashref' => { 'statementnum' => $statementnum },
'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
});
die "Statement #$statementnum not found!" unless $cust_statement;
my $pdf = $cust_statement->print_pdf( '', $templatename);
http_header('Content-Type' => 'application/pdf' );
http_header('Content-Length' => length($pdf) );
http_header('Cache-control' => 'max-age=60' );
</%init>
Index: cust_statement.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_statement.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_statement.html 20 Aug 2009 04:03:35 -0000 1.1
+++ cust_statement.html 20 Aug 2009 09:47:05 -0000 1.2
@@ -4,13 +4,15 @@
% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) {
- <A HREF="<% $p %>misc/print-invoice.cgi?<% $link %>">Re-print this statement</A>
+%# <A HREF="<% $p %>misc/print-invoice.cgi?<% $link %>">Re-print this statement</A>
% if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) {
- | <A HREF="<% $p %>misc/email-invoice.cgi?<% $link %>">Re-email this statement</A>
+%# |
+ <A HREF="<% $p %>misc/email-invoice.cgi?<% $link %>">Re-email this statement</A>
% }
-% if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) {
+% if ( 0 ) {
+% #if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) {
| <A HREF="<% $p %>misc/fax-invoice.cgi?<% $link %>">Re-fax this statement</A>
% }
@@ -19,7 +21,8 @@
% }
-% if ( $conf->exists('invoice_latex') ) {
+% #if ( $conf->exists('invoice_latex') ) {
+% if ( 0 ) { #broken???
<A HREF="<% $p %>view/cust_statement-pdf.cgi?<% $link %>.pdf">View typeset statement</A>
<BR><BR>
@@ -47,7 +50,7 @@
#untaint statement
my($query) = $cgi->keywords;
$query =~ /^((.+)-)?(\d+)$/;
-my $templatename = $2;
+my $templatename = $2 || 'statement'; #XXX configure... via event?? eh..
my $statementnum = $3;
my $conf = new FS::Conf;
More information about the freeside-commits
mailing list