{{__('Proposal')}}


@if(!empty($customer->billing_name))
{{__('Billed To')}} :
{{!empty($customer->billing_name)?$customer->billing_name:''}}
{{!empty($customer->billing_phone)?$customer->billing_phone:''}}
{{!empty($customer->billing_address)?$customer->billing_address:''}}
{{!empty($customer->billing_zip)?$customer->billing_zip:''}}
{{!empty($customer->billing_city)?$customer->billing_city:'' .', '}} {{!empty($customer->billing_state)?$customer->billing_state:'',', '}} {{!empty($customer->billing_country)?$customer->billing_country:''}}
@endif @if(\Utility::companyData($proposal->created_by,'shipping_display')=='on')
{{__('Shipped To')}} :
{{!empty($customer->shipping_name)?$customer->shipping_name:''}}
{{!empty($customer->shipping_phone)?$customer->shipping_phone:''}}
{{!empty($customer->shipping_address)?$customer->shipping_address:''}}
{{!empty($customer->shipping_zip)?$customer->shipping_zip:''}}
{{!empty($customer->shipping_city)?$customer->shipping_city:'' . ', '}} {{!empty($customer->shipping_state)?$customer->shipping_state:'' .', '}},{{!empty($customer->shipping_country)?$customer->shipping_country:''}}
@endif
@if (isset($settings['qr_display']) && $settings['qr_display'] == 'on') {!! DNS2D::getBarcodeHTML(route('proposal.link.copy',\Illuminate\Support\Facades\Crypt::encrypt($proposal->id)), "QRCODE",2,2) !!} @endif
@if($company_setting['vat_gst_number_switch'] == 'on') @if(!empty($company_setting['tax_type']) && !empty($company_setting['vat_number'])){{$company_setting['tax_type'].' '. __('Number')}} : {{$company_setting['vat_number']}}
@endif {{__('Tax Number ')}} : {{!empty($customer->tax_number)?$customer->tax_number:'--'}} @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
{{__('Issue Date')}} :
{{$user->dateFormat($proposal->issue_date)}}

@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; $totalPrice = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxSummary = []; @endphp @if(!empty($iteams) && (is_array($iteams) || $iteams->count() > 0)) @foreach ($iteams as $key => $item) @php $productName = !empty($item->product) ? $item->product : null; $quantity = $item->quantity ?? 0; $price = $item->price ?? 0; $discount = $item->discount ?? 0; $taxableAmount = ($price * $quantity) - $discount; $itemTaxPrice = 0; $totalQuantity += $quantity; $totalPrice += $price * $quantity; $totalDiscount += $discount; @endphp @endforeach @else @endif @if (!empty($taxSummary)) @foreach ($taxSummary as $taxName => $taxPrice) @endforeach @endif
# {{ __('Product') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Discount') }} {{ __('Tax') }} {{ __('Description') }} {{ __('Price') }}
{{ __('after tax & discount') }}
{{ $key + 1 }} {{ $productName && !empty($productName->name) ? $productName->name : '-' }} {{ $quantity . ' (' . ($productName && !empty($productName->unit) && !empty($productName->unit->name) ? $productName->unit->name : '') . ')' }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $price) : number_format($price, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $discount) : number_format($discount, 2) }} @php try { $taxData = !empty($item->tax) ? (is_string($item->tax) ? json_decode($item->tax, true, 512, JSON_INVALID_UTF8_IGNORE) : $item->tax) : []; if (!is_array($taxData)) { $taxData = !empty($item->tax) && is_string($item->tax) ? array_filter(explode(',', $item->tax)) : []; } } catch (\Exception $e) { \Log::error('Tax Parsing Error', [ 'item_id' => $item->id ?? 'unknown', 'tax' => $item->tax ?? null, 'error' => $e->getMessage() ]); $taxData = []; } $taxRates = []; $taxDetails = []; foreach (array_unique($taxData) as $taxId) { $tax = \App\Models\Tax::find((int) trim($taxId)); if ($tax && !empty($tax->rate)) { $taxRates[] = floatval($tax->rate); $taxDetails[] = $tax; } } $totalRate = array_sum($taxRates); $totalTaxAmount = ($taxableAmount * $totalRate) / 100; $itemTaxPrice += $totalTaxAmount; $totalTaxPrice += $totalTaxAmount; @endphp @if (!empty($taxData)) @if (!empty($settings['tax_type']) && strtolower($settings['tax_type']) === 'vat') @php $taxSummary['VAT'] = ($taxSummary['VAT'] ?? 0) + $totalTaxAmount; @endphp
VAT ({{ number_format($totalRate, 2) }}%) - {{ \App\Models\Utility::priceFormat($settings, $totalTaxAmount) }}
@else @if (isset($isSameState) && $isSameState) @php $halfRate = $totalRate / 2; $halfAmount = $totalTaxAmount / 2; $taxSummary['CGST'] = ($taxSummary['CGST'] ?? 0) + $halfAmount; $taxSummary['SGST'] = ($taxSummary['SGST'] ?? 0) + $halfAmount; @endphp
CGST ({{ number_format($halfRate, 2) }}%)
SGST ({{ number_format($halfRate, 2) }}%)
@else @php $taxSummary['IGST'] = ($taxSummary['IGST'] ?? 0) + $totalTaxAmount; @endphp
IGST ({{ number_format($totalRate, 2) }}%) - {{ \App\Models\Utility::priceFormat($settings, $totalTaxAmount) }}
@endif @endif @else
@endif
{{ !empty($item->description) ? $item->description : '-' }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $taxableAmount + $itemTaxPrice) : number_format($taxableAmount + $itemTaxPrice, 2) }}
{{ __('No items found.') }}
{{ __('Total') }} {{ $totalQuantity }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalPrice) : number_format($totalPrice, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalDiscount) : number_format($totalDiscount, 2) }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $totalTaxPrice) : number_format($totalTaxPrice, 2) }}
{{ __('Sub Total') }} {{ isset($settings) && isset($proposal) ? \App\Models\Utility::priceFormat($settings, $proposal->getSubTotal() ?? 0) : '0.00' }}
{{ __('Discount') }} {{ isset($settings) && isset($proposal) ? \App\Models\Utility::priceFormat($settings, $proposal->getTotalDiscount() ?? 0) : '0.00' }}
{{ $taxName }} {{ isset($settings) ? \App\Models\Utility::priceFormat($settings, $taxPrice) : '0.00' }}
{{ __('Total') }} {{ !empty($settings) ? \App\Models\Utility::priceFormat($settings, $taxableAmount + $itemTaxPrice) : number_format($taxableAmount + $itemTaxPrice, 2) }}