Đóng gói cuối tuần

This commit is contained in:
2026-04-18 04:46:01 +00:00
parent 761b34916b
commit 3cef1c40df
37 changed files with 1266 additions and 301 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Filament\Resources\Contracts\ContractResource\RelationManagers;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;
use Filament\Tables\Columns\TextColumn;
use Filament\Actions\ViewAction;
use Filament\Actions\EditAction;
use Filament\Schemas\Schema;
use Filament\Schemas\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Placeholder;
class ScheduleItemsRelationManager extends RelationManager
{
protected static string $relationship = 'scheduleItems';
protected static ?string $title = 'Lịch thanh toán thực tế';
protected static ?string $modelLabel = 'Đợt thanh toán';
protected static ?string $pluralModelLabel = 'Đợt thanh toán';
public function form(Schema $schema): Schema
{
return $schema
->components([
Section::make('Chi tiết đợt thanh toán')
->columns(2)
->schema([
Placeholder::make('installment_no')->label('Đợt số')->content(fn ($record) => $record->installment_no),
Placeholder::make('type')->label('Loại đợt')->content(fn ($record) => $record->type?->getLabel()),
TextInput::make('amount')->label('Số tiền (VND)')->numeric()->required(),
DatePicker::make('due_date')->label('Ngày đến hạn')->required(),
]),
]);
}
public function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('installment_no')->label('Đợt')->badge(),
TextColumn::make('type')->label('Loại')->badge(),
TextColumn::make('amount')->label('Số tiền dự kiến')->money('VND'),
TextColumn::make('due_date')->label('Hạn thanh toán')->date('d/m/Y'),
])
->defaultSort('installment_no', 'asc')
->actions([
ViewAction::make(),
EditAction::make(),
]);
}
}