@extends('layouts.admin') @section('page-title') {{ __('Proposal Detail') }} @endsection @php $settings = App\Models\Utility::settings(); @endphp @push('script-page') @endpush @section('breadcrumb') @if (\Auth::guard('customer')->check()) @else @endif @if (\Auth::user()->type == 'company') @else @endif @endsection @section('action-btn')
@if ($proposal->is_convert == 0) @if ($proposal->converted_invoice_id == 0) @can('convert retainer proposal')
{!! Form::open([ 'method' => 'get', 'class' => ' btn btn-sm btn-primary align-items-center', 'route' => ['proposal.convert', $proposal->id], 'id' => 'proposal-form-' . $proposal->id, ]) !!} {!! Form::close() !!}
@endcan @endif @else @if ($proposal->converted_invoice_id == 0) @can('convert retainer proposal')
@endcan @endif @endif @if ($proposal->converted_invoice_id == 0) @if ($proposal->is_convert == 0) @can('convert retainer proposal')
{!! Form::open([ 'method' => 'get', 'class' => ' btn btn-sm btn-warning align-items-center', 'route' => ['proposal.convertinvoice', $proposal->id], 'id' => 'proposal-form-' . $proposal->id, ]) !!} {!! Form::close() !!}
@endcan @endif @else @can('show invoice') @if(\Auth::user()->type == 'company')
@endif @endcan @endif
@endsection @section('content') @can('send proposal') @if ($proposal->status != 4)
{{ __('Create Proposal') }}

{{ __('Created on ') }}{{ \Auth::user()->dateFormat($proposal->issue_date) }}

@can('edit proposal') {{ __('Edit') }} @endcan
{{ __('Send Proposal') }}

@if ($proposal->status != 0) {{ __('Sent on') }} {{ \Auth::user()->dateFormat($proposal->send_date) }} @else @can('send proposal') {{ __('Status') }} : {{ __('Not Sent') }} @endcan @endif

@if ($proposal->status == 0) @can('send proposal') {{ __('Send') }} @endcan @endif
{{ __('Proposal 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 @endcan @if (\Auth::user()->type == 'company') @if ($proposal->status == 0)
@else
@endif @if ($proposal->status != 0)
@endif @else
@endif

{{ __('Proposal') }}

{{ Auth::user()->proposalNumberFormat($proposal->proposal_id) }}


{{ __('Issue Date') }} :
{{ \Auth::user()->dateFormat($proposal->issue_date) }}

@if (!empty($customer->billing_name))
{{ __('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:''}}
@if (App\Models\Utility::getValByName('tax_number') == 'on') {{ __('Tax Number ') }} : {{ !empty($customer->tax_number) ? $customer->tax_number : '' }}
@endif @if(!empty($settings['tax_type']) && !empty($settings['vat_number'])){{$settings['tax_type'].' '. __('Number')}} : {{$settings['vat_number']}}
@endif
@endif @if (App\Models\Utility::getValByName('shipping_display') == 'on')
{{ __('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:''}}
@endif
@if ($settings['proposal_qr_display'] == 'on') {!! DNS2D::getBarcodeHTML( route('pay.proposalpay', \Illuminate\Support\Facades\Crypt::encrypt($proposal->id)), 'QRCODE', 2, 2, ) !!} @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($customFields) && count($proposal->customField) > 0) @foreach ($customFields as $field)
{{ $field->name }} :
{{ !empty($proposal->customField) ? $proposal->customField[$field->id] : '-' }}

@endforeach @endif
{{ __('Product Summary') }}
{{ __('All items here cannot be deleted.') }}
@php $totalQuantity = 0; $totalRate = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; @endphp @foreach ($iteams as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = App\Models\Utility::tax($iteam->tax); $totalQuantity += $iteam->quantity; $totalRate += $iteam->price; $totalDiscount += $iteam->discount; foreach ($taxes as $taxe) { $taxDataPrice = App\Models\Utility::taxRate($taxe->rate, $iteam->price, $iteam->quantity); if (array_key_exists($taxe->name, $taxesData)) { $taxesData[$taxe->name] = $taxesData[$taxe->name] + $taxDataPrice; } else { $taxesData[$taxe->name] = $taxDataPrice; } } @endphp @endif @endforeach {{-- --}} {{-- --}} @if (!empty($taxesData)) @foreach ($taxesData as $taxName => $taxPrice) @endforeach @endif
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('before tax & discount') }}
{{ $key + 1 }} {{ !empty($iteam->product) ? $iteam->product->name : '' }} {{ $iteam->quantity }} ({{ $iteam->product->unit->name }}) {{ \Auth::user()->priceFormat($iteam->price) }} {{ \Auth::user()->priceFormat($iteam->discount) }} @if (!empty($iteam->tax)) @php $totalTaxRate = 0;@endphp @foreach ($taxes as $tax) @php $taxPrice = App\Models\Utility::taxRate($tax->rate, $iteam->price, $iteam->quantity, $iteam->discount); $totalTaxPrice += $taxPrice; @endphp @endforeach
{{ $tax->name . ' (' . $tax->rate . '%)' }} {{ \Auth::user()->priceFormat($taxPrice) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ \Auth::user()->priceFormat($iteam->price * $iteam->quantity) }}
{{ __('Total') }} {{ $totalQuantity }} {{ \Auth::user()->priceFormat($totalRate) }} {{ \Auth::user()->priceFormat($totalDiscount) }} {{ \Auth::user()->priceFormat($totalTaxPrice) }} {{__('Total')}} {{$totalQuantity}} {{\Auth::user()->priceFormat($totalRate)}} {{\Auth::user()->priceFormat($totalTaxPrice)}} {{\Auth::user()->priceFormat($totalDiscount)}}
{{ __('Sub Total') }} {{ \Auth::user()->priceFormat($proposal->getSubTotal()) }}
{{ __('Discount') }} {{ \Auth::user()->priceFormat($proposal->getTotalDiscount()) }}
{{$taxName}} {{ \Auth::user()->priceFormat($taxPrice) }}
{{ __('Total') }} {{ \Auth::user()->priceFormat($proposal->getTotal()) }}
@endsection