Add the quick sales report
Quick sales of a period by cash day, product, seller and VAT rate, with credits, open cash days flagged, a chart by day or month and CSV. VAT is taken out of each day's total of a rate, as on the cash day balance. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Reports\Application\Contracts;
|
||||
|
||||
use App\Modules\Reports\Application\DTOs\SalesData;
|
||||
use App\Modules\Reports\Domain\ValueObjects\ReportPeriod;
|
||||
|
||||
/**
|
||||
* Quick sales summed by day, product, seller and VAT rate, from the Sales module.
|
||||
*/
|
||||
interface ReportSales
|
||||
{
|
||||
public function between(ReportPeriod $period): SalesData;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Reports\Application\DTOs;
|
||||
|
||||
/**
|
||||
* Quick sales of a period as the Sales module sums them, amounts with VAT
|
||||
* in cents and credits negative.
|
||||
*/
|
||||
final readonly class SalesData
|
||||
{
|
||||
/**
|
||||
* @param list<array{day: string, count: int, cashCents: int, cardCents: int, isClosed: bool}> $days
|
||||
* @param list<array{name: string, quantity: int, grossCents: int}> $products
|
||||
* @param list<array{sellerId: int, count: int, grossCents: int}> $sellers
|
||||
* @param list<array{day: string, vatBasisPoints: int, grossCents: int}> $dayVatTotals
|
||||
*/
|
||||
public function __construct(
|
||||
public array $days,
|
||||
public array $products,
|
||||
public array $sellers,
|
||||
public array $dayVatTotals,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Reports\Application\DTOs;
|
||||
|
||||
/**
|
||||
* Quick sales of a period (spec 13), amounts with VAT in cents and
|
||||
* credits negative: by cash day, product, seller (by name) and VAT rate,
|
||||
* the totals, and a chart series by day or, for longer periods, by month
|
||||
* (label Y-m-d or Y-m → cents).
|
||||
*/
|
||||
final readonly class SalesReport
|
||||
{
|
||||
/**
|
||||
* @param list<array{day: string, count: int, cashCents: int, cardCents: int, totalCents: int, isClosed: bool}> $days
|
||||
* @param list<array{name: string, quantity: int, grossCents: int}> $products
|
||||
* @param list<array{name: string, count: int, grossCents: int}> $sellers
|
||||
* @param list<array{vatBasisPoints: int, grossCents: int, netCents: int, vatCents: int}> $vatTotals
|
||||
* @param array<string, int> $series
|
||||
*/
|
||||
public function __construct(
|
||||
public array $days,
|
||||
public array $products,
|
||||
public array $sellers,
|
||||
public array $vatTotals,
|
||||
public int $count,
|
||||
public int $cashCents,
|
||||
public int $cardCents,
|
||||
public int $openDays,
|
||||
public array $series,
|
||||
public bool $seriesByMonth,
|
||||
) {}
|
||||
|
||||
public function totalCents(): int
|
||||
{
|
||||
return $this->cashCents + $this->cardCents;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Reports\Application\UseCases;
|
||||
|
||||
use App\Modules\Reports\Application\Contracts\ReportPeople;
|
||||
use App\Modules\Reports\Application\Contracts\ReportSales;
|
||||
use App\Modules\Reports\Application\DTOs\SalesReport;
|
||||
use App\Modules\Reports\Domain\ValueObjects\ReportPeriod;
|
||||
use App\Modules\Shared\Domain\ValueObjects\Money;
|
||||
use App\Modules\Shared\Domain\ValueObjects\VatPercentage;
|
||||
|
||||
/**
|
||||
* Quick sales in a period (spec 7, 13). The VAT of a rate is taken out of
|
||||
* each day's total of the rate, as on the cash day balance, and summed
|
||||
* over the days, so the report matches the closed days' balances.
|
||||
*/
|
||||
final readonly class QuickSalesReport
|
||||
{
|
||||
/** Periods longer than this are charted by month. */
|
||||
private const int DAILY_CHART_DAYS = 62;
|
||||
|
||||
public function __construct(
|
||||
private ReportSales $sales,
|
||||
private ReportPeople $people,
|
||||
) {}
|
||||
|
||||
public function execute(ReportPeriod $period): SalesReport
|
||||
{
|
||||
$data = $this->sales->between($period);
|
||||
|
||||
$days = array_map(fn (array $day): array => [...$day, 'totalCents' => $day['cashCents'] + $day['cardCents']], $data->days);
|
||||
|
||||
$names = $this->people->namesByIds(array_map(fn (array $seller): int => $seller['sellerId'], $data->sellers));
|
||||
$sellers = array_map(fn (array $seller): array => [
|
||||
'name' => $names[$seller['sellerId']] ?? '',
|
||||
'count' => $seller['count'],
|
||||
'grossCents' => $seller['grossCents'],
|
||||
], $data->sellers);
|
||||
usort($sellers, fn (array $a, array $b): int => strnatcasecmp($a['name'], $b['name']));
|
||||
|
||||
$byRate = [];
|
||||
foreach ($data->dayVatTotals as $total) {
|
||||
$gross = $total['grossCents'];
|
||||
$net = Money::fromCents(abs($gross))->removeVat(new VatPercentage($total['vatBasisPoints']))->cents;
|
||||
$net = $gross < 0 ? -$net : $net;
|
||||
$rate = $total['vatBasisPoints'];
|
||||
$byRate[$rate] ??= ['vatBasisPoints' => $rate, 'grossCents' => 0, 'netCents' => 0, 'vatCents' => 0];
|
||||
$byRate[$rate]['grossCents'] += $gross;
|
||||
$byRate[$rate]['netCents'] += $net;
|
||||
$byRate[$rate]['vatCents'] += $gross - $net;
|
||||
}
|
||||
krsort($byRate);
|
||||
|
||||
$byMonth = $period->dayCount() > self::DAILY_CHART_DAYS;
|
||||
$series = [];
|
||||
foreach ($days as $day) {
|
||||
$key = $byMonth ? substr($day['day'], 0, 7) : $day['day'];
|
||||
$series[$key] = ($series[$key] ?? 0) + $day['totalCents'];
|
||||
}
|
||||
|
||||
return new SalesReport(
|
||||
$days,
|
||||
$data->products,
|
||||
$sellers,
|
||||
array_values($byRate),
|
||||
array_sum(array_column($days, 'count')),
|
||||
array_sum(array_column($days, 'cashCents')),
|
||||
array_sum(array_column($days, 'cardCents')),
|
||||
count(array_filter($days, fn (array $day): bool => ! $day['isClosed'])),
|
||||
$series,
|
||||
$byMonth,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Reports\Infrastructure\Adapters;
|
||||
|
||||
use App\Modules\Reports\Application\Contracts\ReportSales;
|
||||
use App\Modules\Reports\Application\DTOs\SalesData;
|
||||
use App\Modules\Reports\Domain\ValueObjects\ReportPeriod;
|
||||
use App\Modules\Sales\Application\Contracts\QuickSaleReportQueries;
|
||||
|
||||
/**
|
||||
* Quick sales for reports through the Sales module.
|
||||
*/
|
||||
class SalesForReports implements ReportSales
|
||||
{
|
||||
public function __construct(private QuickSaleReportQueries $queries) {}
|
||||
|
||||
public function between(ReportPeriod $period): SalesData
|
||||
{
|
||||
$sales = $this->queries->between($period->from, $period->to);
|
||||
|
||||
return new SalesData($sales->days, $sales->products, $sales->sellers, $sales->dayVatTotals);
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,12 @@ use App\Modules\Reports\Application\Contracts\ReportCatalog;
|
||||
use App\Modules\Reports\Application\Contracts\ReportHours;
|
||||
use App\Modules\Reports\Application\Contracts\ReportJobs;
|
||||
use App\Modules\Reports\Application\Contracts\ReportPeople;
|
||||
use App\Modules\Reports\Application\Contracts\ReportSales;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\CatalogForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\HoursForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\JobsForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\PeopleForReports;
|
||||
use App\Modules\Reports\Infrastructure\Adapters\SalesForReports;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Livewire\Livewire;
|
||||
@@ -30,6 +32,7 @@ class ReportsServiceProvider extends ServiceProvider
|
||||
ReportJobs::class => JobsForReports::class,
|
||||
ReportCatalog::class => CatalogForReports::class,
|
||||
ReportPeople::class => PeopleForReports::class,
|
||||
ReportSales::class => SalesForReports::class,
|
||||
];
|
||||
|
||||
public function boot(): void
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Reports\Presentation\Csv;
|
||||
|
||||
use App\Modules\Reports\Application\UseCases\QuickSalesReport;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Quick sales as CSV: a row per cash day, amounts with VAT in cents.
|
||||
*/
|
||||
class SalesCsv implements ReportCsv
|
||||
{
|
||||
public function __construct(private QuickSalesReport $report) {}
|
||||
|
||||
public function fileName(Request $request): string
|
||||
{
|
||||
$period = CsvFilters::period($request);
|
||||
|
||||
return __('reports.sales.file').'-'.$period->from.'-'.$period->to;
|
||||
}
|
||||
|
||||
public function headers(): array
|
||||
{
|
||||
return array_values(__('reports.sales.csv'));
|
||||
}
|
||||
|
||||
public function rows(Request $request): iterable
|
||||
{
|
||||
foreach ($this->report->execute(CsvFilters::period($request))->days as $day) {
|
||||
yield [
|
||||
$day['day'],
|
||||
$day['count'],
|
||||
$day['cashCents'],
|
||||
$day['cardCents'],
|
||||
$day['totalCents'],
|
||||
__($day['isClosed'] ? 'reports.yes' : 'reports.no'),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace App\Modules\Reports\Presentation\Http\Controllers;
|
||||
use App\Modules\Reports\Domain\Exceptions\InvalidReportPeriod;
|
||||
use App\Modules\Reports\Presentation\Csv\HoursCsv;
|
||||
use App\Modules\Reports\Presentation\Csv\ReportCsv;
|
||||
use App\Modules\Reports\Presentation\Csv\SalesCsv;
|
||||
use App\Modules\Reports\Presentation\Csv\UnbilledCsv;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
@@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
class DownloadReport
|
||||
{
|
||||
/** The reports that have a CSV, by their URL key. */
|
||||
public const array REPORTS = ['hours', 'unbilled'];
|
||||
public const array REPORTS = ['hours', 'unbilled', 'sales'];
|
||||
|
||||
public function __invoke(string $report, Request $request): StreamedResponse
|
||||
{
|
||||
@@ -73,6 +74,7 @@ class DownloadReport
|
||||
return match ($report) {
|
||||
'hours' => app(HoursCsv::class),
|
||||
'unbilled' => app(UnbilledCsv::class),
|
||||
'sales' => app(SalesCsv::class),
|
||||
default => abort(404),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ trait ReportPage
|
||||
*
|
||||
* @param array<string, string> $filters
|
||||
*/
|
||||
protected function csvUrl(string $report, array $filters = []): string
|
||||
public function csvUrl(string $report, array $filters = []): string
|
||||
{
|
||||
return route('reports.csv', array_filter(['report' => $report, 'alku' => $this->from, 'loppu' => $this->to, ...$filters], fn (string $value): bool => $value !== ''));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
use App\Modules\Reports\Application\DTOs\SalesReport;
|
||||
use App\Modules\Reports\Application\UseCases\QuickSalesReport;
|
||||
use App\Modules\Reports\Presentation\Livewire\Concerns\ReportPage;
|
||||
use App\Modules\Shared\Domain\ValueObjects\VatPercentage;
|
||||
use App\Modules\Users\Application\Contracts\Clock;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Component;
|
||||
|
||||
/**
|
||||
* Quick sales in a period (spec 7, 13): by cash day, product, seller and
|
||||
* VAT rate. They are counter sales apart from the billing material.
|
||||
*/
|
||||
new class extends Component
|
||||
{
|
||||
use ReportPage;
|
||||
|
||||
public function mount(Clock $clock): void
|
||||
{
|
||||
$this->startPeriod($clock);
|
||||
}
|
||||
|
||||
#[Computed]
|
||||
public function report(): ?SalesReport
|
||||
{
|
||||
$period = $this->period();
|
||||
|
||||
return $period === null ? null : app(QuickSalesReport::class)->execute($period);
|
||||
}
|
||||
|
||||
public function updated(): void
|
||||
{
|
||||
$this->authorize('reports.view');
|
||||
unset($this->report);
|
||||
}
|
||||
|
||||
public function vatRate(int $basisPoints): string
|
||||
{
|
||||
return (new VatPercentage($basisPoints))->format();
|
||||
}
|
||||
|
||||
public function seriesLabel(string $key): string
|
||||
{
|
||||
return strlen($key) === 7
|
||||
? ((int) substr($key, 5, 2)).'/'.substr($key, 0, 4)
|
||||
: $this->dateLabel($key);
|
||||
}
|
||||
|
||||
public function render(): mixed
|
||||
{
|
||||
return $this->view()->title(__('reports.sales.title'));
|
||||
}
|
||||
};
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-6xl space-y-6 p-4 sm:p-6">
|
||||
<h1 class="text-2xl font-semibold">{{ __('reports.sales.title') }}</h1>
|
||||
|
||||
<x-reports.period-filter :presets="$this->periodPresets()" :valid="$this->period !== null" />
|
||||
|
||||
@php($report = $this->report)
|
||||
|
||||
@if ($report !== null)
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<h2 class="text-xl font-semibold" role="status" aria-live="polite">{{ $this->periodLabel() }}</h2>
|
||||
<x-button :href="$this->csvUrl('sales')" subtle color="black" icon="arrow-down-tray" :text="__('reports.download_csv')" />
|
||||
</div>
|
||||
|
||||
@if ($report->days === [])
|
||||
<p>{{ __('reports.sales.none') }}</p>
|
||||
@else
|
||||
@if ($report->openDays > 0)
|
||||
<p class="flex items-start gap-2 text-sm">
|
||||
<x-icon name="exclamation-triangle" class="size-5 shrink-0" aria-hidden="true" />
|
||||
{{ trans_choice('reports.sales.open_days', $report->openDays, ['count' => $report->openDays]) }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<table class="w-full text-sm">
|
||||
<caption class="mb-2 text-left text-base font-semibold">{{ __('reports.sales.totals') }}</caption>
|
||||
<thead class="sr-only">
|
||||
<tr>
|
||||
<th scope="col">{{ __('reports.sales.item') }}</th>
|
||||
<th scope="col">{{ __('reports.sales.amount') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ __('reports.sales.count') }}</th>
|
||||
<td class="py-1 text-right">{{ $report->count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ __('reports.sales.cash') }}</th>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($report->cashCents) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ __('reports.sales.card') }}</th>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($report->cardCents) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-semibold">{{ __('reports.sales.total') }}</th>
|
||||
<td class="py-1 text-right font-semibold whitespace-nowrap">{{ $this->money($report->totalCents()) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="w-full text-sm">
|
||||
<caption class="mb-2 text-left text-base font-semibold">{{ __('reports.sales.by_vat') }}</caption>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th scope="col" class="py-1">{{ __('reports.sales.vat_rate') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.gross') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.net') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.vat') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
@foreach ($report->vatTotals as $vat)
|
||||
<tr wire:key="vat-{{ $vat['vatBasisPoints'] }}">
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ $this->vatRate($vat['vatBasisPoints']) }}</th>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($vat['grossCents']) }}</td>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($vat['netCents']) }}</td>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($vat['vatCents']) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<x-reports.chart
|
||||
:title="__($report->seriesByMonth ? 'reports.sales.chart_months' : 'reports.sales.chart_days')"
|
||||
:summary="implode(', ', array_map(fn ($key, $cents) => $this->seriesLabel($key).' '.$this->money($cents), array_keys($report->series), $report->series))"
|
||||
:labels="array_map(fn ($key) => $this->seriesLabel((string) $key), array_keys($report->series))"
|
||||
:values="array_map(fn ($cents) => $cents / 100, array_values($report->series))"
|
||||
:formatter="fn (float $value) => number_format($value, 0, ',', ' ').' €'"
|
||||
/>
|
||||
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<table class="w-full text-sm">
|
||||
<caption class="mb-2 text-left text-base font-semibold">{{ __('reports.sales.by_product') }}</caption>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th scope="col" class="py-1">{{ __('reports.sales.product') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.quantity') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.gross') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
@foreach ($report->products as $product)
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ $product['name'] }}</th>
|
||||
<td class="py-1 text-right">{{ $product['quantity'] }}</td>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($product['grossCents']) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="w-full text-sm">
|
||||
<caption class="mb-2 text-left text-base font-semibold">{{ __('reports.sales.by_seller') }}</caption>
|
||||
<thead>
|
||||
<tr class="text-left">
|
||||
<th scope="col" class="py-1">{{ __('reports.sales.seller') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.count') }}</th>
|
||||
<th scope="col" class="py-1 text-right">{{ __('reports.sales.gross') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
@foreach ($report->sellers as $seller)
|
||||
<tr>
|
||||
<th scope="row" class="py-1 text-left font-normal">{{ $seller['name'] }}</th>
|
||||
<td class="py-1 text-right">{{ $seller['count'] }}</td>
|
||||
<td class="py-1 text-right whitespace-nowrap">{{ $this->money($seller['grossCents']) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<caption class="mb-2 text-left text-base font-semibold">{{ __('reports.sales.by_day') }}</caption>
|
||||
<thead>
|
||||
<tr class="border-b border-zinc-300 text-left dark:border-zinc-600">
|
||||
<th scope="col" class="py-2 pr-3">{{ __('reports.sales.day') }}</th>
|
||||
<th scope="col" class="py-2 pr-3 text-right">{{ __('reports.sales.count') }}</th>
|
||||
<th scope="col" class="py-2 pr-3 text-right">{{ __('reports.sales.cash') }}</th>
|
||||
<th scope="col" class="py-2 pr-3 text-right">{{ __('reports.sales.card') }}</th>
|
||||
<th scope="col" class="py-2 pr-3 text-right">{{ __('reports.sales.total') }}</th>
|
||||
<th scope="col" class="py-2">{{ __('reports.sales.cash_day') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
@foreach ($report->days as $day)
|
||||
<tr wire:key="day-{{ $day['day'] }}">
|
||||
<th scope="row" class="py-2 pr-3 text-left font-normal">
|
||||
<x-link :href="route('sales.index', ['paiva' => $day['day']])" navigate>{{ $this->dateLabel($day['day']) }}</x-link>
|
||||
</th>
|
||||
<td class="py-2 pr-3 text-right">{{ $day['count'] }}</td>
|
||||
<td class="py-2 pr-3 text-right whitespace-nowrap">{{ $this->money($day['cashCents']) }}</td>
|
||||
<td class="py-2 pr-3 text-right whitespace-nowrap">{{ $this->money($day['cardCents']) }}</td>
|
||||
<td class="py-2 pr-3 text-right whitespace-nowrap">{{ $this->money($day['totalCents']) }}</td>
|
||||
<td class="py-2">
|
||||
@if ($day['isClosed'])
|
||||
<span class="inline-flex items-center gap-1"><x-icon name="lock-closed" class="size-4" aria-hidden="true" />{{ __('reports.sales.closed') }}</span>
|
||||
@else
|
||||
<span class="inline-flex items-center gap-1"><x-icon name="exclamation-triangle" class="size-4" aria-hidden="true" />{{ __('reports.sales.open') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
@@ -9,5 +9,6 @@ Route::middleware(['web', 'auth', 'can:reports.view'])
|
||||
->group(function () {
|
||||
Route::livewire('/hours', 'reports::hours')->name('hours');
|
||||
Route::livewire('/unbilled', 'reports::unbilled')->name('unbilled');
|
||||
Route::livewire('/sales', 'reports::sales')->name('sales');
|
||||
Route::get('/{report}/csv', DownloadReport::class)->whereIn('report', DownloadReport::REPORTS)->name('csv');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user