@foreach ($vats as $vat) @endforeach @if (Request::get('type') == 'sales') @foreach ($sales as $sale) @foreach ($vats as $vat) @endforeach @endforeach @if ($sales->count() > 0) @foreach ($vats as $vat) @endforeach @endif @endif @if (Request::get('type') == 'purchases') @foreach ($purchases as $purchase) @foreach ($vats as $vat) @endforeach @endforeach @if ($purchases->count() > 0) @foreach ($vats as $vat) @endforeach @endif @endif
{{ __('Date') }} {{ __('Invoice') }} {{ __('Customer') }} {{ __('Total Amount') }} {{ __('Payment Method') }} {{ __('Discount') }}{{ $vat->name }}
{{ 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()) }}{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}
{{ 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()) }}{{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }}