diff --git a/app/Models/Service.php b/app/Models/Service.php index 30bccda..7c324a1 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -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); diff --git a/resources/theme/backend/adminlte/a/service.blade.php b/resources/theme/backend/adminlte/a/service.blade.php index 834b24b..fe850ef 100644 --- a/resources/theme/backend/adminlte/a/service.blade.php +++ b/resources/theme/backend/adminlte/a/service.blade.php @@ -33,7 +33,7 @@ @break @default - @include('u.widgets.service_info') + @include('u.widgets.service.info') @endswitch diff --git a/resources/theme/backend/adminlte/a/widgets/service/order/sent.blade.php b/resources/theme/backend/adminlte/a/widgets/service/order/sent.blade.php index 2c9aa72..3d8ea52 100644 --- a/resources/theme/backend/adminlte/a/widgets/service/order/sent.blade.php +++ b/resources/theme/backend/adminlte/a/widgets/service/order/sent.blade.php @@ -1,6 +1,6 @@
-

New Order

+

New Order Sent to Supplier

@@ -15,7 +15,7 @@ Account{{ $o->account->company }} - Product{{ $o->product->name }} + Product{{ $o->product->name }}: {{ $o->name }} @if($o->date_last_invoice) @@ -28,6 +28,14 @@ Next Invoice{{ $o->date_next_invoice }} @endif + + Ordered{{ $o->date_orig->format('Y-m-d') }} + + @if ($o->date_last) + + Update{{ $o->date_last->format('Y-m-d') }} + + @endif Order Details{!! $o->order_info_details !!} diff --git a/resources/theme/backend/adminlte/a/widgets/service/order/submit.blade.php b/resources/theme/backend/adminlte/a/widgets/service/order/submit.blade.php index 8284468..865d2ee 100644 --- a/resources/theme/backend/adminlte/a/widgets/service/order/submit.blade.php +++ b/resources/theme/backend/adminlte/a/widgets/service/order/submit.blade.php @@ -1,6 +1,6 @@
-

New Order

+

New Order Submitted

@@ -15,7 +15,7 @@ Account{{ $o->account->company }} - Product{{ $o->product->name }} + Product{{ $o->product->name }}: {{ $o->name }} @if($o->date_last_invoice) @@ -28,6 +28,14 @@ Next Invoice{{ $o->date_next_invoice }} @endif + + Ordered{{ $o->date_orig->format('Y-m-d') }} + + @if ($o->date_last) + + Update{{ $o->date_last->format('Y-m-d') }} + + @endif Order Details{!! $o->order_info_details !!} diff --git a/resources/theme/backend/adminlte/a/widgets/service_order-request.blade.php b/resources/theme/backend/adminlte/a/widgets/service_order-request.blade.php deleted file mode 100644 index 34457f0..0000000 --- a/resources/theme/backend/adminlte/a/widgets/service_order-request.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -
-
-

Service Order Information

-
- - -
-
- -
- {{ csrf_field() }} - -
- - - - - - - - - - - - - -
Order Info{{ $o->order_info ? join('|',$o->order_info) : '*NONE*' }}
Order Notes{{ $o->order_notes ?: '*NONE*' }}
-
-
- {{ $errors->first('product_options') }} -
- -
- - - {{ $errors->first('order_notes') }} -
-
-
-
- - -
-
\ No newline at end of file diff --git a/resources/theme/backend/adminlte/u/service.blade.php b/resources/theme/backend/adminlte/u/service.blade.php index 1fbff21..7f9dac8 100644 --- a/resources/theme/backend/adminlte/u/service.blade.php +++ b/resources/theme/backend/adminlte/u/service.blade.php @@ -23,6 +23,7 @@ @switch($o->order_status) @case('ORDER-SUBMIT') @case('ORDER-SENT') + @case('ORDER-HOLD') @include('u.widgets.service.order.sent') @break diff --git a/resources/theme/backend/adminlte/u/widgets/service/info.blade.php b/resources/theme/backend/adminlte/u/widgets/service/info.blade.php index 1c505e4..3df4160 100644 --- a/resources/theme/backend/adminlte/u/widgets/service/info.blade.php +++ b/resources/theme/backend/adminlte/u/widgets/service/info.blade.php @@ -17,15 +17,15 @@ Active{{ $o->active }} ({{ $o->order_status }}) + + Product{{ $o->product->name }}: {{ $o->name }} + Billing Period{{ $o->recur_schedule }} Billing Amount{{ $o->cost }} - - Product{{ $o->product->name }} - Last Invoice{{ $o->date_last_invoice }} diff --git a/resources/theme/backend/adminlte/u/widgets/service/order/sent.blade.php b/resources/theme/backend/adminlte/u/widgets/service/order/sent.blade.php index 47b3806..2309f7b 100644 --- a/resources/theme/backend/adminlte/u/widgets/service/order/sent.blade.php +++ b/resources/theme/backend/adminlte/u/widgets/service/order/sent.blade.php @@ -1,6 +1,6 @@
-

New Order

+

New Order ({{$o->order_status}})

@@ -15,7 +15,7 @@ Account{{ $o->account->company }} - Product{{ $o->product->name }} + Product{{ $o->product->name }}: {{ $o->name }} @if($o->date_last_invoice) @@ -28,6 +28,14 @@ Next Invoice{{ $o->date_next_invoice }} @endif + + Ordered{{ $o->date_orig->format('Y-m-d') }} + + @if ($o->date_last) + + Update{{ $o->date_last->format('Y-m-d') }} + + @endif Order Details{!! $o->order_info_details !!}