[PROMOTE] 晉升銷售與發票模組修正至 demo
1. 修正訂單詳情發票狀態勾稽:徽章改為動態讀取狀態,新增列印發票功能並接上作廢按鈕。 2. 補齊銷售紀錄訂單狀態多語系並調整電子票證顯示。
This commit is contained in:
commit
c0f6cb5ab6
@ -1145,6 +1145,33 @@ class SalesController extends Controller
|
||||
|
||||
// ===================== 電子發票對帳/補開/作廢 =====================
|
||||
|
||||
/**
|
||||
* 列印發票:向綠界取得列印頁網址(InvoicePrint)後 302 導向。
|
||||
* 該網址自綠界回應起 1 小時內有效,前端以 target="_blank" 於新分頁開啟。
|
||||
*/
|
||||
public function printInvoice(Invoice $invoice, \App\Services\Invoice\EcpayInvoiceService $ecpay)
|
||||
{
|
||||
// 僅已開立且有發票號者可列印
|
||||
if ($invoice->status !== Invoice::STATUS_ISSUED || empty($invoice->invoice_no)) {
|
||||
return back()->with('error', __('Only issued invoices can be printed'));
|
||||
}
|
||||
$machine = $invoice->machine;
|
||||
if (!$machine || !$ecpay->configForMachine($machine)) {
|
||||
return back()->with('error', __('This machine has no ECPay invoice settings'));
|
||||
}
|
||||
$date = $invoice->invoice_date
|
||||
? Carbon::parse($invoice->invoice_date)->format('Y-m-d')
|
||||
: '';
|
||||
|
||||
$result = $ecpay->invoicePrint($machine, $invoice->invoice_no, $date);
|
||||
$url = $result['InvoiceHtml'] ?? '';
|
||||
if ($result === null || (string) ($result['RtnCode'] ?? '') !== '1' || empty($url)) {
|
||||
return back()->with('error', __('Failed to get invoice print URL'));
|
||||
}
|
||||
|
||||
return redirect()->away($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手動向綠界查詢單張發票真實狀態(GetIssue)。
|
||||
* pending 掉包時用此確認:已開→補登 issued;查無→標 failed 待補開。
|
||||
|
||||
@ -123,6 +123,26 @@ class EcpayInvoiceService
|
||||
return $this->post('/B2CInvoice/Issue', $cfg, $invoicePayload);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得發票列印頁網址(InvoicePrint)。
|
||||
* 綠界回傳 Data.InvoiceHtml 為可列印頁 URL(自呼叫起 1 小時內有效)。
|
||||
* 回傳 decode 後陣列(含 RtnCode/InvoiceHtml)或 null(金鑰缺/連線失敗)。
|
||||
*/
|
||||
public function invoicePrint(Machine $machine, string $invoiceNo, string $invoiceDate): ?array
|
||||
{
|
||||
$cfg = $this->configForMachine($machine);
|
||||
if (!$cfg) {
|
||||
return null;
|
||||
}
|
||||
return $this->post('/B2CInvoice/InvoicePrint', $cfg, [
|
||||
'MerchantID' => $cfg['merchant_id'],
|
||||
'InvoiceNo' => $invoiceNo,
|
||||
'InvoiceDate' => $invoiceDate,
|
||||
'PrintStyle' => 1,
|
||||
'IsShowingDetail' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
/** 作廢(Invalid)。 */
|
||||
public function invalid(Machine $machine, string $invoiceNo, string $invoiceDate, string $reason = '作廢'): ?array
|
||||
{
|
||||
|
||||
24
lang/en.json
24
lang/en.json
@ -24,6 +24,7 @@
|
||||
"APP Version": "APP Version",
|
||||
"APP_ID": "APP_ID",
|
||||
"APP_KEY": "APP_KEY",
|
||||
"Abandoned": "Abandoned",
|
||||
"Abnormal": "Abnormal",
|
||||
"Account": "Account",
|
||||
"Account :name status has been changed to :status.": "Account :name status has been changed to :status.",
|
||||
@ -373,6 +374,7 @@
|
||||
"Confirm replenishment completed?": "Confirm replenishment completed?",
|
||||
"Confirm this stock-in order?": "Confirm this stock-in order?",
|
||||
"Confirm this transfer?": "Confirm this transfer?",
|
||||
"Confirmed issued: ": "Confirmed issued: ",
|
||||
"Connected": "Connected",
|
||||
"Connecting...": "Connecting...",
|
||||
"Connection error": "Connection error",
|
||||
@ -607,6 +609,8 @@
|
||||
"EASY_MERCHANT_ID": "EASY_MERCHANT_ID (EasyWallet)",
|
||||
"ECPay Invoice": "ECPay Invoice",
|
||||
"ECPay Invoice Settings Description": "ECPay Invoice Settings Description",
|
||||
"ECPay has no such invoice; marked as pending re-issue": "ECPay has no such invoice; marked as pending re-issue",
|
||||
"ECPay query failed": "ECPay query failed",
|
||||
"ESUN": "ESUN",
|
||||
"ESUN Scan Pay": "ESUN Scan Pay",
|
||||
"Easy Wallet": "Easy Wallet",
|
||||
@ -733,6 +737,7 @@
|
||||
"External URL": "External URL",
|
||||
"Failed": "Failed",
|
||||
"Failed to fetch machine data.": "Failed to fetch machine data.",
|
||||
"Failed to get invoice print URL": "Failed to get invoice print URL",
|
||||
"Failed to load permissions": "Failed to load permissions",
|
||||
"Failed to load preview": "Failed to load preview",
|
||||
"Failed to load tab content": "Failed to load tab content",
|
||||
@ -946,6 +951,7 @@
|
||||
"Invoice Number / Time": "Invoice Number / Time",
|
||||
"Invoice Status": "Invoice Status",
|
||||
"Invoice Store ID": "Invoice Store ID",
|
||||
"Issued": "Issued",
|
||||
"Issued At": "Issued At",
|
||||
"Item List": "Item List",
|
||||
"Items": "Items",
|
||||
@ -1208,6 +1214,7 @@
|
||||
"Microwave push rod retract error (0223)": "Microwave push rod retract error (0223)",
|
||||
"Milk dispense timeout": "Milk dispense timeout",
|
||||
"Min 8 characters": "Min 8 characters",
|
||||
"Missing RelateNumber, cannot query": "Missing RelateNumber, cannot query",
|
||||
"Mobile Pay": "Mobile Pay",
|
||||
"Mobile Payment": "Mobile Payment",
|
||||
"Model": "Model",
|
||||
@ -1280,6 +1287,7 @@
|
||||
"No heartbeat for over 30 seconds": "No heartbeat for over 30 seconds",
|
||||
"No history records": "No history records",
|
||||
"No images uploaded": "No images uploaded",
|
||||
"No invoice issued, cannot void": "No invoice issued, cannot void",
|
||||
"No location set": "No location set",
|
||||
"No login history yet": "No login history yet",
|
||||
"No logs found": "No logs found",
|
||||
@ -1375,7 +1383,11 @@
|
||||
"Online Status": "Online Status",
|
||||
"Only .xlsx files are supported (Max 5MB)": "Only .xlsx files are supported (Max 5MB)",
|
||||
"Only .xlsx, .xls, .csv files are supported (Max 5MB)": "Only .xlsx, .xls, .csv files are supported (Max 5MB)",
|
||||
"Only issued invoices can be printed": "Only issued invoices can be printed",
|
||||
"Only issued invoices can be voided": "Only issued invoices can be voided",
|
||||
"Only machines under the same company can be cloned for security.": "Only machines under the same company can be cloned for security.",
|
||||
"Only pending/failed invoices can be queried": "Only pending/failed invoices can be queried",
|
||||
"Only pending/failed invoices can be re-issued": "Only pending/failed invoices can be re-issued",
|
||||
"Only system roles can be assigned to platform administrative accounts.": "Only system roles can be assigned to platform administrative accounts.",
|
||||
"Operation Logs": "Operation Logs",
|
||||
"Operation Note": "Operation Note",
|
||||
@ -1628,6 +1640,8 @@
|
||||
"Quality": "Quality",
|
||||
"Quantity": "Quantity",
|
||||
"Quantity Sold": "Quantity Sold",
|
||||
"Query": "Query",
|
||||
"Query ECPay": "Query ECPay",
|
||||
"Questionnaire": "Questionnaire",
|
||||
"Quick Expiry Check": "Quick Expiry Check",
|
||||
"Quick Filter": "Quick Filter",
|
||||
@ -1637,6 +1651,11 @@
|
||||
"Quick replenishment from this view": "Quick replenishment from this view",
|
||||
"Quick search...": "Quick search...",
|
||||
"Rank": "Rank",
|
||||
"Re-issue": "Re-issue",
|
||||
"Re-issue failed (no settings or connection error)": "Re-issue failed (no settings or connection error)",
|
||||
"Re-issue failed: ": "Re-issue failed: ",
|
||||
"Re-issue success: ": "Re-issue success: ",
|
||||
"Re-issue this invoice?": "Re-issue this invoice?",
|
||||
"Ready": "Ready",
|
||||
"Ready to Execute": "Ready to Execute",
|
||||
"Ready to print": "Ready to print",
|
||||
@ -2077,6 +2096,7 @@
|
||||
"This account does not belong to this company.": "This account does not belong to this company.",
|
||||
"This is a system administrator role. Its name is locked to ensure system stability.": "This is a system administrator role. Its name is locked to ensure system stability.",
|
||||
"This machine has a pending command. Please wait.": "This machine has a pending command. Please wait.",
|
||||
"This machine has no ECPay invoice settings": "This machine has no ECPay invoice settings",
|
||||
"This role belongs to another company and cannot be assigned.": "This role belongs to another company and cannot be assigned.",
|
||||
"This slot has a pending command. Please wait.": "This slot has a pending command. Please wait.",
|
||||
"This slot has a pending update. Please wait for the previous command to complete.": "This slot has a pending update. Please wait for the previous command to complete.",
|
||||
@ -2259,6 +2279,10 @@
|
||||
"Visual overview of all machine locations": "Visual overview of all machine locations",
|
||||
"Void": "Void",
|
||||
"Void Invoice": "Void Invoice",
|
||||
"Void failed (settings/connection)": "Void failed (settings/connection)",
|
||||
"Void failed: ": "Void failed: ",
|
||||
"Void success": "Void success",
|
||||
"Void this invoice?": "Void this invoice?",
|
||||
"W2W": "W2W",
|
||||
"Waiting": "Waiting",
|
||||
"Waiting for Payment": "Waiting for Payment",
|
||||
|
||||
24
lang/ja.json
24
lang/ja.json
@ -24,6 +24,7 @@
|
||||
"APP Version": "アプリバージョン",
|
||||
"APP_ID": "APP_ID",
|
||||
"APP_KEY": "APP_KEY",
|
||||
"Abandoned": "放棄済み",
|
||||
"Abnormal": "異常",
|
||||
"Account": "アカウント",
|
||||
"Account :name status has been changed to :status.": "アカウント :name のステータスが :status に変更されました。",
|
||||
@ -373,6 +374,7 @@
|
||||
"Confirm replenishment completed?": "補充完了を確認しますか?",
|
||||
"Confirm this stock-in order?": "この入庫伝票を確認しますか?",
|
||||
"Confirm this transfer?": "この在庫移動作業を確認しますか?",
|
||||
"Confirmed issued: ": "Confirmed issued: ",
|
||||
"Connected": "通信中",
|
||||
"Connecting...": "接続中...",
|
||||
"Connection error": "Connection error",
|
||||
@ -607,6 +609,8 @@
|
||||
"EASY_MERCHANT_ID": "EASY_MERCHANT_ID (悠遊付)",
|
||||
"ECPay Invoice": "ECPay 電子領収書",
|
||||
"ECPay Invoice Settings Description": "ECPay 電子領収書設定",
|
||||
"ECPay has no such invoice; marked as pending re-issue": "ECPay has no such invoice; marked as pending re-issue",
|
||||
"ECPay query failed": "ECPay query failed",
|
||||
"ESUN": "玉山銀行",
|
||||
"ESUN Scan Pay": "玉山スキャン決済",
|
||||
"Easy Wallet": "悠遊付 (Easy Wallet)",
|
||||
@ -733,6 +737,7 @@
|
||||
"External URL": "External URL",
|
||||
"Failed": "失敗",
|
||||
"Failed to fetch machine data.": "機器データの取得に失敗しました。",
|
||||
"Failed to get invoice print URL": "領収書印刷URLの取得に失敗しました",
|
||||
"Failed to load permissions": "権限の読み込みに失敗しました",
|
||||
"Failed to load preview": "プレビューの読み込みに失敗しました",
|
||||
"Failed to load tab content": "タブ内容の読み込みに失敗しました",
|
||||
@ -946,6 +951,7 @@
|
||||
"Invoice Number / Time": "領収書番号 / 時間",
|
||||
"Invoice Status": "発行ステータス",
|
||||
"Invoice Store ID": "請求書ストアID",
|
||||
"Issued": "Issued",
|
||||
"Issued At": "発行日時",
|
||||
"Item List": "商品リスト",
|
||||
"Items": "件",
|
||||
@ -1208,6 +1214,7 @@
|
||||
"Microwave push rod retract error (0223)": "電子レンジプッシュロッド引き込みエラー (0223)",
|
||||
"Milk dispense timeout": "牛乳抽出タイムアウト",
|
||||
"Min 8 characters": "最低 8文字",
|
||||
"Missing RelateNumber, cannot query": "Missing RelateNumber, cannot query",
|
||||
"Mobile Pay": "モバイル決済",
|
||||
"Mobile Payment": "モバイル決済",
|
||||
"Model": "機器モデル",
|
||||
@ -1280,6 +1287,7 @@
|
||||
"No heartbeat for over 30 seconds": "30秒以上ハートビートがありません",
|
||||
"No history records": "履歴記録なし",
|
||||
"No images uploaded": "画像がアップロードされていません",
|
||||
"No invoice issued, cannot void": "No invoice issued, cannot void",
|
||||
"No location set": "場所が設定されていません",
|
||||
"No login history yet": "ログイン履歴はまだありません",
|
||||
"No logs found": "ログが見つかりません",
|
||||
@ -1375,7 +1383,11 @@
|
||||
"Online Status": "オンラインステータス",
|
||||
"Only .xlsx files are supported (Max 5MB)": "Only .xlsx files are supported (Max 5MB)",
|
||||
"Only .xlsx, .xls, .csv files are supported (Max 5MB)": ".xlsx, .xls, .csv ファイルのみサポートされています (最大 5MB)",
|
||||
"Only issued invoices can be printed": "発行済みの領収書のみ印刷できます",
|
||||
"Only issued invoices can be voided": "Only issued invoices can be voided",
|
||||
"Only machines under the same company can be cloned for security.": "セキュリティのため、同じ会社の機器設定のみコピーできます。",
|
||||
"Only pending/failed invoices can be queried": "Only pending/failed invoices can be queried",
|
||||
"Only pending/failed invoices can be re-issued": "Only pending/failed invoices can be re-issued",
|
||||
"Only system roles can be assigned to platform administrative accounts.": "プラットフォーム管理アカウントにはシステムロールのみを割り当てることができます。",
|
||||
"Operation Logs": "Operation Logs",
|
||||
"Operation Note": "操作メモ",
|
||||
@ -1628,6 +1640,8 @@
|
||||
"Quality": "品質 (Quality)",
|
||||
"Quantity": "数量",
|
||||
"Quantity Sold": "販売数",
|
||||
"Query": "Query",
|
||||
"Query ECPay": "Query ECPay",
|
||||
"Questionnaire": "アンケート",
|
||||
"Quick Expiry Check": "クイック期限チェック",
|
||||
"Quick Filter": "クイックフィルター",
|
||||
@ -1637,6 +1651,11 @@
|
||||
"Quick replenishment from this view": "この画面からクイック補充",
|
||||
"Quick search...": "クイック検索...",
|
||||
"Rank": "順位",
|
||||
"Re-issue": "Re-issue",
|
||||
"Re-issue failed (no settings or connection error)": "Re-issue failed (no settings or connection error)",
|
||||
"Re-issue failed: ": "Re-issue failed: ",
|
||||
"Re-issue success: ": "Re-issue success: ",
|
||||
"Re-issue this invoice?": "Re-issue this invoice?",
|
||||
"Ready": "準備中",
|
||||
"Ready to Execute": "コマンド実行待ちデバイス",
|
||||
"Ready to print": "印刷準備完了",
|
||||
@ -2077,6 +2096,7 @@
|
||||
"This account does not belong to this company.": "このアカウントは該当企業に所属していません。",
|
||||
"This is a system administrator role. Its name is locked to ensure system stability.": "これはシステム管理者ロールです。システムの安定性を確保するため、名前はロックされています。",
|
||||
"This machine has a pending command. Please wait.": "この機器には実行中のコマンドがあります。しばらくお待ちください。",
|
||||
"This machine has no ECPay invoice settings": "This machine has no ECPay invoice settings",
|
||||
"This role belongs to another company and cannot be assigned.": "このロールは別の会社に属しているため、割り当てることができません。",
|
||||
"This slot has a pending command. Please wait.": "このスロットには実行中のコマンドがあります。しばらくお待ちください。",
|
||||
"This slot has a pending update. Please wait for the previous command to complete.": "このスロットには保留中の更新があります。前のコマンドが完了するまでお待ちください。",
|
||||
@ -2259,6 +2279,10 @@
|
||||
"Visual overview of all machine locations": "すべての機器の位置の視覚的概要",
|
||||
"Void": "無効化 (作廢)",
|
||||
"Void Invoice": "領収書無効化",
|
||||
"Void failed (settings/connection)": "Void failed (settings/connection)",
|
||||
"Void failed: ": "Void failed: ",
|
||||
"Void success": "Void success",
|
||||
"Void this invoice?": "Void this invoice?",
|
||||
"W2W": "倉庫間",
|
||||
"Waiting": "待機中",
|
||||
"Waiting for Payment": "支払待機中",
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
"APP Version": "APP版本號",
|
||||
"APP_ID": "APP_ID",
|
||||
"APP_KEY": "APP_KEY",
|
||||
"Abandoned": "已棄單",
|
||||
"Abnormal": "異常",
|
||||
"Account": "帳號",
|
||||
"Account :name status has been changed to :status.": "帳號 :name 的狀態已變更為 :status。",
|
||||
@ -373,6 +374,7 @@
|
||||
"Confirm replenishment completed?": "確定補貨已完成?",
|
||||
"Confirm this stock-in order?": "確定要確認此進貨單嗎?",
|
||||
"Confirm this transfer?": "確定要確認此調撥作業嗎?",
|
||||
"Confirmed issued: ": "已確認開立:",
|
||||
"Connected": "通訊中",
|
||||
"Connecting...": "連線中",
|
||||
"Connection error": "連線錯誤",
|
||||
@ -598,7 +600,7 @@
|
||||
"Duration": "時長",
|
||||
"Duration (Seconds)": "播放秒數",
|
||||
"During OTA deployment, the device will install directly in the background without user confirmation.": "未來執行 OTA 部署時,機台將跳過詢問並直接自動安裝(靜默安裝)。",
|
||||
"E-Ticket (EasyCard/iPass)": "電子票證 (悠遊卡/一卡通)",
|
||||
"E-Ticket (EasyCard/iPass)": "電子票證",
|
||||
"E.SUN Bank Scan": "玉山銀行掃碼",
|
||||
"E.SUN Pay": "玉山支付",
|
||||
"E.SUN QR Pay": "玉山銀行掃碼",
|
||||
@ -607,6 +609,8 @@
|
||||
"EASY_MERCHANT_ID": "EASY_MERCHANT_ID (悠遊付)",
|
||||
"ECPay Invoice": "綠界電子發票",
|
||||
"ECPay Invoice Settings Description": "綠界科技電子發票設定",
|
||||
"ECPay has no such invoice; marked as pending re-issue": "綠界查無此發票,已標記為待補開",
|
||||
"ECPay query failed": "綠界查詢失敗",
|
||||
"ESUN": "玉山銀行",
|
||||
"ESUN Scan Pay": "玉山掃碼支付",
|
||||
"Easy Wallet": "悠遊付",
|
||||
@ -733,6 +737,7 @@
|
||||
"External URL": "外連 URL",
|
||||
"Failed": "失敗",
|
||||
"Failed to fetch machine data.": "無法取得機台資料。",
|
||||
"Failed to get invoice print URL": "取得發票列印網址失敗",
|
||||
"Failed to load permissions": "載入權限失敗",
|
||||
"Failed to load preview": "載入預覽失敗",
|
||||
"Failed to load tab content": "載入分頁內容失敗",
|
||||
@ -946,6 +951,7 @@
|
||||
"Invoice Number / Time": "發票號碼 / 時間",
|
||||
"Invoice Status": "發票開立狀態",
|
||||
"Invoice Store ID": "發票商店代號",
|
||||
"Issued": "已開立",
|
||||
"Issued At": "開立時間",
|
||||
"Item List": "商品清單",
|
||||
"Items": "筆",
|
||||
@ -961,28 +967,6 @@
|
||||
"LINE Official Pay": "Line官方支付",
|
||||
"LINE Pay": "LINE Pay",
|
||||
"LINE Pay (Official)": "LINE Pay(官方)",
|
||||
"Pending": "待開立",
|
||||
"Issued": "已開立",
|
||||
"Query": "查詢",
|
||||
"Query ECPay": "向綠界查詢",
|
||||
"Re-issue": "補開",
|
||||
"Re-issue this invoice?": "確定要補開這張發票嗎?",
|
||||
"Void this invoice?": "確定要作廢這張發票嗎?",
|
||||
"This machine has no ECPay invoice settings": "此機台未設定綠界電子發票",
|
||||
"Missing RelateNumber, cannot query": "缺少 RelateNumber,無法查詢",
|
||||
"ECPay query failed": "綠界查詢失敗",
|
||||
"Confirmed issued: ": "已確認開立:",
|
||||
"ECPay has no such invoice; marked as pending re-issue": "綠界查無此發票,已標記為待補開",
|
||||
"Re-issue failed (no settings or connection error)": "補開失敗(未設定或連線錯誤)",
|
||||
"Re-issue success: ": "補開成功:",
|
||||
"Re-issue failed: ": "補開失敗:",
|
||||
"No invoice issued, cannot void": "尚未開立發票,無法作廢",
|
||||
"Void failed (settings/connection)": "作廢失敗(設定或連線)",
|
||||
"Void success": "作廢成功",
|
||||
"Void failed: ": "作廢失敗:",
|
||||
"Only pending/failed invoices can be queried": "僅待開立/失敗的發票可查詢",
|
||||
"Only pending/failed invoices can be re-issued": "僅待開立/失敗的發票可補開",
|
||||
"Only issued invoices can be voided": "僅已開立的發票可作廢",
|
||||
"LINE Pay Direct": "LINE Pay 官方直連",
|
||||
"LINE Pay Direct Settings Description": "LINE Pay 官方直連設定",
|
||||
"LINE-ChannelId": "LINE-ChannelId",
|
||||
@ -1230,6 +1214,7 @@
|
||||
"Microwave push rod retract error (0223)": "微波爐內推桿收回錯誤",
|
||||
"Milk dispense timeout": "按鍵出奶超時",
|
||||
"Min 8 characters": "至少 8 個字元",
|
||||
"Missing RelateNumber, cannot query": "缺少 RelateNumber,無法查詢",
|
||||
"Mobile Pay": "手機支付",
|
||||
"Mobile Payment": "手機支付",
|
||||
"Model": "機台型號",
|
||||
@ -1302,6 +1287,7 @@
|
||||
"No heartbeat for over 30 seconds": "超過 30 秒未收到心跳",
|
||||
"No history records": "尚無歷史紀錄",
|
||||
"No images uploaded": "尚未上傳照片",
|
||||
"No invoice issued, cannot void": "尚未開立發票,無法作廢",
|
||||
"No location set": "尚未設定位置",
|
||||
"No login history yet": "尚無登入紀錄",
|
||||
"No logs found": "暫無相關日誌",
|
||||
@ -1397,7 +1383,11 @@
|
||||
"Online Status": "在線狀態",
|
||||
"Only .xlsx files are supported (Max 5MB)": "僅支援 .xlsx 檔案 (最大 5MB)",
|
||||
"Only .xlsx, .xls, .csv files are supported (Max 5MB)": "僅支援 .xlsx, .xls, .csv 檔案 (最大 5MB)",
|
||||
"Only issued invoices can be printed": "僅已開立的發票可列印",
|
||||
"Only issued invoices can be voided": "僅已開立的發票可作廢",
|
||||
"Only machines under the same company can be cloned for security.": "基於安全性,僅限複製同公司旗下的機台設定。",
|
||||
"Only pending/failed invoices can be queried": "僅待開立/失敗的發票可查詢",
|
||||
"Only pending/failed invoices can be re-issued": "僅待開立/失敗的發票可補開",
|
||||
"Only system roles can be assigned to platform administrative accounts.": "僅系統角色可指派給平台管理帳號。",
|
||||
"Operation Logs": "操作紀錄",
|
||||
"Operation Note": "操作備註",
|
||||
@ -1650,6 +1640,8 @@
|
||||
"Quality": "品質 (Quality)",
|
||||
"Quantity": "數量",
|
||||
"Quantity Sold": "銷售數量",
|
||||
"Query": "查詢",
|
||||
"Query ECPay": "向綠界查詢",
|
||||
"Questionnaire": "問卷",
|
||||
"Quick Expiry Check": "效期快速檢查",
|
||||
"Quick Filter": "快捷篩選",
|
||||
@ -1659,6 +1651,11 @@
|
||||
"Quick replenishment from this view": "從此畫面快速補貨",
|
||||
"Quick search...": "快速搜尋...",
|
||||
"Rank": "排行",
|
||||
"Re-issue": "補開",
|
||||
"Re-issue failed (no settings or connection error)": "補開失敗(未設定或連線錯誤)",
|
||||
"Re-issue failed: ": "補開失敗:",
|
||||
"Re-issue success: ": "補開成功:",
|
||||
"Re-issue this invoice?": "確定要補開這張發票嗎?",
|
||||
"Ready": "準備中",
|
||||
"Ready to Execute": "準備要執行指令的設備",
|
||||
"Ready to print": "準備列印",
|
||||
@ -2099,6 +2096,7 @@
|
||||
"This account does not belong to this company.": "此帳號不屬於該公司。",
|
||||
"This is a system administrator role. Its name is locked to ensure system stability.": "這是系統管理員角色,名稱已鎖定以確保系統穩定性。",
|
||||
"This machine has a pending command. Please wait.": "此機台已有指令正在執行,請稍後。",
|
||||
"This machine has no ECPay invoice settings": "此機台未設定綠界電子發票",
|
||||
"This role belongs to another company and cannot be assigned.": "此角色屬於其他公司,無法指派。",
|
||||
"This slot has a pending command. Please wait.": "此貨道已有指令正在執行,請稍後。",
|
||||
"This slot has a pending update. Please wait for the previous command to complete.": "此貨道已有更新指令在執行中,請等候前一個指令完成。",
|
||||
@ -2281,6 +2279,10 @@
|
||||
"Visual overview of all machine locations": "所有機台位置的視覺化概覽",
|
||||
"Void": "作廢",
|
||||
"Void Invoice": "作廢發票",
|
||||
"Void failed (settings/connection)": "作廢失敗(設定或連線)",
|
||||
"Void failed: ": "作廢失敗:",
|
||||
"Void success": "作廢成功",
|
||||
"Void this invoice?": "確定要作廢這張發票嗎?",
|
||||
"W2W": "倉對倉",
|
||||
"Waiting": "等待中",
|
||||
"Waiting for Payment": "等待付款",
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
'pending' => 'pending',
|
||||
'paid' => 'active',
|
||||
'completed' => 'active',
|
||||
'failed' => 'error',
|
||||
'abandoned' => 'disabled',
|
||||
'cancelled' => 'disabled',
|
||||
'refunded' => 'error',
|
||||
];
|
||||
@ -41,6 +43,8 @@
|
||||
'pending' => __('Pending'),
|
||||
'paid' => __('Paid'),
|
||||
'completed' => __('Completed'),
|
||||
'failed' => __('Failed'),
|
||||
'abandoned' => __('Abandoned'),
|
||||
'cancelled' => __('Cancelled'),
|
||||
'refunded' => __('Refunded'),
|
||||
];
|
||||
@ -278,28 +282,48 @@
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
@php
|
||||
// 以發票狀態機顯示(pending/issued/failed/void);舊資料無 status 時以發票號回推
|
||||
$invStatus = $order->invoice->status ?: (empty($order->invoice->invoice_no) ? 'failed' : 'issued');
|
||||
$invStatusMap = [
|
||||
'pending' => ['label' => __('Pending'), 'color' => 'amber'],
|
||||
'issued' => ['label' => __('Issued'), 'color' => 'emerald'],
|
||||
'failed' => ['label' => __('Failed'), 'color' => 'rose'],
|
||||
'void' => ['label' => __('Void'), 'color' => 'slate'],
|
||||
];
|
||||
$invBadge = $invStatusMap[$invStatus] ?? ['label' => $invStatus, 'color' => 'slate'];
|
||||
@endphp
|
||||
<div class="relative flex flex-col sm:flex-row sm:items-center justify-between gap-6">
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<p class="text-xl font-black text-slate-800 dark:text-white font-mono tracking-tighter">{{ $order->invoice->invoice_no }}</p>
|
||||
<x-status-badge status="active" :label="__('Valid')" size="xs" />
|
||||
<p class="text-xl font-black text-slate-800 dark:text-white font-mono tracking-tighter">{{ $order->invoice->invoice_no ?: '---' }}</p>
|
||||
<x-status-badge :color="$invBadge['color']" :label="$invBadge['label']" size="xs" />
|
||||
</div>
|
||||
<div class="flex flex-col gap-1">
|
||||
<p class="text-[10px] font-black text-slate-400 dark:text-slate-500 uppercase tracking-widest">{{ __('Issued At') }}</p>
|
||||
<p class="text-sm font-bold text-slate-600 dark:text-slate-400 font-mono tracking-tight">
|
||||
{{ $order->invoice->invoice_date }} {{ $order->invoice->invoice_time }}
|
||||
{{ optional($order->invoice->invoice_date)->format('Y-m-d') ?: '---' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if($invStatus === 'issued')
|
||||
<div class="flex items-center gap-3">
|
||||
<button class="flex-1 sm:flex-none px-6 py-3 rounded-xl bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 font-bold text-xs border border-slate-200 dark:border-slate-700 hover:bg-indigo-500 hover:text-white hover:border-indigo-500 transition-all duration-300 shadow-sm">
|
||||
{{ __('Print Invoice') }}
|
||||
</button>
|
||||
<button class="flex-1 sm:flex-none px-6 py-3 rounded-xl bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 font-bold text-xs border border-slate-200 dark:border-slate-700 hover:bg-rose-500 hover:text-white hover:border-rose-500 transition-all duration-300 shadow-sm">
|
||||
{{ __('Void Invoice') }}
|
||||
</button>
|
||||
<form method="POST" action="{{ route('admin.sales.invoices.print', $order->invoice) }}" target="_blank">
|
||||
@csrf
|
||||
<button type="submit" class="flex-1 sm:flex-none px-6 py-3 rounded-xl bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 font-bold text-xs border border-slate-200 dark:border-slate-700 hover:bg-indigo-500 hover:text-white hover:border-indigo-500 transition-all duration-300 shadow-sm">
|
||||
{{ __('Print Invoice') }}
|
||||
</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ route('admin.sales.invoices.void', $order->invoice) }}"
|
||||
onsubmit="return confirm('{{ __('Void this invoice?') }}')">
|
||||
@csrf
|
||||
<button type="submit" class="flex-1 sm:flex-none px-6 py-3 rounded-xl bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 font-bold text-xs border border-slate-200 dark:border-slate-700 hover:bg-rose-500 hover:text-white hover:border-rose-500 transition-all duration-300 shadow-sm">
|
||||
{{ __('Void Invoice') }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -263,6 +263,8 @@
|
||||
'pending' => ['label' => __('Pending'), 'color' => 'amber'],
|
||||
'paid' => ['label' => __('Paid'), 'color' => 'emerald'],
|
||||
'completed' => ['label' => __('Completed'), 'color' => 'emerald'],
|
||||
'failed' => ['label' => __('Failed'), 'color' => 'rose'],
|
||||
'abandoned' => ['label' => __('Abandoned'), 'color' => 'slate'],
|
||||
'cancelled' => ['label' => __('Cancelled'), 'color' => 'slate'],
|
||||
'refunded' => ['label' => __('Refunded'), 'color' => 'rose'],
|
||||
];
|
||||
@ -337,6 +339,8 @@
|
||||
'pending' => ['label' => __('Pending'), 'color' => 'amber'],
|
||||
'paid' => ['label' => __('Paid'), 'color' => 'emerald'],
|
||||
'completed' => ['label' => __('Completed'), 'color' => 'emerald'],
|
||||
'failed' => ['label' => __('Failed'), 'color' => 'rose'],
|
||||
'abandoned' => ['label' => __('Abandoned'), 'color' => 'slate'],
|
||||
'cancelled' => ['label' => __('Cancelled'), 'color' => 'slate'],
|
||||
'refunded' => ['label' => __('Refunded'), 'color' => 'rose'],
|
||||
];
|
||||
|
||||
@ -142,7 +142,8 @@ Route::middleware(['auth', 'auth.session', 'verified', 'tenant.access'])->prefix
|
||||
Route::prefix('sales')->name('sales.')->group(function () {
|
||||
Route::get('/', [App\Http\Controllers\Admin\SalesController::class, 'index'])->name('index');
|
||||
|
||||
// 電子發票對帳/補開/作廢
|
||||
// 電子發票對帳/補開/作廢/列印
|
||||
Route::post('/invoices/{invoice}/print', [App\Http\Controllers\Admin\SalesController::class, 'printInvoice'])->name('invoices.print');
|
||||
Route::post('/invoices/{invoice}/reconcile', [App\Http\Controllers\Admin\SalesController::class, 'reconcileInvoice'])->name('invoices.reconcile');
|
||||
Route::post('/invoices/{invoice}/reissue', [App\Http\Controllers\Admin\SalesController::class, 'reissueInvoice'])->name('invoices.reissue');
|
||||
Route::post('/invoices/{invoice}/void', [App\Http\Controllers\Admin\SalesController::class, 'voidInvoice'])->name('invoices.void');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user