@extends('layouts.main') @section('page-title') {{ __('Proposal Detail') }} @endsection @section('page-breadcrumb') {{ __('Proposal') }} @endsection @push('scripts') @endpush @section('page-action')
@if ($proposal->is_convert == 0) @permission('proposal convert invoice')
{!! Form::open([ 'method' => 'get', 'route' => ['proposal.convert', $proposal->id], 'id' => 'proposal-form-' . $proposal->id, ]) !!} {{ Form::close() }}
@endpermission @else @permission('invoice show')
@endpermission @endif @if (module_is_active('Retainer')) @include('retainer::setting.convert_retainer', ['proposal' => $proposal, 'type' => 'view']) @endif
@endsection @section('content') @permission('proposal send') @if ($proposal->status != 4)

{{ __('Create Proposal') }}

{{ __('Created on ') }}{{ company_date_formate($proposal->issue_date) }}

@permission('proposal edit') {{ __('Edit') }} @endpermission
{{ __('Send Proposal') }}

@if ($proposal->status != 0) {{ __('Sent on') }} {{ company_date_formate($proposal->send_date) }} @else @permission('proposal send') {{ __('Status') }} : {{ __('Not Sent') }} @endpermission @endif

@if ($proposal->status == 0) @permission('proposal send') {{ __('Send') }} @endpermission @endif
{{ __('Proposal Status') }}

{{ __('Status') }} : @if ($proposal->status == 0) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 1) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 2) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 3) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 4) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @endif

@endif @endpermission

{{ __('Proposal') }}

{{('Issue Date')}} : {{ company_date_formate($proposal->issue_date) }}

{{ \App\Models\Proposal::proposalNumberFormat($proposal->proposal_id) }}

{{ __('Name ') }} : {{ !empty($customer->name) ? $customer->name : '' }}

@if (!empty($customer->billing_name) && !empty($customer->billing_address) && !empty($customer->billing_zip))

{{ __('Billed To') }} : {{ !empty($customer->billing_name) ? $customer->billing_name : '' }} {{ !empty($customer->billing_address) ? $customer->billing_address : '' }} {{ !empty($customer->billing_city) ? $customer->billing_city . ' ,' : '' }} {{ !empty($customer->billing_state) ? $customer->billing_state . ' ,' : '' }} {{ !empty($customer->billing_zip) ? $customer->billing_zip : '' }} {{ !empty($customer->billing_country) ? $customer->billing_country : '' }}

{{ !empty($customer->billing_phone) ? $customer->billing_phone : '' }}

{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}

@endif

{{ __('Email ') }} : {{ !empty($customer->email) ? $customer->email : '' }}

@if (!empty($company_settings['proposal_shipping_display']) && $company_settings['proposal_shipping_display'] == 'on') @if (!empty($customer->shipping_name) && !empty($customer->shipping_address) && !empty($customer->shipping_zip))

{{ __('Shipped To') }} : {{ !empty($customer->shipping_name) ? $customer->shipping_name : '' }} {{ !empty($customer->shipping_address) ? $customer->shipping_address : '' }} {{ !empty($customer->shipping_city) ? $customer->shipping_city . ' ,' : '' }} {{ !empty($customer->shipping_state) ? $customer->shipping_state . ' ,' : '' }} {{ !empty($customer->shipping_zip) ? $customer->shipping_zip : '' }} {{ !empty($customer->shipping_country) ? $customer->shipping_country : '' }}

{{ !empty($customer->shipping_phone) ? $customer->shipping_phone : '' }}

{{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}

@endif @endif
{{ __('Status') }} : @if ($proposal->status == 0) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 1) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 2) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 3) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @elseif($proposal->status == 4) {{ __(\App\Models\Proposal::$statues[$proposal->status]) }} @endif
@if (!empty($company_settings['proposal_qr_display']) && $company_settings['proposal_qr_display'] == 'on')
{!! DNS2D::getBarcodeHTML( route('pay.proposalpay', \Illuminate\Support\Facades\Crypt::encrypt($proposal->id)), 'QRCODE', 2, 2, ) !!}
@endif
@if (!empty($customFields) && count($proposal->customField) > 0)
@foreach ($customFields as $field)
{{ $field->name }} @if ($field->type == 'attachment') @else

{{ !empty($proposal->customField[$field->id]) ? $proposal->customField[$field->id] : '-' }}

@endif
@endforeach
@endif

{{ __('Item Summary') }}

{{ __('All items here cannot be deleted.') }}
@if ($proposal->proposal_module == 'account' || $proposal->proposal_module == 'cmms') @elseif($proposal->proposal_module == 'taskly') @endif @if ($proposal->proposal_module == 'account' || $proposal->proposal_module == 'cmms') @endif @php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; $TaxPrice_array = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = \App\Models\Proposal::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = \App\Models\Proposal::taxRate( $taxe->rate, $iteam->price, $iteam->quantity, $iteam->discount, ); if (array_key_exists($taxe->name, $taxesData)) { $taxesData[$taxe->name] = $taxesData[$taxe->name] + $taxDataPrice; } else { $taxesData[$taxe->name] = $taxDataPrice; } } @endphp @endif @if ($proposal->proposal_module == 'account') @elseif($proposal->proposal_module == 'taskly') {{-- --}} @elseif($proposal->proposal_module == 'cmms') @endif @if ($proposal->proposal_module == 'account' || $proposal->proposal_module == 'cmms') @endif @php $tr_tex = array_key_exists($key, $TaxPrice_array) == true ? $TaxPrice_array[$key] : 0; @endphp @endforeach @if ($proposal->proposal_module == 'account' || $proposal->proposal_module == 'cmms') @endif @if ($proposal->proposal_module == 'account' || $proposal->proposal_module == 'cmms') @endif @php $colspan = 7; $customerInvoices = ['taskly', 'account', 'cmms', 'cardealership', 'RestaurantMenu', 'rent' , 'Fleet']; if (in_array($proposal->invoice_module, $customerInvoices)) { $colspan = 7; } if ($proposal->proposal_module == 'taskly') { $colspan = 5; } @endphp @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Item Type') }} {{ __('Item') }} {{ __('Project') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('After discount & tax') }}
{{ $key + 1 }}{{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }} {{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '-' }} {{ !empty($iteam->product()) ? $iteam->product()->title : '--' }} {{ !empty($iteam->product_type) ? Str::ucfirst($iteam->product_type) : '--' }} {{ !empty($iteam->product()) ? $iteam->product()->name : '' }} {{ $iteam->quantity }}{{ currency_format_with_sym($iteam->price) }} {{ currency_format_with_sym($iteam->discount) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0; $data = 0; @endphp @foreach ($taxes as $tax) @php $taxPrice = \App\Models\Proposal::taxRate( $tax->rate, $iteam->price, $iteam->quantity, $iteam->discount, ); $totalTaxPrice += $taxPrice; $data += $taxPrice; @endphp @endforeach @php array_push($TaxPrice_array, $data); @endphp
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ currency_format_with_sym($taxPrice) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex) }}
{{ __('Total') }}{{ $totalQuantity }} {{ currency_format_with_sym($totalRate) }} {{ currency_format_with_sym($totalDiscount) }} {{ currency_format_with_sym($totalTaxPrice) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($proposal->getSubTotal()) }}
{{ __('Discount') }} {{ currency_format_with_sym($proposal->getTotalDiscount()) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice) }}
{{ __('Total') }} {{ currency_format_with_sym($proposal->getTotal()) }}
{{ __('Drop files here to upload') }}
@forelse($proposal_attachment as $key =>$attachment) @empty @include('layouts.nodatafound') @endforelse
{{ __('#') }} {{ __('File Name') }} {{ __('File Size') }} {{ __('Date Created') }} {{ __('Action') }}
{{ ++$key }} {{ $attachment->file_name }} {{ $attachment->file_size }} {{ company_date_formate($attachment->created_at) }}
{{ Form::open(['route' => ['proposal.attachment.destroy', $attachment->id], 'class' => 'm-0']) }} @method('DELETE') {{ Form::close() }}
@endsection