Fix strict recurring date for 2 years, error 500 when displaying services without an invoice
This commit is contained in:
parent
efc26dc620
commit
31749c03b0
@ -307,6 +307,7 @@ class Service extends Model
|
|||||||
* Product of the service
|
* Product of the service
|
||||||
*
|
*
|
||||||
* @return BelongsTo
|
* @return BelongsTo
|
||||||
|
* @deprecated use type->product
|
||||||
*/
|
*/
|
||||||
public function product()
|
public function product()
|
||||||
{
|
{
|
||||||
@ -519,8 +520,17 @@ class Service extends Model
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// Two Yearly
|
// Two Yearly
|
||||||
// NOTE: price_recurr_strict ignored
|
case 5:
|
||||||
case 5: $date = $this->getInvoiceNextAttribute()->addYear(2)->subDay(); break;
|
if (!$this->product->price_recurr_strict)
|
||||||
|
$date = $this->getInvoiceNextAttribute()->addYear(2)->subDay();
|
||||||
|
else {
|
||||||
|
$date = $this->getInvoiceNextAttribute()->addYear(2)->subDay()->endOfYear();
|
||||||
|
|
||||||
|
if ($date->clone()->addDay()->year % 2) {
|
||||||
|
$date = $date->subYear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// Three Yearly
|
// Three Yearly
|
||||||
// NOTE: price_recurr_strict ignored
|
// NOTE: price_recurr_strict ignored
|
||||||
@ -1301,4 +1311,4 @@ class Service extends Model
|
|||||||
{
|
{
|
||||||
return in_array($this->order_status,$this->inactive_status);
|
return in_array($this->order_status,$this->inactive_status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,8 @@
|
|||||||
@elseif($o->wasCancelled())
|
@elseif($o->wasCancelled())
|
||||||
<tr>
|
<tr>
|
||||||
<th>Cancelled</th>
|
<th>Cancelled</th>
|
||||||
<td>{!! $o->date_end ? $o->date_end->format('Y-m-d') : $o->paid_to->format('Y-m-d').'<sup>*</sup>' !!}</td>
|
<!-- @todo This should show the cancelled date -->
|
||||||
|
<td>{!! $o->date_end ? $o->date_end->format('Y-m-d') : ($o->paid_to ? $o->paid_to->format('Y-m-d') : '').'<sup>*</sup>' !!}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
</table>
|
</table>
|
||||||
@ -83,4 +84,4 @@
|
|||||||
<strong><sup>*</sup>NOTE:</strong> Estimated Invoice does not include any setup, connection nor all current billing cycle usage charges.
|
<strong><sup>*</sup>NOTE:</strong> Estimated Invoice does not include any setup, connection nor all current billing cycle usage charges.
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user