diff options
author | Mark Wells <mark@freeside.biz> | 2012-07-17 14:34:54 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-07-17 14:34:54 -0700 |
commit | 493be9f0635db1e24783e5c3945b8bef39624674 (patch) | |
tree | 4cee4be7877f804084fe54f2b52bbb52a8773ae9 /httemplate/view/cust_main_statement-pdf.cgi | |
parent | 55393622d8e4b87dca04e037d591074bbfabb2f6 (diff) |
Optionally show previous invoices on statements, #15864
Diffstat (limited to 'httemplate/view/cust_main_statement-pdf.cgi')
-rwxr-xr-x | httemplate/view/cust_main_statement-pdf.cgi | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/httemplate/view/cust_main_statement-pdf.cgi b/httemplate/view/cust_main_statement-pdf.cgi index 7a0e19838..7c2c20799 100755 --- a/httemplate/view/cust_main_statement-pdf.cgi +++ b/httemplate/view/cust_main_statement-pdf.cgi @@ -23,13 +23,17 @@ my $cust_main = qsearchs({ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }); die "Customer #$custnum not found!" unless $cust_main; +my $cust_bill = ($cust_main->cust_bill)[-1] + or die "Customer #$custnum has no invoices!"; my $cust_statement = FS::cust_statement->new({ 'custnum' => $custnum, - 'statementnum' => 'ALL', #magic +# 'statementnum' => 'ALL', #magic + 'invnum' => $cust_bill->invnum, '_date' => time, }); + my $pdf = $cust_statement->print_pdf( '', $templatename ); http_header('Content-Type' => 'application/pdf' ); |