Hoan thien core finance v2

This commit is contained in:
2026-04-25 04:04:14 +00:00
parent 86216ef872
commit 002c9a8b99
39 changed files with 1308 additions and 89 deletions

View File

@@ -29,9 +29,50 @@ class PaymentsTable
Tables\Columns\TextColumn::make('receipt_number')
->label('Số phiếu thu')
->searchable(),
Tables\Columns\TextColumn::make('scheduleItem.type')
->label('Loại đợt')
->placeholder('Tạm ứng')
->formatStateUsing(fn ($state) => $state?->getLabel()),
Tables\Columns\TextColumn::make('scheduleItem.installment_no')
->label('Đợt TT')
->placeholder('Tạm ứng'),
Tables\Columns\TextColumn::make('reconciliation_status')
->label('Đối soát')
->badge()
->color(function ($record) {
if (! $record->scheduleItem) {
return 'gray';
}
$remaining = (float) $record->scheduleItem->remaining_amount;
if ($remaining == 0) {
return 'success';
}
if ($remaining > 0) {
return 'warning';
}
return 'danger';
})
->state(function ($record) {
if (! $record->scheduleItem) {
return 'Tạm ứng';
}
$remaining = (float) $record->scheduleItem->remaining_amount;
if ($remaining == 0) {
return 'Đủ';
}
if ($remaining > 0) {
return 'Thiếu';
}
return 'Thừa';
}),
Tables\Columns\TextColumn::make('scheduleItem.remaining_amount')
->label('Còn thiếu')
->money('VND')
->placeholder('-')
->color('danger'),
])
->filters([
Tables\Filters\SelectFilter::make('method')