Move more product::class methods into __get(), no functional changes
This commit is contained in:
@@ -301,7 +301,7 @@ class Service extends Model implements IDs
|
||||
'billing_interval' => $this->recur_schedule ?: $this->product->billing_interval,
|
||||
'billing_interval_name' => Invoice::billing_name($this->billing_interval),
|
||||
|
||||
'contract_term' => max($this->supplied->contract_term,$this->product->type->contract_term),
|
||||
'contract_term' => max($this->product->contract_term,$this->supplied->contract_term),
|
||||
|
||||
'is_active' => $this->active || ($this->order_status && (! in_array($this->order_status,self::INACTIVE_STATUS))),
|
||||
'is_billed' => (! ($this->external_billing || $this->suspend_billing || ($this->price === 0))),
|
||||
@@ -1058,7 +1058,7 @@ class Service extends Model implements IDs
|
||||
// Connection charges are only charged once, so ignore if if we have already billed them
|
||||
if ((! $this->invoiced_items()->where('item_type',InvoiceItem::INVOICEITEM_SETUP)->count())
|
||||
&& (InvoiceItem::distinct('invoice_id')->where('service_id',$this->id)->count() < 2)
|
||||
&& $this->product->getSetupChargeAttribute($this->billing_interval,$this->account->group))
|
||||
&& $this->product->setup_charge($this->billing_interval,$this->account->group))
|
||||
{
|
||||
$ii = new InvoiceItem;
|
||||
|
||||
@@ -1066,7 +1066,7 @@ class Service extends Model implements IDs
|
||||
$ii->service_id = $this->id;
|
||||
$ii->product_id = $this->product_id;
|
||||
$ii->item_type = InvoiceItem::INVOICEITEM_SETUP;
|
||||
$ii->price_base = $this->product->getSetupChargeAttribute($this->billing_interval,$this->account->group);
|
||||
$ii->price_base = $this->product->setup_charge($this->billing_interval,$this->account->group);
|
||||
$ii->start_at = $this->invoice_next;
|
||||
$ii->stop_at = $this->invoice_next;
|
||||
$ii->quantity = 1;
|
||||
|
Reference in New Issue
Block a user