finishing to dev
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m41s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 42s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 22:50:44 +07:00
parent 2fabdf8fc9
commit 8307b9e66d
212 changed files with 2451 additions and 4493 deletions

View File

@@ -12,7 +12,6 @@
@endif
</div>
@endif
<div class="responsive-table tax-report-table m-0">
<table class="table dashboard-table-content">
<thead class="thead-light">
@@ -20,36 +19,30 @@
<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">{{ __('Customer') }}</th>
<th class="text-center" scope="col">{{ __('Tax Number') }}</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 . '@' . $vat->rate . '%' }}</th>
<th class="text-center">{{ $vat->name }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($sales as $sale)
<tr>
<td class="text-start">{{ formatted_date($sale->created_at) }}</td>
<td class="text-center d-print-none">{{ $sale->invoiceNumber }}</td>
<td class="text-center">{{ $sale->party->name ?? '' }}</td>
<td class="text-center">{{ $sale->party->tax_no ?? '' }}</td>
<td class="text-center">
{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</td>
<td class="text-center d-print-none">
@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])
: '';
return $transaction->transaction_type ? ucfirst(explode('_', $transaction->transaction_type)[0]) : '';
})->unique()->implode(', ') }}
@elseif ($sale->payment_type_id)
{{ $sale->payment_type?->name }}
@@ -57,70 +50,37 @@
{{ $sale->paymentType }}
@endif
</td>
<td class="text-center d-print-none">
{{ currency_format($sale->discountAmount, currency: business_currency()) }}
</td>
{{-- VAT Columns --}}
{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
@foreach ($vats as $vat)
@php
// Product VAT
$productVat = $saleVatRowMap[$sale->id][$vat->id] ?? 0;
// Returned VAT
$returnVat = $saleReturnVatRowMap[$sale->id][$vat->id] ?? 0;
// Invoice VAT
$invoiceVat = ($sale->vat_id == $vat->id) ? $sale->vat_amount : 0;
// Final VAT
$totalVat = $productVat + $invoiceVat - $returnVat;
@endphp
<td @class(['text-center','fw-bold' => $totalVat > 0])>
{{ currency_format($totalVat, currency: business_currency()) }}
<td class="text-center">
{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}
</td>
@endforeach
</tr>
@endforeach
</tbody>
@if ($sales->count() > 0)
<tr class="table-footer">
<td class="text-start fw-bold">{{ __('Total') }}</td>
<td class="d-print-none"></td>
<td></td>
<td></td>
<td class="text-center fw-bold">
{{ currency_format($sales->sum('totalAmount'), currency: business_currency()) }}
</td>
<td class="d-print-none"></td>
<td class="text-center fw-bold d-print-none">
{{ currency_format($sales->sum('discountAmount'), currency: business_currency()) }}
</td>
{{-- VAT Totals --}}
@foreach ($vats as $vat)
@php
$grandVatTotal = (($salesVatTotals[$vat->id] ?? 0)
- ($salesReturnVatTotals[$vat->id] ?? 0))
+ $sales->where('vat_id', $vat->id)->sum('vat_amount');
@endphp
<td class="text-center fw-bold">
{{ currency_format($grandVatTotal, currency: business_currency()) }}
{{ currency_format($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
</td>
@endforeach
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $sales->links('vendor.pagination.bootstrap-5') }}
{{ $sales->appends(['tab' => 'sales'])->links('vendor.pagination.bootstrap-5') }}
</div>