Don't show send date for draft recurring invoices

This commit is contained in:
Hillel Coren 2017-02-14 15:09:57 +02:00
parent 0d39625ce0
commit 17889ef5a7

View File

@ -956,6 +956,10 @@ class Invoice extends EntityModel implements BalanceAffecting
*/ */
public function getNextSendDate() public function getNextSendDate()
{ {
if (! $this->is_public) {
return null;
}
if ($this->start_date && ! $this->last_sent_date) { if ($this->start_date && ! $this->last_sent_date) {
$startDate = $this->getOriginal('start_date') . ' ' . $this->account->recurring_hour . ':00:00'; $startDate = $this->getOriginal('start_date') . ' ' . $this->account->recurring_hour . ':00:00';