{{-- --}} Invoice

{{$addedInvoice->branch->company->name}}

{{$addedInvoice->branch->company->address}},
Mail -{{$addedInvoice->branch->company->email}}
GST No - {{$addedInvoice->branch->gst_no ?? ''}}
Contact No: {{ $addedInvoice->branch->company->phone ?? ''}}
To: {{$addedInvoice->client->user->name ?? ''}}
Address: @php $address = $addedInvoice->client->clientAddress->where('oprtnl_flag','A')->value('address') @endphp {{$address ?? ''}}
Payment Terms: @if($addedInvoice->payments->isNotEmpty()) @foreach($addedInvoice->payments as $payment) @if($payment->mode) {{ $payment->mode->name }} @else N/A
@endif @endforeach @else N/A @endif
Bill No: {{ $addedInvoice->invoice_id ?? ''}}
Date: {{ $addedInvoice->invoice_date ? \Carbon\Carbon::parse($addedInvoice->invoice_date)->format('d-m-Y') : '' }}
@php $subtotal = 0; $pageSubtotal = 0; $pageCount = 0; @endphp @foreach ($addedInvoice->invoiceItems as $index => $product) @php $orderItem = isset($addedInvoice->order) ? $addedInvoice->order->ordersItem->firstWhere('product_id', $product->product_id):$addedInvoice->quote->quotesItem->firstWhere('product_id', $product->product_id); $total = $product->quantity * $product->price; $gstAmount = ($product->total * $product->invoiceItemTaxes->sum('tax')) / 100; $totalWithGst = $total + $gstAmount; $subtotal += $totalWithGst; $pageSubtotal += $totalWithGst; @endphp @if (($index + 1) % 25 == 0)
S.No Description HSN Code C.Qty Qty Rate GST(%) Total
{{ $index + 1 }} {{ $product->product_name ?? '' }} {{ $product->products->code}} @if ($orderItem) {{ $orderItem->quantity . ' (' . optional($orderItem->product->category->unitOfMass)->name . ')' }} @else Not in Order @endif {{ $product->quantity . '(' . ($product->products->category->unitOfMass->name ?? '') . ')' ?? '' }} ₹ {{ number_format($product->price ?? '', 2) }} {{ number_format($product->invoiceItemTaxes->sum('tax') ?: 0, 2) }} @php $gstAmount = ($product->total * $product->invoiceItemTaxes->sum('tax')) / 100; $total = $product->total + $gstAmount; @endphp ₹ {{ number_format($total, 2) }}

...Continue

{{$addedInvoice->branch->company->name}}

{{$addedInvoice->branch->company->address}},
Mail -{{$addedInvoice->branch->company->email}}
GST No - {{$addedInvoice->branch->gst_no ?? ''}}
Contact No: {{ $addedInvoice->branch->company->phone ?? ''}}
To: {{$addedInvoice->client->user->name ?? ''}}
Address: {{$address ?? ''}}
Payment Terms: {{$addedInvoice->due_date ? \Carbon\Carbon::parse($addedInvoice->due_date)->format('d-m-Y') : ''}}
Bill No: {{ $addedInvoice->invoice_id ?? ''}}
Date: {{ $addedInvoice->invoice_date ? \Carbon\Carbon::parse($addedInvoice->invoice_date)->format('d-m-Y') : '' }}
@php $pageSubtotal = 0; $pageCount++; @endphp @endif @endforeach
S.No Description HSN Code C.Qty Qty Rate GST(%) Total