@extends('layouts.invoicepayheader') @section('page-title') {{ __('Proposal Detail') }} @endsection @push('script-page') @endpush @section('action-btn') @if (\Auth::check() && isset(\Auth::user()->type) && \Auth::user()->type == 'company') @if ($proposal->status != 0)
@endif @else
@endif @endsection @section('content')

{{ __('Proposal') }}

{{ __('Issue Date') }} : {{ company_date_formate($proposal->issue_date, $proposal->created_by, $proposal->workspace) }}

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

{{ __('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 ($item as $key => $iteam) @if (!empty($iteam->tax)) @php $taxes = \Workdo\ProductService\Entities\Tax::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, $proposal->created_by, $proposal->workspace) }} {{ currency_format_with_sym($iteam->discount, $proposal->created_by, $proposal->workspace) }} @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, $proposal->created_by, $proposal->workspace) }}
@else - @endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ currency_format_with_sym($iteam->price * $iteam->quantity - $iteam->discount + $tr_tex, $proposal->created_by, $proposal->workspace) }}
{{ __('Total') }}{{ $totalQuantity }} {{ currency_format_with_sym($totalRate, $proposal->created_by, $proposal->workspace) }} {{ currency_format_with_sym($totalDiscount, $proposal->created_by, $proposal->workspace) }} {{ currency_format_with_sym($totalTaxPrice, $proposal->created_by, $proposal->workspace) }}
{{ __('Sub Total') }} {{ currency_format_with_sym($proposal->getSubTotal(), $proposal->created_by, $proposal->workspace) }}
{{ __('Discount') }} {{ currency_format_with_sym($proposal->getTotalDiscount(), $proposal->created_by, $proposal->workspace) }}
{{ $taxName }} {{ currency_format_with_sym($taxPrice, $proposal->created_by, $proposal->workspace) }}
{{ __('Total') }} {{ currency_format_with_sym($proposal->getTotal(), $proposal->created_by, $proposal->workspace) }}
@endsection