@if ($filter_from_date && $filter_to_date)
| {{ __('Date') }} | {{ __('Invoice') }} | {{ __('Customer') }} | {{ __('Total Amount') }} | {{ __('Payment Method') }} | {{ __('Discount') }} | @foreach ($vats as $vat){{ $vat->name }} | @endforeach
|---|---|---|---|---|---|---|
| {{ formatted_date($sale->created_at) }} | {{ $sale->invoiceNumber }} | {{ $sale->party->name ?? '' }} | {{ currency_format($sale->totalAmount, currency: business_currency()) }} | @if ($sale->transactions && $sale->transactions->isNotEmpty()) {{ $sale->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 ($sale->payment_type_id) {{ $sale->payment_type?->name }} @else {{ $sale->paymentType }} @endif | {{ currency_format($sale->discountAmount, currency: business_currency()) }} | @foreach ($vats as $vat){{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }} | @endforeach
| {{ __('Total') }} | {{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }} | {{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }} | @foreach ($vats as $vat){{ currency_format($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }} | @endforeach