@if (auth()->user()->accessToMultiBranch()) @endif @foreach ($purchases as $purchase) @if (auth()->user()->accessToMultiBranch()) @endif @endforeach @if ($purchases->count() > 0) @if (auth()->user()->accessToMultiBranch()) @endif @endif
{{ __('SL') }}.{{ __('Branch') }}{{ __('Invoice No') }} {{ __('Party Name') }} {{ __('Total') }} {{ __('Discount') }} {{ __('Paid') }} {{ __('Due') }} {{ __('Vat') }} {{ __('Payment Type') }} {{ __('Purchase Date') }}
{{ $loop->iteration }}{{ $purchase->branch->name ?? '' }}{{ $purchase->invoiceNumber }} {{ $purchase->party?->name }} {{ currency_format($purchase->totalAmount, currency: business_currency()) }} {{ currency_format($purchase->discountAmount, currency: business_currency()) }} {{ currency_format($purchase->paidAmount, currency: business_currency()) }} {{ currency_format($purchase->dueAmount, currency: business_currency()) }} {{ currency_format($purchase->vat_amount, currency: business_currency()) }} @if ($purchase->transactions && $purchase->transactions->isNotEmpty()) {{ $purchase->transactions->map(function($transaction) { if ($transaction->transaction_type === 'bank_payment' && !empty($transaction->paymentType?->name)) { return $transaction->paymentType->name; } return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : ''; })->unique()->implode(', ') }} @elseif ($purchase->payment_type_id) {{ $purchase->payment_type?->name }} @else {{ $purchase->paymentType }} @endif {{ formatted_date($purchase->purchaseDate) }}