Some cosmetic updates for orders

This commit is contained in:
Deon George 2019-01-24 21:49:56 +11:00
parent 8402e4fcb6
commit d0fb3f643e
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
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);

View File

@ -33,7 +33,7 @@
@break
@default
@include('u.widgets.service_info')
@include('u.widgets.service.info')
@endswitch
</div>

View File

@ -1,6 +1,6 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">New Order</h3>
<h3 class="box-title">New Order Sent to Supplier</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
@ -15,7 +15,7 @@
<th>Account</th><td>{{ $o->account->company }}</td>
</tr>
<tr>
<th>Product</th><td>{{ $o->product->name }}</td>
<th>Product</th><td>{{ $o->product->name }}: {{ $o->name }}</td>
</tr>
@if($o->date_last_invoice)
<tr>
@ -28,6 +28,14 @@
<th>Next Invoice</th><td>{{ $o->date_next_invoice }}</td>
</tr>
@endif
<tr>
<th>Ordered</th><td>{{ $o->date_orig->format('Y-m-d') }}</td>
</tr>
@if ($o->date_last)
<tr>
<th>Update</th><td>{{ $o->date_last->format('Y-m-d') }}</td>
</tr>
@endif
<tr>
<th>Order Details</th><td>{!! $o->order_info_details !!}</td>
</tr>

View File

@ -1,6 +1,6 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">New Order</h3>
<h3 class="box-title">New Order Submitted</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
@ -15,7 +15,7 @@
<th>Account</th><td>{{ $o->account->company }}</td>
</tr>
<tr>
<th>Product</th><td>{{ $o->product->name }}</td>
<th>Product</th><td>{{ $o->product->name }}: {{ $o->name }}</td>
</tr>
@if($o->date_last_invoice)
<tr>
@ -28,6 +28,14 @@
<th>Next Invoice</th><td>{{ $o->date_next_invoice }}</td>
</tr>
@endif
<tr>
<th>Ordered</th><td>{{ $o->date_orig->format('Y-m-d') }}</td>
</tr>
@if ($o->date_last)
<tr>
<th>Update</th><td>{{ $o->date_last->format('Y-m-d') }}</td>
</tr>
@endif
<tr>
<th>Order Details</th><td>{!! $o->order_info_details !!}</td>
</tr>

View File

@ -1,49 +0,0 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Service Order Information</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<form role="form" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="box-body">
<table class="table table-condensed" width="100%">
<tr>
<th>Order Info</th>
<td>{{ $o->order_info ? join('|',$o->order_info) : '*NONE*' }}</td>
</tr>
<tr>
<th>Order Notes</th>
<td>{{ $o->order_notes ?: '*NONE*' }}</td>
</tr>
<tr>
<td colspan="2">
<div class="row">
<div class="control-group form-group col-sm-12 {{ $errors->has('order_notes') ? 'has-error' : '' }}">
<span class="help-block">{{ $errors->first('product_options') }}</span>
</div>
<div class="control-group form-group col-sm-12 {{ $errors->has('order_notes') ? 'has-error' : '' }}">
<label for="order_notes">Notes To Supplier/Client</label>
<textarea name="order_notes" class="form-control" rows="4" placeholder="APPROVE goes to Supplier, REJECT goes to Client.">{{ old('order_notes') }}</textarea>
<span class="help-block">{{ $errors->first('order_notes') }}</span>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="box-footer">
<input class="btn btn-success" type="submit" name="action" value="Approve">
<input class="btn btn-danger" type="submit" name="action" value="Reject">
</div>
</form>
</div>

View File

@ -23,6 +23,7 @@
@switch($o->order_status)
@case('ORDER-SUBMIT')
@case('ORDER-SENT')
@case('ORDER-HOLD')
@include('u.widgets.service.order.sent')
@break

View File

@ -17,15 +17,15 @@
<tr>
<th>Active</th><td>{{ $o->active }} ({{ $o->order_status }})</td>
</tr>
<tr>
<th>Product</th><td>{{ $o->product->name }}: {{ $o->name }}</td>
</tr>
<tr>
<th>Billing Period</th><td>{{ $o->recur_schedule }}</td>
</tr>
<tr>
<th>Billing Amount</th><td>{{ $o->cost }}</td>
</tr>
<tr>
<th>Product</th><td>{{ $o->product->name }}</td>
</tr>
<tr>
<th>Last Invoice</th><td>{{ $o->date_last_invoice }}</td>
</tr>

View File

@ -1,6 +1,6 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">New Order</h3>
<h3 class="box-title">New Order <small>({{$o->order_status}})</small></h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
@ -15,7 +15,7 @@
<th>Account</th><td>{{ $o->account->company }}</td>
</tr>
<tr>
<th>Product</th><td>{{ $o->product->name }}</td>
<th>Product</th><td>{{ $o->product->name }}: {{ $o->name }}</td>
</tr>
@if($o->date_last_invoice)
<tr>
@ -28,6 +28,14 @@
<th>Next Invoice</th><td>{{ $o->date_next_invoice }}</td>
</tr>
@endif
<tr>
<th>Ordered</th><td>{{ $o->date_orig->format('Y-m-d') }}</td>
</tr>
@if ($o->date_last)
<tr>
<th>Update</th><td>{{ $o->date_last->format('Y-m-d') }}</td>
</tr>
@endif
<tr>
<th>Order Details</th><td>{!! $o->order_info_details !!}</td>
</tr>