Logo @if(!$is_pdf) Back @endif
{{ $company->company_name }}
{{ $company->address }}, {{ $company->city }}, {{ $company->state }}
Phone: {{ $company->phone1 }}
GST NO: {{ $company->gst_no }}

BILL NOT UPDATED
@if(!$is_pdf)
Reset
@endif @php $grandBalance = 0; @endphp @foreach($groupedOrders as $order_id => $transactions) @php $first = $transactions->first(); if ($first->payment_status !== 'Partially Paid') continue; $dynamicTotal = $first->order_amount; $rowCount = $transactions->count(); // Get the last transaction of this order group $lastTxn = $transactions->last(); // Add last transaction's remaining amount to grand total $grandBalance += $lastTxn->remaining_amount; @endphp @foreach($transactions as $txn) {{-- Rowspan for shared fields --}} @if($loop->first) @endif {{-- Show balance only in the last row of this order group --}} {{-- Dynamic Payment Info --}} @php $dynamicTotal = $txn->remaining_amount; @endphp @endforeach @endforeach {{-- Grand Total Row --}}
Order No Rec No Customer Name Total Paid Balance Transaction Date Payment Method Receipt Type Remark
{{ $txn->order_code ?? '-' }} {{ $txn->rec_no }} {{ $txn->customer_name ?? '-' }} {{ number_format($dynamicTotal, 2) }} {{ number_format($txn->pay_amount, 2) }} @if($loop->last) {{ number_format($txn->remaining_amount, 2) }} @else - @endif {{ \Carbon\Carbon::parse($txn->transaction_date)->format('d-m-Y') }} @if($txn->payment_mode === 'Bank Transfer') Bank Transfer
Bank Name: {{ $txn->bank_name ?? '-' }}
Ac No: {{ $txn->account_number ?? '-' }}
IFSC Code: {{ $txn->ifsc_code ?? '-' }} @elseif($txn->payment_mode === 'Cheque') Cheque
Cheque No: {{ $txn->cheque_number ?? '-' }} @elseif($txn->payment_mode === 'Online') Online
Txn ID: {{ $txn->reference_id ?? '-' }} @else {{ $txn->payment_mode ?? '-' }} @endif
{{ $txn->receipt_type ?? '-' }} {{ $txn->remark ?? '-' }}
Total Balance: {{ number_format($grandBalance, 2) }}


@if(!$is_pdf) Download @endif