Some cosmetic updates for orders

This commit is contained in:
Deon George
2019-01-24 21:49:56 +11:00
parent 8402e4fcb6
commit d0fb3f643e
8 changed files with 65 additions and 61 deletions

View File

@@ -50,26 +50,49 @@ class Service extends Model
];
private $inactive_status = [
'CANCELLED', // @todo Check if these should be changed to ORDER-CANCELLED
'CANCELLED',
'ORDER-REJECTED',
'ORDER-CANCELLED',
];
private $valid_status = [
'ORDER-SUBMIT' => ['approve'=>'ORDER-SENT','reject'=>'ORDER-REJECTED'],
// Order Submitted
'ORDER-SUBMIT' => ['approve'=>'ORDER-SENT','hold'=>'ORDER-HOLD','reject'=>'ORDER-REJECTED','cancel'=>'ORDER-CANCELLED'],
// Order On Hold (Reason)
'ORDER-HOLD' => [],
// Order Rejected (Reason)
'ORDER-REJECTED' => [],
// Order Cancelled
'ORDER-CANCELLED' => [],
// Order Sent to Supplier
'ORDER-SENT' => ['update_reference'=>'ORDER-SENT'],
];
/**
* Account the service belongs to
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo(Account::class);
}
/**
* Account that ordered the service
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function orderby()
{
return $this->belongsTo(Account::class);
}
/**
* Tenant that the service belongs to
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function site()
{
return $this->belongsTo(Site::class);
@@ -100,6 +123,11 @@ class Service extends Model
return $this->belongsTo(ServiceVoip::class,'id','service_id');
}
/**
* Product of the service
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function product()
{
return $this->belongsTo(Product::class);