feat: add GeneratesUniqueSlug class for unique slug generation

feat: create PostCategoryFactory for generating post category data

feat: create PostFactory for generating post data

feat: add retry_requested_at column to services table

feat: add vcenter provisioning fields to products table

feat: add module_host_id to os table

feat: create email_notification_templates table for email templates

feat: add scenario and format fields to template table

feat: add admin fields to transactions table

fix: update ticket table columns and types

feat: add uuid to ticket table and backfill existing records

fix: make ticket_reply user_id nullable

feat: create notifications table for user notifications

fix: make ticket uuid nullable

feat: create post_categories table for blog categories

feat: create posts table for blog posts

feat: add invoice email template for PDF generation
This commit is contained in:
baodev0
2026-05-25 15:39:42 +07:00
parent a31d238135
commit 520f21cb11
73 changed files with 4682 additions and 440 deletions
+24 -12
View File
@@ -15,18 +15,30 @@ class InvoicePdfService
$setting = Setting::where('key', 'setting')->first();
$settingValue = $setting ? json_decode((string) $setting->value) : null;
$customer = $invoice->customer;
$order = $invoice->order;
$data = [
'invoice' => $invoice,
'invoiceItems' => $invoice->invoiceItems,
'customer' => $customer,
'order' => $order,
'companyName' => $settingValue->company ?? 'Thế Giới Số',
'companyAddress' => $settingValue->address ?? '',
'companyPhone' => $settingValue->phone ?? '',
'companyEmail' => $settingValue->email ?? '',
'invoice' => $invoice,
'invoiceItems' => $invoice->invoiceItems,
'customer' => $invoice->customer,
'order' => $invoice->order,
'companyName' => $settingValue->company ?? 'Thế Giới Số',
'companyAddress' => $settingValue->address ?? '',
'companyPhone' => $settingValue->hotline ?? ($settingValue->tel ?? ''),
'companyEmail' => $settingValue->email ?? '',
'companyLogo' => $settingValue->logo ?? '',
'companyTaxCode' => $settingValue->tax ?? '',
'brandColor' => $settingValue->brand_color ?? '#1a56db',
'cfg' => [
'accent_color' => $settingValue->brand_color ?? '#1a56db',
'show_logo' => true,
'show_company_info' => true,
'show_customer_info' => true,
'show_order_info' => true,
'show_items_table' => true,
'show_summary' => true,
'show_note' => true,
'footer_text' => 'Cảm ơn quý khách đã sử dụng dịch vụ.',
'footer_note' => 'Đây là hóa đơn điện tử được tạo tự động, không cần chữ ký số.',
],
];
return Pdf::loadView('pdf.invoice', $data)->output();
@@ -36,4 +48,4 @@ class InvoicePdfService
{
return 'Hoa-don-' . $invoice->invoice_number . '.pdf';
}
}
}