Add cost/price/supplierid to service, update service report to show supplerid and overridden costs (if any)
This commit is contained in:
@@ -955,13 +955,14 @@ class Service extends Model implements IDs
|
||||
|
||||
/**
|
||||
* The amount we are charged for the client to have this service
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function billing_cost(): float
|
||||
{
|
||||
return is_null($this->cost)
|
||||
? $this->product->getBaseCostAttribute()
|
||||
: $this->cost;
|
||||
: $this->cost*Invoice::billing_change($this->product->type->billing_interval,$this->product->billing_interval);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1127,7 +1128,7 @@ class Service extends Model implements IDs
|
||||
|
||||
public function isContract(): bool
|
||||
{
|
||||
return $this->getContractEndAttribute()->greaterThan(Carbon::now());
|
||||
return $this->getContractEndAttribute() && $this->getContractEndAttribute()->greaterThan(Carbon::now());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user