Added Invoice/SSL download recording, other misc fixes
This commit is contained in:
@@ -22,6 +22,13 @@ class Controller_User_Invoice extends Controller_Invoice {
|
||||
public function action_download() {
|
||||
$io = ORM::factory('Invoice',$this->request->param('id'));
|
||||
|
||||
// Log the download
|
||||
$imo = $io->invoice_memo;
|
||||
$imo->invoice_id = $io->id;
|
||||
$imo->account_id = $this->ao->id;
|
||||
$imo->memo = 'Invoice Downloaded.';
|
||||
$imo->save();
|
||||
|
||||
$this->response->body(Invoice::instance($io)->pdf()->Output(sprintf('%s.pdf',$io->refnum()),'D'));
|
||||
$this->response->headers(array('Content-Type' => 'application/pdf'));
|
||||
$this->auto_render = FALSE;
|
||||
@@ -83,6 +90,20 @@ class Controller_User_Invoice extends Controller_Invoice {
|
||||
->title(sprintf('%s: %s - %s',_('Invoice'),$io->refnum(),$io->account->name()))
|
||||
->title_icon('icon-list-alt')
|
||||
->body($output);
|
||||
|
||||
$x = $io->invoice_memo->find_all();
|
||||
if ($x->count())
|
||||
Block::factory()
|
||||
->title('Invoice Memos')
|
||||
->title_icon('icon-list-alt')
|
||||
->body(Table::factory()
|
||||
->data($x)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_orig'=>'Date',
|
||||
'account->name()'=>'Account',
|
||||
'memo'=>'Memo',
|
||||
)));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user