@php
$subTotal = 0;
$hasValue = fn($value) => !empty($value) && $value > 0;
@endphp
{{-- Products --}}
@foreach ($quotation->products as $product)
@php
$subTotal += $product->amount;
@endphp
| {{ $product->product_name ?? '' }} |
{{ $product->description }} |
{{ $product->master->value ?? 'N/A' }} |
₹{{ number_format($product->rate, 2) }} |
{{ $product->quantity }} |
@if ($quotation->discount_type == 3)
{{ $product->discount ?? 0 }}%
@elseif($quotation->discount_type == 4)
₹{{ number_format($product->discount ?? 0, 2) }}
@else
{{ $product->discount ?? 0 }}
@endif
|
₹{{ number_format($product->amount, 2) }}
|
@endforeach
{{-- Divider --}}
{{--
|
--}}
{{-- Subtotal --}}
|
|
Sub Total : |
₹{{ number_format($subTotal, 2) }}
|
{{-- Overall Discount Amount (Only show for discount_type = 1) --}}
@if ($quotation->discount_type == 1 && $hasValue($quotation->overall_discount_amount))
|
|
Overall Discount : |
-
₹{{ number_format($quotation->overall_discount_amount, 2) }}
|
@endif
{{-- Discount Percentage (Only show for discount_type = 1) --}}
@if ($quotation->discount_type == 1 && $hasValue($quotation->discount))
|
|
Discount % : |
{{ $quotation->discount }}%
|
@endif
{{-- Additional Charges (Single Field) --}}
@if ($hasValue($quotation->additional_charges))
|
|
Additional Charges :
|
₹{{ number_format($quotation->additional_charges, 2) }}
|
@endif
{{-- Dynamic Charges --}}
@foreach ($quotation->charges as $charge)
@if ($hasValue($charge->amount))
|
|
{{ $charge->otherCharge->name ?? 'Charge' }} :
|
₹{{ number_format($charge->amount, 2) }}
|
@endif
@endforeach
{{-- Tax --}}
@if ($hasValue($quotation->total_tax_amount))
|
|
Total Tax : |
₹{{ number_format($quotation->total_tax_amount, 2) }}
|
@endif
{{-- Round Off --}}
@if (isset($quotation->roundoff) && $quotation->roundoff != 0)
|
|
Round Off : |
₹{{ number_format($quotation->roundoff, 2) }}
|
@endif
{{-- Final Divider --}}
{{--
|
--}}
{{-- Grand Total --}}
|
|
Grand Total :
|
₹{{ number_format($quotation->total_amount ?? 0, 2) }}
|