@php $showActions = $showActions ?? true; @endphp
INVOICE
{{ $invoice->invoice_number }}
@if($invoice->status == 'paid') Paid @elseif($invoice->status == 'overdue') Overdue @elseif($invoice->status == 'pending') Pending @else {{ ucfirst($invoice->status) }} @endif
{{-- Container ID --}}
Container ID
@if($invoice->container && $invoice->container->container_number) {{ $invoice->container->container_number }} @elseif($invoice->container_id) {{ $invoice->container_id }} @else N/A @endif
{{-- छोटा arrow --}}
{{-- Invoice Date --}}
Invoice Date
{{ \Carbon\Carbon::parse($invoice->invoice_date)->format('M d, Y') }}
{{-- दुसरा arrow --}}
{{-- Due Date --}}
Due Date
{{ \Carbon\Carbon::parse($invoice->due_date)->format('M d, Y') }}
Customer Details
{{ $invoice->customer_name }}
@if($invoice->company_name)
Company: {{ $invoice->company_name }}
@endif
Mobile: {{ $invoice->customer_mobile }}
Email: {{ $invoice->customer_email ?: ($invoice->customer->email ?? '-') }}
Address:
{{ $invoice->customer_address ?: ($invoice->customer->address ?? '-') }}
Pincode: {{ $invoice->pincode ?: ($invoice->customer->pincode ?? '-') }}
@php $isEmbedded = isset($embedded) && $embedded; @endphp
Invoice Items
@foreach($invoice->items as $i => $item) @php $alreadyGrouped = in_array($item->id, $groupedItemIds ?? []); @endphp @if($isEmbedded) @else @endif @endforeach @if($invoice->items->isEmpty()) @endif
# Description CTN QTY TTL/QTY Unit Price TTL Amount CBM TTL CBM KG TTL KG Shop No
{{ $i + 1 }} {{ $item->description }} {{ $item->ctn }} {{ $item->qty }} {{ $item->ttl_qty }} {{ $item->unit }} ₹{{ number_format($item->price, 2) }} ₹{{ number_format($item->ttl_amount, 2) }} {{ $item->cbm }} {{ $item->ttl_cbm }} {{ $item->kg }} {{ $item->ttl_kg }} {{ $item->shop_no }}

No invoice items found.
{{-- Items pagination bar --}}
Showing 0 to 0 of 0 items
Selected items for charge group: 0
@if($isEmbedded)
@endif
Create Charge Group for Selected Items
@csrf
{{-- Hidden fields (controller validate साठी names match केलेत) --}} {{-- itemids[] हे JS मधून append होतात (checkbox selected items) --}}
Total basis value
0
Select basis to see total TTLQTY, CBM, KG or Amount.
Total charges (admin input)
Suggested Rate × basis: 0
# Description QTY TTL QTY CBM TTL CBM KG TTL KG TTL Amount
{{-- ═══════════════════════════ CHARGE GROUPS LIST ═══════════════════════════ --}} @if($invoice->chargeGroups->isNotEmpty())
Charge Groups
@foreach($invoice->chargeGroups as $index => $group) @php // Base total आणि GST calculation $groupBaseTotal = $group->total_charge ?? 0; $groupTotalWithGst = $group->total_with_gst ?? $groupBaseTotal; $groupGstAmount = max(0, $groupTotalWithGst - $groupBaseTotal); $groupGstPercent = $group->gst_percent ?? 0; @endphp {{-- Main group row --}} {{-- Base total without GST --}} {{-- GST % --}} {{-- Group tax type --}} {{-- Group total with GST --}} {{-- Hidden items row --}} @endforeach
# Group Name Basis Basis Value Rate Total Charge GST % Tax Type Total With GST Action
{{ $index + 1 }} {{ $group->group_name ?? 'Group '.$group->id }} {{ $group->basis_type }} {{ number_format($group->basis_value, 3) }} {{ number_format($group->rate, 2) }} ₹{{ number_format($groupBaseTotal, 2) }} {{ number_format($groupGstPercent, 2) }}% {{ $group->tax_type ?? '-' }} ₹{{ number_format($groupTotalWithGst, 2) }}
Items in this group (GST: {{ number_format($groupGstPercent ?? 0, 2) }}%)
@if($group->items->isEmpty())
No items linked.
@else
{{-- नवीन GST % कॉलम --}} @foreach($group->items as $giIndex => $gi) @php $it = $gi->item; $rate = $group->rate; $itemBasis = 0; switch ($group->basis_type) { case 'ttl_qty': $itemBasis = $it->ttl_qty ?? 0; break; case 'amount': $itemBasis = $it->ttl_amount ?? 0; break; case 'ttl_cbm': $itemBasis = $it->ttl_cbm ?? 0; break; case 'ttl_kg': $itemBasis = $it->ttl_kg ?? 0; break; } $itemTotal = $itemBasis * $rate; // Per‑item GST share (proportional) $itemGst = 0; $itemTotalWithGst = $itemTotal; if ($groupBaseTotal > 0 && $groupGstAmount > 0) { $share = $itemTotal / $groupBaseTotal; $itemGst = $groupGstAmount * $share; $itemTotalWithGst = $itemTotal + $itemGst; } $itemGstPercent = $groupGstPercent ?? 0; // same as group @endphp {{-- GST % (per item = group GST %) --}} @endforeach
# Description QTY TTL QTY CBM TTL CBM KG TTL KG TTL Amount Rate Total ChargeGST % Item GST Item Total (with GST)
{{ $giIndex + 1 }} {{ $it->description }} {{ $it->qty }} {{ $it->ttl_qty }} {{ $it->cbm }} {{ $it->ttl_cbm }} {{ $it->kg }} {{ $it->ttl_kg }} {{ number_format($it->ttl_amount, 2) }} {{ number_format($rate, 2) }} {{ number_format($itemTotal, 2) }} {{ number_format($itemGstPercent, 2) }}% {{ $itemGst > 0 ? number_format($itemGst, 2) : '0.00' }} {{ number_format($itemTotalWithGst, 2) }}
@endif
@endif {{-- ===== FINAL SUMMARY (POPUP) ===== --}}
Final Summary
@php // Base amount (without GST) – invoice level $baseAmount = $invoice->final_amount; // items + groups base, जर तू तसे ठेवले असेल $gstAmount = $invoice->gst_amount; // total GST $groupsWithGst = $invoice->chargeGroups->sum('total_with_gst'); // सर्व charge groups with GST @endphp {{-- Total Charge (Before GST) --}}
Total Charge (Before GST) ₹{{ number_format($baseAmount, 2) }}
{{-- GST Amount (total) --}}
GST Amount ₹{{ number_format($gstAmount, 2) }}
{{-- Charge Groups Total (with GST) --}}
Charge Groups Total (with GST) ₹{{ number_format($groupsWithGst, 2) }}
{{--
Total Charge With GST ₹{{ number_format($invoice->final_amount_with_gst, 2) }}
--}}