diff --git a/app/Http/Controllers/Admin/SalesController.php b/app/Http/Controllers/Admin/SalesController.php index 8b68215..9337f97 100644 --- a/app/Http/Controllers/Admin/SalesController.php +++ b/app/Http/Controllers/Admin/SalesController.php @@ -1155,6 +1155,10 @@ class SalesController extends Controller if ($invoice->status !== Invoice::STATUS_ISSUED || empty($invoice->invoice_no)) { return back()->with('error', __('Only issued invoices can be printed')); } + // 捐贈發票依法無紙本、不可列印(綠界 InvoicePrint 會回查無資料) + if (!empty($invoice->love_code)) { + return back()->with('error', __('Donation invoices cannot be printed')); + } $machine = $invoice->machine; if (!$machine || !$ecpay->configForMachine($machine)) { return back()->with('error', __('This machine has no ECPay invoice settings')); diff --git a/lang/en.json b/lang/en.json index af9f119..375c531 100644 --- a/lang/en.json +++ b/lang/en.json @@ -587,6 +587,7 @@ "Displayed below Logo on the left (defaults to customer name).": "Displayed below Logo on the left (defaults to customer name).", "Displayed below main title on the left.": "Displayed below main title on the left.", "Displaying": "Displaying", + "Donation invoices cannot be printed": "Donation invoices cannot be printed", "Done": "Done", "Door Closed": "Door Closed", "Door Opened": "Door Opened", diff --git a/lang/ja.json b/lang/ja.json index 2b11923..bdb48e8 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -587,6 +587,7 @@ "Displayed below Logo on the left (defaults to customer name).": "左側のロゴの下に表示されるメインタイトル(未設定の場合はデフォルトで顧客名になります)。", "Displayed below main title on the left.": "左側のメインタイトルの下に表示されるサブタイトル。", "Displaying": "表示中", + "Donation invoices cannot be printed": "寄付の領収書は印刷できません", "Done": "完了", "Door Closed": "扉が閉まりました", "Door Opened": "扉が開きました", diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 711715e..42a4430 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -587,6 +587,7 @@ "Displayed below Logo on the left (defaults to customer name).": "顯示於左側 Logo 下方的主標題(未設定則預設帶入客戶名稱)。", "Displayed below main title on the left.": "顯示於左側主標題下方的副標題/英文名稱。", "Displaying": "目前顯示", + "Donation invoices cannot be printed": "捐贈發票無法列印", "Done": "已完成", "Door Closed": "機門已關閉", "Door Opened": "機門已開啟", diff --git a/resources/views/admin/sales/partials/order-detail-panel.blade.php b/resources/views/admin/sales/partials/order-detail-panel.blade.php index 085fb7b..aa3f391 100644 --- a/resources/views/admin/sales/partials/order-detail-panel.blade.php +++ b/resources/views/admin/sales/partials/order-detail-panel.blade.php @@ -292,6 +292,8 @@ 'void' => ['label' => __('Void'), 'color' => 'slate'], ]; $invBadge = $invStatusMap[$invStatus] ?? ['label' => $invStatus, 'color' => 'slate']; + // 捐贈發票依法無紙本、不可列印(綠界 InvoicePrint 會回查無資料) + $invPrintable = empty($order->invoice->love_code); @endphp
@@ -309,12 +311,16 @@ @if($invStatus === 'issued')
+ @if($invPrintable)
@csrf
+ @else + {{ __('Donation invoices cannot be printed') }} + @endif
@csrf