close #861 Fixed: Sending an invoice sets the wrong "sent date"
This commit is contained in:
@ -108,4 +108,11 @@ class Invoice extends DocumentModel
|
||||
$this->status = 'draft';
|
||||
$this->invoice_number = $this->getNextInvoiceNumber();
|
||||
}
|
||||
|
||||
public function getSentAtAttribute($value)
|
||||
{
|
||||
$sent = $this->histories()->where('status', 'sent')->first();
|
||||
|
||||
return ($sent) ? $sent->created_at : null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user