More product cleanup
This commit is contained in:
@@ -53,6 +53,7 @@ use App\Traits\SiteID;
|
||||
*
|
||||
* @package App\Models
|
||||
* @todo "Billing Start Date" = "connection date" for sub types??
|
||||
* @todo Add min_charge
|
||||
*/
|
||||
class Service extends Model implements IDs
|
||||
{
|
||||
@@ -577,13 +578,13 @@ class Service extends Model implements IDs
|
||||
|
||||
/**
|
||||
* This function will determine the minimum contract term for a service, which is the maximum of
|
||||
* supplier->type->contract_term, or the product->type->contract_term;
|
||||
* supplied->contract_term, or the product->type->contract_term;
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getContractTermAttribute(): int
|
||||
{
|
||||
return $this->getSuppliedAttribute()->contract_term;
|
||||
return max($this->supplied->contract_term,$this->product->type->contract_term);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1077,7 +1078,7 @@ class Service extends Model implements IDs
|
||||
*/
|
||||
public function charge_normalized(): float
|
||||
{
|
||||
return number_format($this->getBillingChargeAttribute()*Invoice::billing_change($this->recur_schedule,$this->offering->normalizeBillingInterval()),2);
|
||||
return number_format($this->getBillingChargeAttribute()*Invoice::billing_change($this->recur_schedule,$this->offering->billing_interval),2);
|
||||
}
|
||||
|
||||
private function getOrderInfoValue(string $key): ?string
|
||||
|
Reference in New Issue
Block a user