update marketing
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 11:55:22 +07:00
parent f80fcc4c1b
commit 05fd3230b8
448 changed files with 17545 additions and 5128 deletions

View File

@@ -12,6 +12,7 @@
@endif
</div>
@endif
<div class="responsive-table tax-report-table m-0">
<table class="table dashboard-table-content">
<thead class="thead-light">
@@ -19,30 +20,36 @@
<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 }}</th>
<th class="text-center">{{ $vat->name . '@' . $vat->rate . '%' }}</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 }}
@@ -50,37 +57,70 @@
{{ $sale->paymentType }}
@endif
</td>
<td class="text-center d-print-none">
{{ currency_format($sale->discountAmount, currency: business_currency()) }}</td>
{{ currency_format($sale->discountAmount, currency: business_currency()) }}
</td>
{{-- VAT Columns --}}
@foreach ($vats as $vat)
<td class="text-center">
{{ $sale->vat_id == $vat->id ? currency_format($sale->vat_amount, currency: business_currency()) : '0' }}
@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>
@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($salesVatTotals[$vat->id] ?? 0, currency: business_currency()) }}
{{ currency_format($grandVatTotal, currency: business_currency()) }}
</td>
@endforeach
</tr>
@endif
</table>
</div>
<div class="mt-3">
{{ $sales->appends(['tab' => 'sales'])->links('vendor.pagination.bootstrap-5') }}
{{ $sales->links('vendor.pagination.bootstrap-5') }}
</div>