@php $rowFor = function (string $field) use ($invoice) { return match ($field) { 'invoice_number' => ['Số hóa đơn', '#' . ($invoice->invoice_number ?? '—')], 'created_at' => ['Ngày tạo', $invoice->created_at ? $invoice->created_at->format('d/m/Y') : '—'], 'due_date' => ['Hạn thanh toán', $invoice->due_date ? date('d/m/Y', strtotime($invoice->due_date)) : '—'], 'total' => ['Tổng tiền', number_format((float) $invoice->total) . ' VNĐ'], 'sub_total' => ['Tiền dịch vụ', number_format((float) $invoice->sub_total) . ' VNĐ'], 'tax' => ['Thuế', number_format((float) $invoice->tax) . ' VNĐ'], 'status' => ['Trạng thái', match ((int) $invoice->status) { 2 => 'Đã thanh toán', 1 => 'Chưa thanh toán', default => 'Đã hủy', }], 'payment_method' => ['Phương thức TT', $invoice->payment_method ?? '—'], default => [$field, '—'], }; }; $fields = $fields ?? ['invoice_number', 'created_at', 'due_date', 'total', 'status']; @endphp
THÔNG TIN HÓA ĐƠN
| {{ $label }}: | {!! $value !!} |