@extends('layouts.admin') @push('script-page') @endpush @section('page-title') {{__('Contract Detail')}} @endsection @section('title')
{{__('Contract Detail')}}
@endsection @section('breadcrumb') @if(\Auth::guard('customer')->check()) @else @endif @if(\Auth::user()->type =='company') @else @endif @endsection @push('pre-purpose-css-page') @endpush @push('script-page') @php if(\Auth::user()->type =='company') { if(\Auth::user()->can('upload attachment')) { $route = route('contract.file.upload',[$contract->id]); } } else { $route = route('customer.contract.file.upload',[$contract->id]); } @endphp @endpush @section('action-btn')
@if(\Auth::user()->can('send contract mail') && ($contract->status == 'start'))
@endif @if((\Auth::user()->can('duplicate contract')) && ($contract->status == 'start'))
@endif @if(\Auth::user()->type =='company')
@else
@endif @if(\Auth::user()->type =='company')
@else
@endif @if((\Auth::user()->type =='company') && ($contract->company_signature == '') && ($contract->status == 'start'))
@endif @if((\Auth::user()->type != 'company') && ($contract->customer_signature == '') && ($contract->status == 'start'))
@endif
@endsection @section('filter') @endsection @section('content')
{{ __('Attachment') }}

{{count($contract->files)}}

{{ __('Comment') }}

{{count($contract->comment)}}

{{ __('Notes') }}

{{count($contract->note)}}

{{ __('Customer Name') }}
{{ $contract->clients->name }}
{{ __('Subject') }}
{{ $contract->subject }}
{{ __('Value') }}
{{ Auth::user()->priceFormat($contract->value)}}
{{__('Type')}}
{{$contract->types->name }}
{{__('Start Date')}}
{{ Auth::user()->dateFormat($contract->start_date) }}
{{__('End Date')}}
{{ Auth::user()->dateFormat($contract->end_date) }}
{{__('Status')}}
{{ ucfirst($contract->status) }}
{{ __('Description ') }}
@if(\Auth::user()->type =='company') @if(\Auth::user()->can('contract description')) {{ Form::open(['route' => ['contract.description.store', $contract->id]]) }}
@if($contract->status == 'start')
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
@endif {{ Form::close() }} @endif @else @if(\Auth::user()->can('contract description')) {{ Form::open(['route' => ['customer.contract.description.store', $contract->id]]) }}
@if(\Auth::user()->type =='company')
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
@endif {{ Form::close() }} @endif @endif
{{__('Attachments')}}
{{--
--}}
{{--
--}}
@foreach($contract->files as $file)
{{ $file->files }}

{{ number_format(\File::size(storage_path('contract_attachment/' . $file->files)) / 1048576, 2) . ' ' . __('MB') }}

@if((\Auth::user()->can('delete attachment')) && ($contract->status == 'start'))
{!! Form::open(['method' => 'DELETE', 'route' => ['contract.file.delete', $contract->id, $file->id]]) !!} {!! Form::close() !!}
@endif @if((\Auth::user()->type != 'company') && ($contract->status == 'start') && (\Auth::user()->id == $file->created_by) )
{!! Form::open(['method' => 'DELETE', 'route' => ['customer.contract.file.delete', $contract->id, $file->id]]) !!} {!! Form::close() !!}
@endif
@if($contract->files) @endif
@endforeach
{{__('Comments')}}
{{__('Notes')}}
@if(\Auth::user()->type =='company') @if(\Auth::user()->can('add notes')) {{ Form::open(['route' => ['contract.note.store', $contract->id]]) }}
@if($contract->status == 'start')
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
@endif {{ Form::close() }} @endif @else @if(\Auth::user()->can('add notes')) {{ Form::open(['route' => ['customer.contract.note.store', $contract->id]]) }}
@if($contract->status == 'start')
{{ Form::submit(__('Add'), ['class' => 'btn btn-primary']) }}
@endif {{ Form::close() }} @endif @endif
@foreach($contract->note as $note)
{{-- --}}

{{ $note->note }}

{{$note->created_at->diffForHumans()}}
@if((\Auth::user()->can('delete notes')) && ($contract->status == 'start'))
{!! Form::open(['method' => 'GET', 'route' => ['contract.note.destroy', $note->id]]) !!} {!! Form::close() !!}
@endif @if((\Auth::user()->type != 'company') && ($contract->status == 'start') &&(\Auth::user()->id == $note->created_by))
{!! Form::open(['method' => 'GET', 'route' => ['customer.contract.note.destroy', $note->id]]) !!} {!! Form::close() !!}
@endif
@endforeach
@endsection