@if ($filter_from_date && $filter_to_date)
| {{ __('Date') }} | {{ __('Invoice') }} | {{ __('Supplier') }} | {{ __('Total Amount') }} | {{ __('Payment Method') }} | {{ __('Discount') }} | @foreach ($vats as $vat){{ $vat->name }} | @endforeach
|---|---|---|---|---|---|---|
| {{ formatted_date($purchase->created_at) }} | {{ $purchase->invoiceNumber }} | {{ $purchase->party->name ?? '' }} | {{ currency_format($purchase->totalAmount, 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 | {{ currency_format($purchase->discountAmount, currency: business_currency()) }} | @foreach ($vats as $vat){{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }} | @endforeach
| {{ __('Total') }} | {{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }} | {{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }} @foreach ($vats as $vat) | {{ currency_format($purchasesVatTotals[$vat->id] ?? 0, currency: business_currency()) }} | @endforeach