From 8a4848bc75b31154a344b7745a04c5bd82c2a53f Mon Sep 17 00:00:00 2001 From: mzl Date: Fri, 5 Sep 2025 09:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=9F=E6=88=90pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../approval/model/ApprovalCcs.php | 0 .../approval/model/ApprovalFlows.php | 0 .../approval/model/ApprovalInstances.php | 0 .../approval/model/ApprovalRecords.php | 0 .../approval/service/ApprovalFlowService.php | 0 .../service/ApprovalFlowService_bak.php | 0 .../pdf/controller/DocumentController.php | 138 ++++++++++++++ .../utils/pdf/service/PdfGeneratorService.php | 179 ++++++++++++++++++ .../document/ReimbursementDocumentService.php | 82 ++++++++ app/common/utils/pdf/template/delivery.php | 172 +++++++++++++++++ .../utils/pdf/template/reimbursement.php | 178 +++++++++++++++++ app/common/utils/pdf/template/style.css | 81 ++++++++ app/crm/controller/StockOrdersController.php | 17 +- composer.json | 3 +- composer.lock | 73 ++++++- config/route.php | 5 + 16 files changed, 911 insertions(+), 17 deletions(-) rename app/common/{ => utils}/approval/model/ApprovalCcs.php (100%) rename app/common/{ => utils}/approval/model/ApprovalFlows.php (100%) rename app/common/{ => utils}/approval/model/ApprovalInstances.php (100%) rename app/common/{ => utils}/approval/model/ApprovalRecords.php (100%) rename app/common/{ => utils}/approval/service/ApprovalFlowService.php (100%) rename app/common/{ => utils}/approval/service/ApprovalFlowService_bak.php (100%) create mode 100644 app/common/utils/pdf/controller/DocumentController.php create mode 100644 app/common/utils/pdf/service/PdfGeneratorService.php create mode 100644 app/common/utils/pdf/service/document/ReimbursementDocumentService.php create mode 100644 app/common/utils/pdf/template/delivery.php create mode 100644 app/common/utils/pdf/template/reimbursement.php create mode 100644 app/common/utils/pdf/template/style.css diff --git a/app/common/approval/model/ApprovalCcs.php b/app/common/utils/approval/model/ApprovalCcs.php similarity index 100% rename from app/common/approval/model/ApprovalCcs.php rename to app/common/utils/approval/model/ApprovalCcs.php diff --git a/app/common/approval/model/ApprovalFlows.php b/app/common/utils/approval/model/ApprovalFlows.php similarity index 100% rename from app/common/approval/model/ApprovalFlows.php rename to app/common/utils/approval/model/ApprovalFlows.php diff --git a/app/common/approval/model/ApprovalInstances.php b/app/common/utils/approval/model/ApprovalInstances.php similarity index 100% rename from app/common/approval/model/ApprovalInstances.php rename to app/common/utils/approval/model/ApprovalInstances.php diff --git a/app/common/approval/model/ApprovalRecords.php b/app/common/utils/approval/model/ApprovalRecords.php similarity index 100% rename from app/common/approval/model/ApprovalRecords.php rename to app/common/utils/approval/model/ApprovalRecords.php diff --git a/app/common/approval/service/ApprovalFlowService.php b/app/common/utils/approval/service/ApprovalFlowService.php similarity index 100% rename from app/common/approval/service/ApprovalFlowService.php rename to app/common/utils/approval/service/ApprovalFlowService.php diff --git a/app/common/approval/service/ApprovalFlowService_bak.php b/app/common/utils/approval/service/ApprovalFlowService_bak.php similarity index 100% rename from app/common/approval/service/ApprovalFlowService_bak.php rename to app/common/utils/approval/service/ApprovalFlowService_bak.php diff --git a/app/common/utils/pdf/controller/DocumentController.php b/app/common/utils/pdf/controller/DocumentController.php new file mode 100644 index 0000000..e2567ec --- /dev/null +++ b/app/common/utils/pdf/controller/DocumentController.php @@ -0,0 +1,138 @@ +generatePdfById($id); + + $filename = 'reimbursement_' . $id . '_' . date('Ymd_His') . '.pdf'; + return response($pdfData, 200, [ + 'Content-Type' => 'application/pdf', + 'Content-Disposition' => 'attachment; filename="' . $filename . '"', + ]); + + } catch (Exception $e) { + // 记录日志 + // \support\Log::error("Failed to generate reimbursement PDF: " . $e->getMessage()); + return json(['code' => 1, 'msg' => 'Failed to generate PDF: ' . $e->getMessage()]); + } + } + + /** + * 在浏览器中查看报销单 PDF + * 访问路由: GET /document/reimbursement/view/{id} + * 示例: /document/reimbursement/view/123 + */ + public function viewReimbursementPdf(Request $request, int $id) + { + try { + $service = new ReimbursementDocumentService(); + $pdfData = $service->generatePdfById($id); + + return response($pdfData, 200, [ + 'Content-Type' => 'application/pdf', + 'Content-Disposition' => 'inline; filename="reimbursement_view_' . $id . '.pdf"', // 'inline' 关键 + ]); + + } catch (Exception $e) { + return json(['code' => 1, 'msg' => 'Failed to view PDF: ' . $e->getMessage()]); + } + } + + /** + * 保存报销单 PDF 到服务器 + * 访问路由: POST /document/reimbursement/save + * 参数: id (POST) + */ + public function saveReimbursementPdf(Request $request) + { + $id = $request->post('id'); + if (!$id || !is_numeric($id)) { + return json(['code' => 1, 'msg' => 'Invalid ID']); + } + + try { + // 指定保存路径 + $savePath = runtime_path() . '/generated_pdfs/reimbursements/'; + $service = new ReimbursementDocumentService(); + $service->savePdfToFile((int)$id, $savePath); + + return json(['code' => 0, 'msg' => 'PDF saved successfully', 'path' => $savePath]); + + } catch (Exception $e) { + return json(['code' => 1, 'msg' => 'Failed to save PDF: ' . $e->getMessage()]); + } + } + + /** + * 通用 HTML 到 PDF 生成接口 (示例) + * 访问路由: POST /document/generate-from-html + * 参数: html_content (POST) + */ + public function generateFromHtml(Request $request) + { + $htmlContent = $request->post('html_content'); + if (!$htmlContent) { + return json(['code' => 1, 'msg' => 'HTML content is required']); + } + + try { + $generator = new PdfGeneratorService(); + // 这里直接传入 HTML,不需要模板。可以创建一个简单的 'html_wrapper' 模板来应用样式。 + // 或者直接处理 HTML 字符串。 + // 为简化,我们假设传入的 HTML 已经包含所需样式。 + // 注意:TCPDF 对复杂 CSS 支持有限,内联样式通常更可靠。 + + // 创建一个临时数据结构 + $tempData = ['content' => $htmlContent]; + // 创建一个简单的模板 app/view/pdf/html_wrapper.php + /* 内容示例: */ + // 但更简单的是直接使用 TCPDF 的 writeHTMLCell 或类似方法处理原始 HTML 片段 + // 这里我们直接调用 TCPDF (绕过服务的模板机制) + + $pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $pdf->SetCreator('Your System'); + $pdf->SetTitle('Generated from HTML'); + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + $pdf->setFontSubsetting(true); + $pdf->SetFont('dejavusans', '', 10, '', true); + $pdf->AddPage(); + // 直接写入 HTML + $pdf->writeHTML($htmlContent, true, false, true, false, ''); + $pdf->endPage(); + $pdfData = $pdf->Output('', 'S'); + + $filename = 'custom_html_' . date('Ymd_His') . '.pdf'; + return response($pdfData, 200, [ + 'Content-Type' => 'application/pdf', + 'Content-Disposition' => 'attachment; filename="' . $filename . '"', + ]); + + } catch (Exception $e) { + return json(['code' => 1, 'msg' => 'Failed to generate PDF from HTML: ' . $e->getMessage()]); + } + } +} \ No newline at end of file diff --git a/app/common/utils/pdf/service/PdfGeneratorService.php b/app/common/utils/pdf/service/PdfGeneratorService.php new file mode 100644 index 0000000..6497bb0 --- /dev/null +++ b/app/common/utils/pdf/service/PdfGeneratorService.php @@ -0,0 +1,179 @@ +templatePath = app_path() . '/common/utils/pdf/template/'; + // 设置 TCPDF 默认选项 + $this->defaultOptions = [ + 'page_orientation' => 'P', // PDF_PAGE_ORIENTATION + 'unit' => 'mm', // PDF_UNIT + 'page_format' => 'A4', // PDF_PAGE_FORMAT + 'unicode' => true, + 'encoding' => 'UTF-8', + // --- 修改字体设置 --- + // 'font' => 'dejavusans', // DejaVu 字体有时可能需要额外配置 + 'font' => 'stsongstdlight', // 使用 TCPDF 内置的简体中文支持字体 + 'font_style' => '', // 字体样式 (e.g., 'B' for bold) + 'font_size' => 10, + // --- 字体设置结束 --- + 'creator' => 'Your Company Internal System', + 'author' => 'Your Company', + 'margin_left' => 15, + 'margin_right' => 15, + 'margin_top' => 20, + 'margin_bottom' => 20, + 'margin_header' => 5, + 'margin_footer' => 10, + ]; + } + + /** + * 渲染模板并返回 HTML 字符串 + * + * @param string $templateName 模板文件名 (不含 .php) + * @param array $data 注入模板的数据 + * @return string 渲染后的 HTML + * @throws Exception + */ + private function renderTemplate(string $templateName, array $data): string + { + $templateFile = $this->templatePath . $templateName . '.php'; + + if (!file_exists($templateFile)) { + throw new Exception("PDF template file not found: {$templateFile}"); + } + + // 提取数据变量到当前作用域,供模板使用 + extract($data); + + // 开启输出缓冲 + ob_start(); + // 包含模板文件 + include $templateFile; + // 获取缓冲区内容并清理缓冲区 + $htmlContent = ob_get_clean(); + + if ($htmlContent === false) { + throw new Exception("Failed to render PDF template: {$templateName}"); + } + + return $htmlContent; + } + + /** + * 生成 PDF + * + * @param string $templateName 模板文件名 (不含 .php) + * @param array $data 注入模板的数据 + * @param array $options (可选)覆盖默认的 TCPDF 选项 + * @return string PDF 二进制数据 + * @throws Exception + */ + public function generate(string $templateName, array $data, array $options = []): string + { + // 合并选项 + $options = array_merge($this->defaultOptions, $options); + + // 渲染 HTML + $html = $this->renderTemplate($templateName, $data); + + // 创建 TCPDF 实例 + $pdf = new TCPDF( + $options['page_orientation'], + $options['unit'], + $options['page_format'], + $options['unicode'], + $options['encoding'] + ); + + // 设置文档信息 + $pdf->SetCreator($options['creator']); + $pdf->SetAuthor($options['author']); + $pdf->SetTitle($templateName . ' - Generated PDF'); + + // --- 修改字体设置 --- + // 使用支持中文的字体 + // 'stsongstdlight' 是 TCPDF 内置的简体中文 CJK 字体 + // 'cid0cs' 也是支持中文的字体,可以尝试 + $pdf->SetFont($options['font'], $options['font_style'], $options['font_size'], '', true); + // --- 字体设置结束 --- + + // 设置页边距 + $pdf->SetMargins($options['margin_left'], $options['margin_top'], $options['margin_right']); + $pdf->SetHeaderMargin($options['margin_header']); + $pdf->SetFooterMargin($options['margin_footer']); + + // 设置自动分页 + $pdf->SetAutoPageBreak(TRUE, $options['margin_bottom']); + + // 设置图像比例因子 + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + + // 添加首页 + $pdf->AddPage(); + + // 写入 HTML 内容 + $pdf->writeHTML($html, true, false, true, false, ''); + + // 结束最后一页 + $pdf->endPage(); + + // 返回 PDF 字符串 + return $pdf->Output('', 'S'); // 'S' 返回字符串 + } + + /** + * 保存 PDF 到文件 + * + * @param string $templateName 模板文件名 + * @param array $data 注入模板的数据 + * @param string $filePath 保存的完整文件路径 + * @param array $options (可选)TCPDF 选项 + * @throws Exception + */ + public function saveToFile(string $templateName, array $data, string $filePath, array $options = []) + { + $options = array_merge($this->defaultOptions, $options); + $html = $this->renderTemplate($templateName, $data); + + $pdf = new TCPDF( + $options['page_orientation'], + $options['unit'], + $options['page_format'], + $options['unicode'], + $options['encoding'] + ); + $pdf->SetCreator($options['creator']); + $pdf->SetAuthor($options['author']); + $pdf->SetTitle($templateName . ' - Saved PDF'); + + // --- 修改字体设置 --- + $pdf->SetFont($options['font'], $options['font_style'], $options['font_size'], '', true); + // --- 字体设置结束 --- + + $pdf->SetMargins($options['margin_left'], $options['margin_top'], $options['margin_right']); + $pdf->SetAutoPageBreak(TRUE, $options['margin_bottom']); + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + $pdf->AddPage(); + $pdf->writeHTML($html, true, false, true, false, ''); + $pdf->endPage(); + + // 确保目录存在 + $dir = dirname($filePath); + if (!is_dir($dir)) { + mkdir($dir, 0755, true); + } + + $pdf->Output($filePath, 'F'); // 'F' 保存到文件 + } +} \ No newline at end of file diff --git a/app/common/utils/pdf/service/document/ReimbursementDocumentService.php b/app/common/utils/pdf/service/document/ReimbursementDocumentService.php new file mode 100644 index 0000000..4d6ec88 --- /dev/null +++ b/app/common/utils/pdf/service/document/ReimbursementDocumentService.php @@ -0,0 +1,82 @@ +pdfGenerator = new PdfGeneratorService(); + } + + /** + * 根据报销单 ID 生成 PDF 数据 + * (这里模拟从数据库获取数据) + * + * @param int $reimbursementId + * @return string PDF 二进制数据 + * @throws Exception + */ + public function generatePdfById(int $reimbursementId): string + { + // --- 模拟从数据库获取数据 --- + // 实际应用中,这里应该是查询数据库 + $reimbursementData = $this->getMockReimbursementData($reimbursementId); + + if (!$reimbursementData) { + throw new Exception("Reimbursement record not found for ID: {$reimbursementId}"); + } + // --- 数据获取结束 --- + + // 调用核心 PDF 服务生成 PDF + // 'reimbursement_template' 对应 app/view/pdf/reimbursement_template.php + return $this->pdfGenerator->generate('reimbursement', $reimbursementData); + } + + /** + * 模拟获取报销单数据 + * @param int $id + * @return array|null + */ + private function getMockReimbursementData(int $id) + { + if ($id <= 0) return null; + + return [ + 'reimbursement_id' => 'REIM-' . str_pad($id, 5, '0', STR_PAD_LEFT), + 'applicant_name' => '张三', + 'department' => '技术部', + 'application_date' => '2023-10-26', + 'total_amount' => 1250.75, + 'reason' => "参加北京技术研讨会的差旅费用。\n包括交通、住宿和餐饮。", + 'items' => [ + ['date' => '2023-10-20', 'category' => '交通费', 'description' => '高铁二等座', 'amount' => 520.00, 'remark' => ''], + ['date' => '2023-10-21', 'category' => '住宿费', 'description' => 'XX酒店 2 晚', 'amount' => 680.00, 'remark' => '含早餐'], + ['date' => '2023-10-21', 'category' => '餐饮费', 'description' => '午餐晚餐', 'amount' => 50.75, 'remark' => '发票已附'], + ] + ]; + } + + /** + * 保存报销单 PDF 到服务器 + * @param int $reimbursementId + * @param string $savePath 保存路径 (目录) + * @throws Exception + */ + public function savePdfToFile(int $reimbursementId, string $savePath) + { + $reimbursementData = $this->getMockReimbursementData($reimbursementId); + if (!$reimbursementData) { + throw new Exception("Reimbursement record not found for ID: {$reimbursementId}"); + } + + $filename = 'reimbursement_' . $reimbursementData['reimbursement_id'] . '_' . date('Ymd_His') . '.pdf'; + $fullPath = rtrim($savePath, '/') . '/' . $filename; + + $this->pdfGenerator->saveToFile('reimbursement_template', $reimbursementData, $fullPath); + } +} \ No newline at end of file diff --git a/app/common/utils/pdf/template/delivery.php b/app/common/utils/pdf/template/delivery.php new file mode 100644 index 0000000..51e4277 --- /dev/null +++ b/app/common/utils/pdf/template/delivery.php @@ -0,0 +1,172 @@ + + + + + + 出货单 - <?php echo htmlspecialchars($data['delivery_id'] ?? 'N/A'); ?> + + + + +
+

商品出货单

+

出货编号:

+
+ +
+

发货方: Your Company Ltd.

+

地址: 123 Main Street, City

+

电话: (123) 456-7890

+
+ +
+ + + + + + + + + + + + + +
客户名称出货日期
订单编号运输方式
+
+ +
+

收货地址

+

+
+ +
+

出货明细

+ + + + + + + + + + + + + + + $item): ?> + + + + + + + + + + + + + + + + +
序号产品编码产品名称规格单位数量备注
无出货明细
+
+ + + + + \ No newline at end of file diff --git a/app/common/utils/pdf/template/reimbursement.php b/app/common/utils/pdf/template/reimbursement.php new file mode 100644 index 0000000..4b440ed --- /dev/null +++ b/app/common/utils/pdf/template/reimbursement.php @@ -0,0 +1,178 @@ + + + + + + 报销单 - <?php echo htmlspecialchars($data['reimbursement_id'] ?? 'N/A'); ?> + + + + +
+

费用报销申请单

+

报销编号:

+
+ +
+ +

公司名称: Your Company Ltd.

+

地址: 123 Main Street, City

+

电话: (123) 456-7890

+
+ +
+ + + + + + + + + + + + + + + + + +
申请人部门
申请日期报销总金额 元
事由说明
+
+ +
+

费用明细

+ + + + + + + + + + + + + + $item): ?> + + + + + + + + + + + + + + + + + + + + + + +
序号日期费用类别说明金额 (元)备注
无费用明细
合计:
+
+ + + + + \ No newline at end of file diff --git a/app/common/utils/pdf/template/style.css b/app/common/utils/pdf/template/style.css new file mode 100644 index 0000000..2c79224 --- /dev/null +++ b/app/common/utils/pdf/template/style.css @@ -0,0 +1,81 @@ +/* styles.css */ +body { + font-family: "DejaVu Sans", sans-serif; /* TCPDF 支持的字体 */ + font-size: 10pt; + color: #333; + margin: 20mm 15mm 20mm 15mm; /* 页边距 */ +} + +.header { + text-align: center; + border-bottom: 2px solid #000; + padding-bottom: 5mm; + margin-bottom: 8mm; +} + +.header h1 { + margin: 0; + font-size: 16pt; + color: #000; +} + +.header p { + margin: 2mm 0; +} + +.company-info { + font-size: 9pt; + text-align: right; + margin-bottom: 10mm; +} + +.document-details { + margin-bottom: 10mm; +} + +.document-details table { + width: 100%; + border-collapse: collapse; +} + +.document-details th, .document-details td { + border: 1px solid #999; + padding: 2mm; + text-align: left; + vertical-align: top; +} + +.document-details th { + background-color: #f0f0f0; + font-weight: bold; + text-align: center; +} + +.items-table { + width: 100%; + border-collapse: collapse; + margin-bottom: 10mm; +} + +.items-table th, .items-table td { + border: 1px solid #999; + padding: 2mm; + text-align: left; +} + +.items-table th { + background-color: #eaeaea; + font-weight: bold; +} + +.items-table tfoot td { + font-weight: bold; + background-color: #f9f9f9; +} + +.footer { + border-top: 1px solid #ccc; + padding-top: 5mm; + font-size: 9pt; + text-align: center; +} \ No newline at end of file diff --git a/app/crm/controller/StockOrdersController.php b/app/crm/controller/StockOrdersController.php index 2666012..ef7c0cf 100644 --- a/app/crm/controller/StockOrdersController.php +++ b/app/crm/controller/StockOrdersController.php @@ -101,21 +101,8 @@ class StockOrdersController extends BaseController return $data; } - - - - public function copyOrder(Request $request) - { - try { - $raw = $this->service->copyOrder($request); - $data = $this->transformData($raw, method_exists($this, 'indexFormat') - ? [$this, 'indexFormat'] - : null); - return $this->success($data); - } catch (\Throwable $e) { - return $this->error($e->getMessage()); - } - } + + public function desc(Request $request) diff --git a/composer.json b/composer.json index c474010..ea356fb 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,8 @@ "workerman/crontab": "^1.0", "phpoffice/phpspreadsheet": "^4.5", "phpmailer/phpmailer": "^6.10", - "webman/gateway-worker": "^1.0" + "webman/gateway-worker": "^1.0", + "tecnickcom/tcpdf": "^6.10" }, "suggest": { "ext-event": "For better performance. " diff --git a/composer.lock b/composer.lock index 7d41f97..4b82414 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7c70d8c8bda8a5098b8baed463db8839", + "content-hash": "475042c507f4dff165d21e0c64715771", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -6211,6 +6211,77 @@ ], "time": "2025-05-15T09:04:05+00:00" }, + { + "name": "tecnickcom/tcpdf", + "version": "6.10.0", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "ca5b6de294512145db96bcbc94e61696599c391d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/ca5b6de294512145db96bcbc94e61696599c391d", + "reference": "ca5b6de294512145db96bcbc94e61696599c391d", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=7.1.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "support": { + "issues": "https://github.com/tecnickcom/TCPDF/issues", + "source": "https://github.com/tecnickcom/TCPDF/tree/6.10.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ", + "type": "custom" + } + ], + "time": "2025-05-27T18:02:28+00:00" + }, { "name": "topthink/think-container", "version": "v3.0.2", diff --git a/config/route.php b/config/route.php index 018d437..8eb39cd 100644 --- a/config/route.php +++ b/config/route.php @@ -359,4 +359,9 @@ Route::group('/crm', function () { // Route::any('/update', [app\crm\controller\StockOrdersController::class, 'update']); // Route::any('/destroy', [app\crm\controller\StockOrdersController::class, 'destroy']); }); + + Route::group('/pdf', function () { + Route::any('/bx/{id}', [app\common\utils\pdf\controller\DocumentController::class, 'downloadReimbursementPdf']); + Route::any('/ckbx/{id}', [app\common\utils\pdf\controller\DocumentController::class, 'viewReimbursementPdf']); + }); }); \ No newline at end of file