function pminvoice_handler_field_invoice_status::render in Drupal PM (Project Management) 7
Override render method.
Overrides views_handler_field::render
File
- pminvoice/
pminvoice_handler_field_invoice_status.inc, line 32 - Handler for the Project Management Invoice status field in Views
Class
- pminvoice_handler_field_invoice_status
- Field handler for invoice status.
Code
function render($values) {
$paymentdate = $values->{$this->aliases['paymentdate']};
$duedate = $values->{$this->aliases['duedate']};
$status = 'open';
if ($paymentdate) {
$status = 'paid';
}
elseif ($duedate < time()) {
$status = 'overdue';
}
return pm_icon('invoice_status_' . check_plain($status), pm_attribute_value('Invoice status', $status));
}