Fix some missing date_* attributes for Service that have been missed

This commit is contained in:
Deon George
2022-05-12 09:09:49 +10:00
parent 03f37f33ff
commit 2d7437fc0d
4 changed files with 39 additions and 26 deletions

View File

@@ -636,8 +636,8 @@ class Service extends Model implements IDs
}
// If the invoice has an end date, our invoice period shouldnt be greater than that.
if ($this->date_end AND $this->date_end < $date)
$date = $this->date_end;
if ($this->stop_at AND $this->stop_at < $date)
$date = $this->stop_at;
return $date;
}
@@ -1211,7 +1211,7 @@ class Service extends Model implements IDs
AND ($this->active OR $this->isPending())
AND (
(($future == TRUE) AND $this->invoice_next < $this->invoice_next_end) OR
(($future == FALSE) AND ($this->invoice_to < ($this->date_end ?: $billdate)))
(($future == FALSE) AND ($this->invoice_to < ($this->stop_at ?: $billdate)))
))
{
do {
@@ -1231,7 +1231,7 @@ class Service extends Model implements IDs
$o->addTaxes($this->account->country->taxes);
$this->invoice_items->push($o);
} while ($future == FALSE AND ($this->invoice_to < ($this->date_end ?: $billdate)));
} while ($future == FALSE AND ($this->invoice_to < ($this->stop_at ?: $billdate)));
}
// Add additional charges