Move base_cost/base_charge product::class methods into __get(), and base_charge(), no functional changes
This commit is contained in:
@@ -291,7 +291,7 @@ class Service extends Model implements IDs
|
||||
'billing_cost_orig_normalised_taxed' => $this->billing_cost_orig_taxed*Invoice::billing_change($this->product->type->billing_interval,Invoice::BILL_MONTHLY),
|
||||
'billing_cost_orig_taxed' => $this->account->taxed($this->billing_cost_orig),
|
||||
|
||||
'billing_charge_orig' => $this->product->getBaseChargeAttribute($this->billing_interval,$this->account->group),
|
||||
'billing_charge_orig' => $this->product->base_charge($this->billing_interval,$this->account->group),
|
||||
'billing_charge_orig_normalised_taxed' => $this->billing_charge_orig_taxed*Invoice::billing_change($this->billing_interval,Invoice::BILL_MONTHLY),
|
||||
'billing_charge_orig_taxed' => $this->account->taxed($this->billing_charge_orig),
|
||||
'billing_charge' => $this->billing_charge(),
|
||||
@@ -908,7 +908,7 @@ class Service extends Model implements IDs
|
||||
private function billing_cost(): float
|
||||
{
|
||||
return is_null($this->cost)
|
||||
? $this->product->getBaseCostAttribute()
|
||||
? $this->product->base_cost
|
||||
: $this->cost*Invoice::billing_change($this->product->type->billing_interval,$this->billing_interval);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user