@extends('layouts.admin') @section('page-title') {{__('Proposal Detail')}} @endsection @php $settings = Utility::settings(); $creatorId = \Auth::user()->creatorId(); $company_state = strtolower(trim($settings['company_state'] ?? 'defaultstate')); $customer_state = strtolower(trim($customer->billing_state ?? '')); $isSameState = $company_state === $customer_state; @endphp @push('script-page') @endpush @section('breadcrumb') @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)
@endif @else
@endif

{{__('Proposal')}}

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


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

{{__('Billed To')}} :
@if(!empty($customer->billing_name)) {{!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($settings['vat_gst_number_switch'] == 'on') @if(!empty($settings['tax_type']) && !empty($settings['vat_number'])){{$settings['tax_type'].' '. __('Number')}} : {{$settings['vat_number']}}
@endif {{__('Tax Number ')}} : {{!empty($customer->tax_number)?$customer->tax_number:''}} @endif @else - @endif
@if(App\Models\Utility::getValByName('shipping_display')=='on')
{{__('Shipped To')}} :
@if(!empty($customer->shipping_name)) {{!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:''}}
@else - @endif
@endif
@if($settings['qr_display'] == 'on') {!! DNS2D::getBarcodeHTML(route('proposal.link.copy',\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 iteams here cannot be deleted.')}}
@php $totalQuantity = 0; $totalPrice = 0; $totalTaxPrice = 0; $totalDiscount = 0; $taxesData = []; @endphp @foreach ($iteams as $key => $iteam) @php $productName = $iteam->product; $totalQuantity += $iteam->quantity; $totalPrice += $iteam->price; $totalDiscount += $iteam->discount; $taxableAmount = ($iteam->price * $iteam->quantity) - $iteam->discount; $iteamTaxPrice = 0; @endphp @php $totalTaxPrice += $iteamTaxPrice; @endphp @endforeach @if (!empty($taxSummary)) @foreach ($taxSummary as $taxName => $taxPrice) @endforeach @endif
# {{__('Product')}} {{__('Quantity')}} {{__('Rate')}} {{__('Discount')}} {{__('Tax')}} {{__('Description')}} {{__('Price')}}
{{__('after tax & discount')}}
{{ $key + 1 }} {{ !empty($productName) ? $productName->name : '' }} {{ $iteam->quantity . ' (' . ($productName->unit->name ?? '') . ')' }} {{ \Auth::user()->priceFormat($iteam->price) }} {{ \Auth::user()->priceFormat($iteam->discount) }} @php $taxData = json_decode($iteam->tax, true); if (!is_array($taxData) && !empty($iteam->tax)) { $taxData = explode(',', $iteam->tax); } $iteamTaxPrice = 0; $taxRates = []; $taxDetails = []; $taxableAmount = ($iteam->price - $iteam->discount) * $iteam->quantity; @endphp @if (!empty($taxData)) @foreach (array_unique($taxData) as $taxId) @php $tax = \App\Models\Tax::find((int) trim($taxId)); if ($tax) { $taxRates[] = floatval($tax->rate); $taxDetails[] = $tax; } @endphp @endforeach @php $totalRate = array_sum($taxRates); $totalTaxAmount = ($taxableAmount * $totalRate) / 100; $iteamTaxPrice += $totalTaxAmount; @endphp @if (strtolower($tax_type) === 'vat') @php $taxSummary['VAT'] = ($taxSummary['VAT'] ?? 0) + $totalTaxAmount; @endphp
VAT ({{ $totalRate }}%) - ₹{{ number_format($totalTaxAmount, 2) }}
@elseif (strtolower($tax_type) === 'gst') @if ($isSameState) @php $halfRate = $totalRate / 2; $halfAmount = $totalTaxAmount / 2; $taxSummary['CGST'] = ($taxSummary['CGST'] ?? 0) + $halfAmount; $taxSummary['SGST'] = ($taxSummary['SGST'] ?? 0) + $halfAmount; @endphp
CGST ({{ $halfRate }}%) - ₹{{ number_format($halfAmount, 2) }}
SGST ({{ $halfRate }}%) - ₹{{ number_format($halfAmount, 2) }}
@else @php $taxSummary['IGST'] = ($taxSummary['IGST'] ?? 0) + $totalTaxAmount; @endphp
IGST ({{ $totalRate }}%) - ₹{{ number_format($totalTaxAmount, 2) }}
@endif @endif @else
@endif
{{ !empty($iteam->description) ? $iteam->description : '-' }} {{ \Auth::user()->priceFormat($taxableAmount + $iteamTaxPrice) }}
{{__('Total')}} {{ $totalQuantity }} {{ \Auth::user()->priceFormat($totalPrice) }} {{ \Auth::user()->priceFormat($totalDiscount) }} {{ \Auth::user()->priceFormat($totalTaxPrice) }}
{{__('Sub Total')}} {{ \Auth::user()->priceFormat($proposal->getSubTotal()) }}
{{__('Discount')}} {{ \Auth::user()->priceFormat($proposal->getTotalDiscount()) }}
{{ $taxName }} {{ \Auth::user()->priceFormat($taxPrice) }}
{{__('Total')}} {{ \Auth::user()->priceFormat($taxableAmount + $iteamTaxPrice) }}
@endsection