Files
kulakpos_web/Modules/Business/resources/views/reports/vats/purchase-datas.blade.php

82 lines
4.3 KiB
PHP

@if ($filter_from_date && $filter_to_date)
<div class="mb-2 text-center fw-bold duration-display">
<strong>{{ __('Duration:') }}</strong>
@if ($duration === 'today')
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
@elseif ($duration === 'yesterday')
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
@else
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
{{ __('to') }}
{{ Carbon\Carbon::parse($filter_to_date)->format('d-m-Y') }}
@endif
</div>
@endif
<div class="responsive-table tax-report-table m-0">
<table class="table dashboard-table-content">
<thead class="thead-light">
<tr>
<th class="text-start" scope="col">{{ __('Date') }}</th>
<th class="text-center d-print-none" scope="col">{{ __('Invoice') }}</th>
<th class="text-center" scope="col">{{ __('Supplier') }}</th>
<th class="text-center" scope="col">{{ __('Total Amount') }}</th>
<th class="text-center d-print-none" scope="col">{{ __('Payment Method') }}</th>
<th class="text-center d-print-none" scope="col">{{ __('Discount') }}</th>
@foreach ($vats as $vat)
<th class="text-center">{{ $vat->name }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($purchases as $purchase)
<tr>
<td class="text-start">{{ formatted_date($purchase->created_at) }}</td>
<td class="text-center d-print-none">{{ $purchase->invoiceNumber }}</td>
<td class="text-center">{{ $purchase->party->name ?? '' }}</td>
<td class="text-center">
{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</td>
<td class="text-center d-print-none">
@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
</td>
<td class="text-center d-print-none">
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
@foreach ($vats as $vat)
<td class="text-center">
{{ $purchase->vat_id == $vat->id ? currency_format($purchase->vat_amount, currency: business_currency()) : '0' }}
</td>
@endforeach
</tr>
@endforeach
</tbody>
@if ($purchases->count() > 0)
<tr class="table-footer">
<td class="text-start fw-bold">{{ __('Total') }}</td>
<td class="d-print-none"></td>
<td></td>
<td class="text-center fw-bold">{{ currency_format($purchases->sum('totalAmount'), currency: business_currency()) }}</th>
<td class="d-print-none"></td>
<td class="text-center fw-bold d-print-none">{{ currency_format($purchases->sum('discountAmount'), currency: business_currency()) }}</th>
@foreach ($vats as $vat)
<td class="text-center fw-bold">
{{ currency_format($purchasesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
</td>
@endforeach
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $purchases->appends(['tab' => 'purchases'])->links('vendor.pagination.bootstrap-5') }}
</div>