Add Reports module with the hours by person report
Management's reports (spec 13) get their own module that reads the other modules through ports. The first report sums hours by person in a period, narrowed by service unit or customer, with breakdowns, a chart and CSV. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{{--
|
||||
A bar chart of one series for a report, drawn by TallStackUI's server
|
||||
side SVG chart. The chart is one image named by its title and summary;
|
||||
the same figures are in the report's table, which the caption points to.
|
||||
No legend or tooltip: their controls would sit inside the image.
|
||||
--}}
|
||||
@props(['title', 'summary', 'labels' => [], 'values' => [], 'formatter' => null])
|
||||
|
||||
<figure {{ $attributes->class('space-y-2') }}>
|
||||
<figcaption class="text-base font-semibold">
|
||||
{{ $title }}
|
||||
<span class="block text-sm font-normal text-zinc-600 dark:text-zinc-300">{{ __('reports.chart_note') }}</span>
|
||||
</figcaption>
|
||||
|
||||
@if ($values === [] || max(array_map('abs', $values)) == 0)
|
||||
<p class="text-sm">{{ __('reports.chart_empty') }}</p>
|
||||
@else
|
||||
<div role="img" aria-label="{{ $title }}: {{ $summary }}" class="max-w-4xl">
|
||||
<x-chart
|
||||
bar
|
||||
grid
|
||||
fit="rotate"
|
||||
:labels="$labels"
|
||||
:series="$values"
|
||||
:formatter="$formatter"
|
||||
height="220"
|
||||
/>
|
||||
</div>
|
||||
@endif
|
||||
</figure>
|
||||
@@ -0,0 +1,33 @@
|
||||
{{--
|
||||
A report's period: first and last day (Livewire properties `from` and
|
||||
`to`, saved on change) and quick choices that call choosePeriod(key).
|
||||
The page's ReportPage trait provides both. When the days do not form a
|
||||
period, an alert says so and the report is not shown.
|
||||
--}}
|
||||
@props(['presets' => [], 'valid' => true])
|
||||
|
||||
<fieldset {{ $attributes->class('space-y-3') }}>
|
||||
<legend class="text-lg font-semibold">{{ __('reports.period.legend') }}</legend>
|
||||
|
||||
<div class="flex flex-wrap items-end gap-4">
|
||||
<div class="w-44">
|
||||
<x-input id="report-from" wire:model.live.change="from" type="date" :label="__('reports.period.from')" required />
|
||||
</div>
|
||||
<div class="w-44">
|
||||
<x-input id="report-to" wire:model.live.change="to" type="date" :label="__('reports.period.to')" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2" role="group" aria-label="{{ __('reports.period.presets') }}">
|
||||
@foreach ($presets as $key => $label)
|
||||
<x-button wire:click="choosePeriod('{{ $key }}')" subtle color="black" sm :text="$label" />
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@unless ($valid)
|
||||
<p role="alert" class="flex items-center gap-2 text-sm font-medium text-red-700 dark:text-red-300">
|
||||
<x-icon name="exclamation-triangle" class="size-5" aria-hidden="true" />
|
||||
{{ __('reports.period.invalid') }}
|
||||
</p>
|
||||
@endunless
|
||||
</fieldset>
|
||||
Reference in New Issue
Block a user