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

CREDIT REPORT
@if(!$is_pdf)
Reset
@endif @php $grandBalance = 0; @endphp @foreach($grouped as $groupKey => $transactions) @php $first = $transactions->first(); $last = $transactions->last(); $rowCount = $transactions->count(); $dynamicTotal = $first->pay_amount + $first->remaining_amount; @endphp @foreach($transactions as $index => $txn) {{-- Show shared info only once using rowspan --}} @if($index === 0) @endif {{-- Transaction Date --}} {{-- Payment Details --}} {{-- Total --}} {{-- Paid --}} {{-- Balance --}} @php $dynamicTotal = $txn->remaining_amount; @endphp @endforeach @endforeach {{-- Grand Total --}}
Order No Rec No Order Date Customer Phone Transaction Date Payment Details Total Paid Balance
{{ $txn->order_code }} {{ $txn->rec_no }} {{ \Carbon\Carbon::parse($txn->order_date)->format('d-m-Y') }} {{ $txn->customer_name }} {{ $txn->mobile }} {{ $txn->transaction_date ? \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
{{ number_format($dynamicTotal, 2) }}{{ number_format($txn->pay_amount ?? 0, 2) }} @if($txn === $last) {{ number_format($txn->remaining_amount ?? 0, 2) }} @php $grandBalance += $txn->remaining_amount ?? 0; @endphp @else - @endif
Total Balance: {{ number_format($grandBalance, 2) }}

@if(!$is_pdf) Download @endif