More Standardisation work.
This commit is contained in:
@@ -26,13 +26,15 @@ class Controller_User_Invoice extends Controller_Invoice {
|
||||
if (! $io->loaded() OR ! Auth::instance()->authorised($io->account))
|
||||
throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it');
|
||||
|
||||
// Log the download
|
||||
$imo = $io->invoice_memo;
|
||||
$imo->invoice_id = $io->id;
|
||||
$imo->account_id = $this->ao->id;
|
||||
$imo->type = 'download';
|
||||
$imo->memo = 'Invoice Downloaded.';
|
||||
$imo->save();
|
||||
if (! $this->ao->isAdmin()) {
|
||||
// Log the download
|
||||
$imo = $io->invoice_memo;
|
||||
$imo->invoice_id = $io->id;
|
||||
$imo->account_id = $this->ao->id;
|
||||
$imo->type = 'download';
|
||||
$imo->memo = 'Invoice Downloaded.';
|
||||
$imo->save();
|
||||
}
|
||||
|
||||
$this->response->body(Invoice::instance($io)->render('pdf','all',array('download'=>sprintf('%s.pdf',$io->refnum()))));
|
||||
$this->response->headers(array('Content-Type' => 'application/pdf'));
|
||||
|
Reference in New Issue
Block a user