Hoan thien core finance v2 - Calculation Pipeline, Form Templates

This commit is contained in:
2026-04-28 03:57:18 +00:00
parent 002c9a8b99
commit 49aa20a634
24 changed files with 1043 additions and 875 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Filament\Resources\FormTemplates\Tables;
use Filament\Tables;
use Filament\Tables\Table;
class FormTemplatesTable
{
public static function configure(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label('Tên biểu mẫu')
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('code')
->label('Mã')
->searchable()
->copyable(),
Tables\Columns\TextColumn::make('target_model')
->label('Áp dụng cho')
->formatStateUsing(fn ($state) => match ($state) {
'App\Models\Contract' => 'Hợp đồng',
'App\Models\Product' => 'Sản phẩm',
'App\Models\Customer' => 'Khách hàng',
default => $state,
}),
Tables\Columns\TextColumn::make('paper_size')
->label('Khổ giấy')
->badge(),
Tables\Columns\IconColumn::make('is_active')
->label('Hoạt động')
->boolean(),
Tables\Columns\TextColumn::make('fields_count')
->label('Số trường')
->counts('fields'),
])
->filters([
Tables\Filters\SelectFilter::make('target_model')
->label('Áp dụng cho')
->options([
'App\Models\Contract' => 'Hợp đồng',
'App\Models\Product' => 'Sản phẩm',
'App\Models\Customer' => 'Khách hàng',
]),
])
->defaultSort('name');
}
}