Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function schedule(Schedule $schedule): void
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');

require base_path('routes/console.php');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Enums/ExpenseCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getLabel(): ?string
};
}

public function getColor(): string | array | null
public function getColor(): string|array|null
{
return match ($this) {
self::Vat => 'teal',
Expand Down
2 changes: 1 addition & 1 deletion app/Enums/LanguageCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getLabel(): ?string
};
}

public function getColor(): string | array | null
public function getColor(): string|array|null
{
return match ($this) {
self::DE => 'blue',
Expand Down
2 changes: 1 addition & 1 deletion app/Enums/OfftimeCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getLabel(): ?string
};
}

public function getColor(): string | array | null
public function getColor(): string|array|null
{
return match ($this) {
self::Vacation => Color::Lime,
Expand Down
2 changes: 1 addition & 1 deletion app/Enums/PricingUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getLabel(): ?string
};
}

public function getColor(): string | array | null
public function getColor(): string|array|null
{
return match ($this) {
self::Hour => 'blue',
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Pages/Auth/EditProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function form(Schema $schema): Schema
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
$this->getCurrentPasswordFormComponent(),
])
]),
]);
}
}
2 changes: 1 addition & 1 deletion app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Dashboard extends BaseDashboard
{
protected static string | \BackedEnum | null $navigationIcon = 'tabler-chart-pie';
protected static string|\BackedEnum|null $navigationIcon = 'tabler-chart-pie';

public function getColumns(): int|array
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Pages/Taxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Taxes extends BaseDashboard
{
protected static string $routePath = 'taxes';
protected static ?string $title = 'Steuern';
protected static string | \BackedEnum | null $navigationIcon = 'tabler-tax-euro';
protected static string|\BackedEnum|null $navigationIcon = 'tabler-tax-euro';

public function getColumns(): int|array
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Relations/EstimatesRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function table(Table $table): Table
->label(__('title')),
TextColumn::make('description')
->label(__('description'))
->formatStateUsing(fn (string $state): string => nl2br($state))
->formatStateUsing(fn(string $state): string => nl2br($state))
->html(),
TextColumn::make('amount')
->label(trans_choice('hour', 2))
Expand Down
25 changes: 13 additions & 12 deletions app/Filament/Relations/InvoicesRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,36 @@ public function table(Table $table): Table
TextColumn::make('title')
->label(__('title'))
->sortable()
->description(fn (Invoice $record): string =>
($record->invoiced_at ? __('invoicedAt') . ' ' . Carbon::parse($record->invoiced_at)->isoFormat('LL') : '') .
($record->paid_at ? ', ' . __('paidAt') . ' ' . Carbon::parse($record->paid_at)->isoFormat('LL') : '')
->description(
fn(Invoice $record): string
=> ($record->invoiced_at ? __('invoicedAt') . ' ' . Carbon::parse($record->invoiced_at)->isoFormat('LL') : '')
. ($record->paid_at ? ', ' . __('paidAt') . ' ' . Carbon::parse($record->paid_at)->isoFormat('LL') : ''),
)
->tooltip(fn (Invoice $record): ?string => $record->description),
->tooltip(fn(Invoice $record): ?string => $record->description),
TextColumn::make('price')
->label(__('price'))
->money('eur')
->fontFamily(FontFamily::Mono)
->description(fn (Invoice $record): string => $record->pricing_unit->getLabel()),
->description(fn(Invoice $record): string => $record->pricing_unit->getLabel()),
TextColumn::make('net')
->label(__('net'))
->money('eur')
->fontFamily(FontFamily::Mono)
->state(fn (Invoice $record): float => $record->net)
->description(fn (Invoice $record): string => $record->hours . ' ' . trans_choice('hour', $record->hours)),
->state(fn(Invoice $record): float => $record->net)
->description(fn(Invoice $record): string => $record->hours . ' ' . trans_choice('hour', $record->hours)),
TextColumn::make('total')
->label(__('total'))
->money('eur')
->fontFamily(FontFamily::Mono)
->state(fn (Invoice $record): float => $record->final)
->description(fn (Invoice $record): string => Number::currency($record->vat, 'eur') . ' ' . __('vat')),
->state(fn(Invoice $record): float => $record->final)
->description(fn(Invoice $record): string => Number::currency($record->vat, 'eur') . ' ' . __('vat')),
])
->headerActions([
CreateAction::make()
->icon('tabler-plus')
->label(__('create'))
->schema(InvoiceResource::formFields(6, false))
->visible(fn (): bool => $this->getOwnerRecord() instanceof Project)
->visible(fn(): bool => $this->getOwnerRecord() instanceof Project)
->mountUsing(function (Schema $schema) {
$schema->fill();
if ($this->getOwnerRecord() instanceof Project) {
Expand All @@ -86,7 +87,7 @@ public function table(Table $table): Table
->slideOver()
->modalWidth(Width::ExtraLarge),
])
->icon('tabler-dots-vertical')
->icon('tabler-dots-vertical'),
])
->toolbarActions([
BulkActionGroup::make([
Expand All @@ -99,7 +100,7 @@ public function table(Table $table): Table
->icon('tabler-plus')
->label(__('create'))
->schema(InvoiceResource::formFields(6, false))
->visible(fn (): bool => $this->getOwnerRecord() instanceof Project)
->visible(fn(): bool => $this->getOwnerRecord() instanceof Project)
->mountUsing(function (Schema $schema) {
$schema->fill();
if ($this->getOwnerRecord() instanceof Project) {
Expand Down
6 changes: 3 additions & 3 deletions app/Filament/Relations/PositionsRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function table(Table $table): Table
->columns([
TextColumn::make('description')
->label(__('description'))
->formatStateUsing(fn (string $state): string => nl2br($state))
->formatStateUsing(fn(string $state): string => nl2br($state))
->html(),
TextColumn::make('amount')
->label(trans_choice('hour', 2))
->state(fn (Position $record): float => $record->duration)
->state(fn(Position $record): float => $record->duration)
->weight(FontWeight::ExtraBold)
->fontFamily(FontFamily::Mono)
->description(fn (Position $record): string => $record->time_range),
->description(fn(Position $record): string => $record->time_range),
ToggleColumn::make('remote')
->label(__('remote')),
])
Expand Down
15 changes: 8 additions & 7 deletions app/Filament/Relations/ProjectsRelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ public function table(Table $table): Table
->label(__('title'))
->searchable()
->sortable()
->tooltip(fn (Project $record): ?string => $record->description),
->tooltip(fn(Project $record): ?string => $record->description),
TextColumn::make('date_range')
->label(__('dateRange'))
->state(fn (Project $record): string => Carbon::parse($record->start_at)
->isoFormat('ll') . ' - ' . ($record->due_at ? Carbon::parse($record->due_at)->isoFormat('ll') : '∞')
->state(
fn(Project $record): string => Carbon::parse($record->start_at)
->isoFormat('ll') . ' - ' . ($record->due_at ? Carbon::parse($record->due_at)->isoFormat('ll') : '∞'),
),
TextColumn::make('scope')
->label(__('scope'))
->state(fn (Project $record): string => $record->scope_range),
->state(fn(Project $record): string => $record->scope_range),
TextColumn::make('price_per_unit')
->label(__('price'))
->state(fn (Project $record): string => $record->price_per_unit),
->state(fn(Project $record): string => $record->price_per_unit),
TextColumn::make('progress')
->label(__('progress'))
->state(fn (Project $record): string => $record->hours_with_label),
->state(fn(Project $record): string => $record->hours_with_label),
TextColumn::make('created_at')
->label(__('createdAt'))
->datetime('j. F Y, H:i:s')
Expand Down Expand Up @@ -84,7 +85,7 @@ public function table(Table $table): Table
->slideOver()
->modalWidth(Width::Large),
])
->icon('tabler-dots-vertical')
->icon('tabler-dots-vertical'),
]);
}

Expand Down
18 changes: 9 additions & 9 deletions app/Filament/Resources/ClientResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class ClientResource extends Resource
{
protected static ?string $model = Client::class;
protected static string | \BackedEnum | null $navigationIcon = 'tabler-users';
protected static string|\BackedEnum|null $navigationIcon = 'tabler-users';
protected static ?int $navigationSort = 10;

public static function getNavigationBadge(): ?string
Expand Down Expand Up @@ -70,7 +70,7 @@ public static function table(Table $table): Table
->label(__('name'))
->searchable()
->sortable()
->description(fn (Client $record): string => $record->full_address)
->description(fn(Client $record): string => $record->full_address)
->wrap(),
TextColumn::make('language')
->label(__('language'))
Expand All @@ -80,14 +80,14 @@ public static function table(Table $table): Table
->label(__('net'))
->money('eur')
->fontFamily(FontFamily::Mono)
->state(fn (Client $record): float => $record->net)
->description(fn (Client $record): string => $record->hours . ' ' . trans_choice('hour', $record->hours)),
->state(fn(Client $record): float => $record->net)
->description(fn(Client $record): string => $record->hours . ' ' . trans_choice('hour', $record->hours)),
TextColumn::make('days_to_pay')
->label(__('payment'))
->abbr(__('averagePaymentDuration'), asTooltip: true)
->numeric(1)
->fontFamily(FontFamily::Mono)
->state(fn (Client $record): float => $record->avg_payment_delay)
->state(fn(Client $record): float => $record->avg_payment_delay)
->description(trans_choice('day', 2)),
TextColumn::make('created_at')
->label(__('createdAt'))
Expand All @@ -107,9 +107,9 @@ public static function table(Table $table): Table
->recordActions(ActionGroup::make([
EditAction::make()->icon('tabler-edit'),
Action::make('kontaktieren')
->disabled(fn (Client $record) => !boolval($record->email))
->disabled(fn(Client $record) => !boolval($record->email))
->icon('tabler-mail')
->schema(fn (Client $record) => [
->schema(fn(Client $record) => [
TextInput::make('subject')
->label(__('subject'))
->required(),
Expand All @@ -118,12 +118,12 @@ public static function table(Table $table): Table
->required()
->default(__("email.template.contact.body", [
'name' => $record->name,
'sender' => Setting::get('name')
'sender' => Setting::get('name'),
])),
])
->action(function (Client $record, array $data) {
Mail::to($record->email)->send(
(new ContactClient(body: $data['content']))->subject($data['subject'])
(new ContactClient(body: $data['content']))->subject($data['subject']),
);
})
->slideOver()
Expand Down
10 changes: 5 additions & 5 deletions app/Filament/Resources/EstimateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class EstimateResource extends Resource
{
protected static ?string $model = Estimate::class;
protected static string | \BackedEnum | null $navigationIcon = 'tabler-clock-code';
protected static string|\BackedEnum|null $navigationIcon = 'tabler-clock-code';
protected static ?int $navigationSort = 25;

public static function form(Schema $schema): Schema
Expand All @@ -43,12 +43,12 @@ public static function table(Table $table): Table
->columns([
ColorColumn::make('project.client.color')
->label('')
->tooltip(fn (Estimate $record): ?string => $record->project?->client?->name),
->tooltip(fn(Estimate $record): ?string => $record->project?->client?->name),
TextColumn::make('title')
->label(__('title'))
->searchable()
->sortable()
->description(fn (Estimate $record): string => substr($record->description, 0, 75) . '...'),
->description(fn(Estimate $record): string => substr($record->description, 0, 75) . '...'),
TextColumn::make('amount')
->label(trans_choice('hour', 2))
->numeric()
Expand All @@ -73,7 +73,7 @@ public static function table(Table $table): Table
->filters([
SelectFilter::make('project')
->label(trans_choice('project', 1))
->relationship('project', 'title')
->relationship('project', 'title'),
])
->recordActions(
ActionGroup::make([
Expand All @@ -89,7 +89,7 @@ public static function table(Table $table): Table
->modalWidth(Width::Large),
DeleteAction::make()->icon('tabler-trash')->requiresConfirmation(),
])
->icon('tabler-dots-vertical')
->icon('tabler-dots-vertical'),
)
->toolbarActions([
BulkActionGroup::make([
Expand Down
12 changes: 6 additions & 6 deletions app/Filament/Resources/ExpenseResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class ExpenseResource extends Resource
{
protected static ?string $model = Expense::class;
protected static string | \BackedEnum | null $navigationIcon = 'tabler-credit-card';
protected static string|\BackedEnum|null $navigationIcon = 'tabler-credit-card';
protected static ?int $navigationSort = 40;

public static function form(Schema $schema): Schema
Expand Down Expand Up @@ -65,8 +65,8 @@ public static function table(Table $table): Table
->label(__('vat'))
->money('eur')
->fontFamily(FontFamily::Mono)
->state(fn (Expense $record): float => $record->vat)
->color(fn (string $state): string => $state == 0 ? 'gray' : 'normal')
->state(fn(Expense $record): float => $record->vat)
->color(fn(string $state): string => $state == 0 ? 'gray' : 'normal')
->sortable(),
TextColumn::make('quantity')
->label(__('quantity'))
Expand Down Expand Up @@ -94,7 +94,7 @@ public static function table(Table $table): Table
->filters([
SelectFilter::make('category')
->label(__('category'))
->options(ExpenseCategory::options())
->options(ExpenseCategory::options()),
])
->recordActions(
ActionGroup::make([
Expand All @@ -110,7 +110,7 @@ public static function table(Table $table): Table
->modalWidth(Width::Large),
DeleteAction::make()->icon('tabler-trash')->requiresConfirmation(),
])
->icon('tabler-dots-vertical')
->icon('tabler-dots-vertical'),
)
->toolbarActions([
BulkActionGroup::make([
Expand Down Expand Up @@ -216,7 +216,7 @@ public static function formFields(int $columns = 12, bool $useSection = true): a
->suffixIcon('tabler-receipt-tax')
->columnSpan($columns / 2)
->required()
->hidden(fn (Get $get): bool => !$get('taxable')),
->hidden(fn(Get $get): bool => !$get('taxable')),
Textarea::make('description')
->label(__('description'))
->maxLength(65535)
Expand Down
26 changes: 13 additions & 13 deletions app/Filament/Resources/ExpenseResource/Pages/ListExpenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ class ListExpenses extends ListRecords
{
protected static string $resource = ExpenseResource::class;

protected function getHeaderActions(): array
{
return [
CreateAction::make()
->icon('tabler-plus')
->schema(ExpenseResource::formFields(6, false))
->slideOver()
->modalWidth(Width::Large),
];
}

public function getTabs(): array
{
return [
'deliverables' => Tab::make()
->label(__('deliverables'))
->modifyQueryUsing(fn (Builder $query) => $query->whereIn('category', ExpenseCategory::deliverableCategories())),
->modifyQueryUsing(fn(Builder $query) => $query->whereIn('category', ExpenseCategory::deliverableCategories())),
'tax' => Tab::make()
->label(__('taxes'))
->modifyQueryUsing(fn (Builder $query) => $query->whereIn('category', ExpenseCategory::taxCategories())),
->modifyQueryUsing(fn(Builder $query) => $query->whereIn('category', ExpenseCategory::taxCategories())),
'all' => Tab::make()
->label(__('all')),
];
}

protected function getHeaderActions(): array
{
return [
CreateAction::make()
->icon('tabler-plus')
->schema(ExpenseResource::formFields(6, false))
->slideOver()
->modalWidth(Width::Large),
];
}
}
Loading