{{__('Proposal')}}
{{!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:''}}
{{!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 {{__('Tax Number ')}} : {{!empty($customer->tax_number)?$customer->tax_number:'--'}} @endif
@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
{{$user->dateFormat($proposal->issue_date)}}
{{!empty($proposal->customField)?$proposal->customField[$field->id]:'-'}}
| # | {{ __('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) }} | ||||||