From 17f565bdedce24a452d19bacb8a23838462749e0 Mon Sep 17 00:00:00 2001 From: sky121113 Date: Tue, 9 Jun 2026 17:34:11 +0800 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20=E6=A9=9F=E5=8F=B0=E7=B3=BB?= =?UTF-8?q?=E7=B5=B1=E8=A8=AD=E5=AE=9A=20settings=20JSON=20=E5=8C=96?= =?UTF-8?q?=E8=88=87=E7=B7=A8=E8=BC=AF=E4=BB=8B=E9=9D=A2=E5=A4=9A=E8=AA=9E?= =?UTF-8?q?=E7=B3=BB=EF=BC=8FUI=20=E5=84=AA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Machine 模型:新增 settings JSON 的 accessors/mutators(shopping_mode、tax_invoice_enabled、card_terminal_enabled、scan_pay_esun/linepay_enabled、shopping_cart_enabled 等),讀寫統一收斂到 settings 欄位並同步既有資料表欄位。 2. MachineSettingController:system_settings 儲存邏輯補上 pickup_module_enabled(納入 allowedFields,非基礎版模式時強制關閉)。 3. 多語系補完:新增 Edit Machine System Settings、Basic Mode Features、Bill、Coin、Search machine name or code... 等 key(en/ja/zh_TW),並把寫死的「鈔/幣」面額前綴與中文搜尋框 placeholder 改為 __() 翻譯。 4. 編輯 modal UI:各支付區塊「全選/取消全選」移至標題旁;取貨模組新增區塊總開關與全選;購物車/來店禮改為卡片版型、開關靠右移除重複標籤。 5. 基礎版專屬功能以容器外框+標籤分組,與會員系統/稅務系統/硬體周邊(永遠顯示)做出視覺區隔;「支付方式」全選一併納入取貨模組。 Co-Authored-By: Claude Opus 4.8 --- .../MachineSettingController.php | 80 +++ app/Models/Machine/Machine.php | 131 ++++ lang/en.json | 35 +- lang/ja.json | 45 +- lang/zh_TW.json | 43 +- .../basic-settings/machines/index.blade.php | 569 ++++++++++++------ .../partials/tab-system-settings.blade.php | 188 +++++- 7 files changed, 886 insertions(+), 205 deletions(-) diff --git a/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php b/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php index 34748c9..e01c544 100644 --- a/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php +++ b/app/Http/Controllers/Admin/BasicSettings/MachineSettingController.php @@ -347,13 +347,93 @@ class MachineSettingController extends AdminController 'shopping_cart_enabled', 'welcome_gift_enabled', 'cash_module_enabled', + 'pickup_module_enabled', 'member_system_enabled', 'ambient_temp_monitoring_enabled', ]; + + $shoppingMode = $settings['shopping_mode'] ?? 'basic'; + $data = []; foreach ($allowedFields as $field) { $data[$field] = isset($settings[$field]) ? (bool)$settings[$field] : false; } + + $jsonSettings = $machine->settings ?? []; + $jsonSettings['shopping_mode'] = $shoppingMode; + + if ($shoppingMode !== 'basic') { + $data['card_terminal_enabled'] = false; + $data['scan_pay_esun_enabled'] = false; + $data['scan_pay_linepay_enabled'] = false; + $data['shopping_cart_enabled'] = false; + $data['welcome_gift_enabled'] = false; + $data['cash_module_enabled'] = false; + $data['pickup_module_enabled'] = false; + + $jsonSettings['credit_card_enabled'] = false; + $jsonSettings['mobile_pay_enabled'] = false; + $jsonSettings['card_pay_enabled'] = false; + $jsonSettings['card_pay_easycard'] = false; + $jsonSettings['card_pay_ipass'] = false; + $jsonSettings['card_pay_icash'] = false; + + $jsonSettings['scan_pay_enabled'] = false; + $jsonSettings['scan_pay_tappay_enabled'] = false; + $jsonSettings['tappay_linepay'] = false; + $jsonSettings['tappay_jkopay'] = false; + $jsonSettings['tappay_pipay'] = false; + $jsonSettings['tappay_pluspay'] = false; + $jsonSettings['tappay_easywallet'] = false; + + $jsonSettings['cash_bill_1000'] = false; + $jsonSettings['cash_bill_500'] = false; + $jsonSettings['cash_bill_100'] = false; + $jsonSettings['cash_coin_50'] = false; + $jsonSettings['cash_coin_10'] = false; + $jsonSettings['cash_coin_5'] = false; + $jsonSettings['cash_coin_1'] = false; + + $jsonSettings['pickup_code_enabled'] = false; + $jsonSettings['pass_code_enabled'] = false; + } else { + $jsonSettings['credit_card_enabled'] = isset($settings['credit_card_enabled']) ? (bool)$settings['credit_card_enabled'] : false; + $jsonSettings['mobile_pay_enabled'] = isset($settings['mobile_pay_enabled']) ? (bool)$settings['mobile_pay_enabled'] : false; + $jsonSettings['card_pay_enabled'] = isset($settings['card_pay_enabled']) ? (bool)$settings['card_pay_enabled'] : false; + $jsonSettings['card_pay_easycard'] = isset($settings['card_pay_easycard']) ? (bool)$settings['card_pay_easycard'] : false; + $jsonSettings['card_pay_ipass'] = isset($settings['card_pay_ipass']) ? (bool)$settings['card_pay_ipass'] : false; + $jsonSettings['card_pay_icash'] = isset($settings['card_pay_icash']) ? (bool)$settings['card_pay_icash'] : false; + + $jsonSettings['scan_pay_enabled'] = isset($settings['scan_pay_enabled']) ? (bool)$settings['scan_pay_enabled'] : false; + $jsonSettings['scan_pay_tappay_enabled'] = isset($settings['scan_pay_tappay_enabled']) ? (bool)$settings['scan_pay_tappay_enabled'] : false; + $jsonSettings['tappay_linepay'] = isset($settings['tappay_linepay']) ? (bool)$settings['tappay_linepay'] : false; + $jsonSettings['tappay_jkopay'] = isset($settings['tappay_jkopay']) ? (bool)$settings['tappay_jkopay'] : false; + $jsonSettings['tappay_pipay'] = isset($settings['tappay_pipay']) ? (bool)$settings['tappay_pipay'] : false; + $jsonSettings['tappay_pluspay'] = isset($settings['tappay_pluspay']) ? (bool)$settings['tappay_pluspay'] : false; + $jsonSettings['tappay_easywallet'] = isset($settings['tappay_easywallet']) ? (bool)$settings['tappay_easywallet'] : false; + + $jsonSettings['cash_bill_1000'] = isset($settings['cash_bill_1000']) ? (bool)$settings['cash_bill_1000'] : false; + $jsonSettings['cash_bill_500'] = isset($settings['cash_bill_500']) ? (bool)$settings['cash_bill_500'] : false; + $jsonSettings['cash_bill_100'] = isset($settings['cash_bill_100']) ? (bool)$settings['cash_bill_100'] : false; + $jsonSettings['cash_coin_50'] = isset($settings['cash_coin_50']) ? (bool)$settings['cash_coin_50'] : false; + $jsonSettings['cash_coin_10'] = isset($settings['cash_coin_10']) ? (bool)$settings['cash_coin_10'] : false; + $jsonSettings['cash_coin_5'] = isset($settings['cash_coin_5']) ? (bool)$settings['cash_coin_5'] : false; + $jsonSettings['cash_coin_1'] = isset($settings['cash_coin_1']) ? (bool)$settings['cash_coin_1'] : false; + + $jsonSettings['pickup_code_enabled'] = isset($settings['pickup_code_enabled']) ? (bool)$settings['pickup_code_enabled'] : false; + $jsonSettings['pass_code_enabled'] = isset($settings['pass_code_enabled']) ? (bool)$settings['pass_code_enabled'] : false; + } + + foreach ($allowedFields as $field) { + $jsonSettings[$field] = $data[$field]; + } + + $machine->update([ + 'settings' => $jsonSettings, + 'updater_id' => auth()->id() + ]); + + // 同時更新 model 的屬性欄位 (以防 mutator 同步,以及確保 dirty check 正確) $machine->update(array_merge($data, ['updater_id' => auth()->id()])); if ($request->expectsJson()) { diff --git a/app/Models/Machine/Machine.php b/app/Models/Machine/Machine.php index ee1380a..ecaafd8 100644 --- a/app/Models/Machine/Machine.php +++ b/app/Models/Machine/Machine.php @@ -426,6 +426,137 @@ class Machine extends Model ->count(); } + // === settings JSON 重構 Accessors & Mutators === + + public function getShoppingModeAttribute(): string + { + return $this->settings['shopping_mode'] ?? 'basic'; + } + + public function setShoppingModeAttribute($value) + { + $settings = $this->settings ?? []; + $settings['shopping_mode'] = (string) $value; + $this->settings = $settings; + } + + public function getTaxInvoiceEnabledAttribute(): bool + { + return (bool) ($this->settings['tax_invoice_enabled'] ?? ($this->attributes['tax_invoice_enabled'] ?? false)); + } + + public function setTaxInvoiceEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['tax_invoice_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['tax_invoice_enabled'] = (bool) $value; + } + + public function getCardTerminalEnabledAttribute(): bool + { + return (bool) ($this->settings['card_terminal_enabled'] ?? ($this->attributes['card_terminal_enabled'] ?? false)); + } + + public function setCardTerminalEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['card_terminal_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['card_terminal_enabled'] = (bool) $value; + } + + public function getScanPayEsunEnabledAttribute(): bool + { + return (bool) ($this->settings['scan_pay_esun_enabled'] ?? ($this->attributes['scan_pay_esun_enabled'] ?? false)); + } + + public function setScanPayEsunEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['scan_pay_esun_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['scan_pay_esun_enabled'] = (bool) $value; + } + + public function getScanPayLinepayEnabledAttribute(): bool + { + return (bool) ($this->settings['scan_pay_linepay_enabled'] ?? ($this->attributes['scan_pay_linepay_enabled'] ?? false)); + } + + public function setScanPayLinepayEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['scan_pay_linepay_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['scan_pay_linepay_enabled'] = (bool) $value; + } + + public function getShoppingCartEnabledAttribute(): bool + { + return (bool) ($this->settings['shopping_cart_enabled'] ?? ($this->attributes['shopping_cart_enabled'] ?? false)); + } + + public function setShoppingCartEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['shopping_cart_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['shopping_cart_enabled'] = (bool) $value; + } + + public function getWelcomeGiftEnabledAttribute(): bool + { + return (bool) ($this->settings['welcome_gift_enabled'] ?? ($this->attributes['welcome_gift_enabled'] ?? false)); + } + + public function setWelcomeGiftEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['welcome_gift_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['welcome_gift_enabled'] = (bool) $value; + } + + public function getCashModuleEnabledAttribute(): bool + { + return (bool) ($this->settings['cash_module_enabled'] ?? ($this->attributes['cash_module_enabled'] ?? false)); + } + + public function setCashModuleEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['cash_module_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['cash_module_enabled'] = (bool) $value; + } + + public function getMemberSystemEnabledAttribute(): bool + { + return (bool) ($this->settings['member_system_enabled'] ?? ($this->attributes['member_system_enabled'] ?? false)); + } + + public function setMemberSystemEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['member_system_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['member_system_enabled'] = (bool) $value; + } + + public function getAmbientTempMonitoringEnabledAttribute(): bool + { + return (bool) ($this->settings['ambient_temp_monitoring_enabled'] ?? ($this->attributes['ambient_temp_monitoring_enabled'] ?? false)); + } + + public function setAmbientTempMonitoringEnabledAttribute($value) + { + $settings = $this->settings ?? []; + $settings['ambient_temp_monitoring_enabled'] = (bool) $value; + $this->settings = $settings; + $this->attributes['ambient_temp_monitoring_enabled'] = (bool) $value; + } + public function users() { return $this->belongsToMany(\App\Models\System\User::class); diff --git a/lang/en.json b/lang/en.json index 72a711a..3da1889 100644 --- a/lang/en.json +++ b/lang/en.json @@ -221,6 +221,8 @@ "Barcode / Material": "Barcode / Material", "Based on Hours": "Based on Hours", "Basic Information": "Basic Information", + "Basic Mode": "Basic Mode", + "Basic Mode Features": "Basic Mode Features", "Basic Settings": "Basic Settings", "Basic Specifications": "Basic Specifications", "Batch": "Batch", @@ -233,7 +235,12 @@ "Bento heating": "Bento heating", "Bento machine cooling water tank empty": "Bento machine cooling water tank low water", "Bento not detected": "Bento not detected", + "Bill": "Bill", + "Bill 100": "Bill 100", + "Bill 1000": "Bill 1000", + "Bill 500": "Bill 500", "Bill Acceptor": "Bill Acceptor", + "Bill Denominations": "Bill Denominations", "Bracelet drop not detected": "Bracelet drop not detected", "Bracelet scan failed": "Bracelet scan failed", "Branch": "Branch", @@ -263,6 +270,7 @@ "Cannot delete role with active users.": "Cannot delete role with active users.", "Cannot delete warehouse with existing stock": "Cannot delete warehouse with existing stock", "Card Machine System": "Card Machine System", + "Card Payment": "Card Payment", "Card Reader": "Card Reader", "Card Reader No": "Card Reader No", "Card Reader Reboot": "Card Reader Reboot", @@ -276,6 +284,7 @@ "Cash Module": "Cash Module", "Cash Module Feature": "Cash Module Feature", "Cash Module Function": "Cash Module Function", + "Cash Payment": "Cash Payment", "Category": "Category", "Category Management": "Category Management", "Category Name": "Category Name", @@ -312,7 +321,13 @@ "Close Panel": "Close Panel", "Code": "Code", "Code Copied": "Code Copied", + "Coin": "Coin", + "Coin 1": "Coin 1", + "Coin 10": "Coin 10", + "Coin 5": "Coin 5", + "Coin 50": "Coin 50", "Coin Acceptor": "Coin Acceptor", + "Coin Denominations": "Coin Denominations", "Coin/Banknote Machine": "Coin/Banknote Machine", "Coin/Bill Acceptor": "Coin/Bill Acceptor", "Command Center": "Command Center", @@ -418,6 +433,7 @@ "Creator": "Creator", "Credit Card": "Credit Card", "Credit Card / Contactless": "Credit Card / Contactless", + "Credit Card Payment": "Credit Card Payment", "Critical": "Critical", "Critical failures requiring immediate hands-on attention.": "Critical failures requiring immediate hands-on attention.", "Cross-Company / Headquarter Global Stats": "Cross-Company / Headquarter Global Stats", @@ -591,6 +607,8 @@ "ESUN": "ESUN", "ESUN Scan Pay": "ESUN Scan Pay", "Easy Wallet": "Easy Wallet", + "EasyCard": "EasyCard", + "EasyWallet": "EasyWallet", "Edit": "Edit", "Edit Account": "Edit Account", "Edit Advertisement": "Edit Advertisement", @@ -604,6 +622,7 @@ "Edit Machine Model": "Edit Machine Model", "Edit Machine Name": "Edit Machine Name", "Edit Machine Settings": "Edit Machine Settings", + "Edit Machine System Settings": "Edit Machine System Settings", "Edit Name": "Edit Name", "Edit Pass Code": "Edit Pass Code", "Edit Payment Config": "Edit Payment Config", @@ -924,6 +943,7 @@ "Item List": "Item List", "Items": "Items", "JKO Pay": "JKO Pay", + "JKOPAY": "JKOPAY", "JKO_MERCHANT_ID": "JKO_MERCHANT_ID", "Japanese": "Japanese", "Joined": "Joined", @@ -960,6 +980,7 @@ "Line Members": "Line Members", "Line Official Account": "Line Official Account", "Line Orders": "Line Orders", + "Line Pay": "Line Pay", "Line Permissions": "Line Permissions", "Line Products": "Line Products", "LinePay": "LinePay", @@ -1174,6 +1195,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", + "Mobile Payment": "Mobile Payment", "Model": "Model", "Model Default": "Model Default", "Model Name": "Model Name", @@ -1430,6 +1452,7 @@ "Pass code deleted.": "Pass code deleted.", "Pass code disabled.": "Pass code disabled.", "Pass code updated.": "Pass code updated.", + "Passcode": "Passcode", "Password": "Password", "Password updated successfully.": "Password updated successfully.", "Payment & Invoice": "Payment & Invoice", @@ -1459,13 +1482,16 @@ "Phone": "Phone", "Photo Slot": "Photo Slot", "Pi Pay": "Pi Pay", + "Pi Wallet": "Pi Wallet", "Picked up": "Picked up", "Picked up Time": "Picked up Time", "Pickup Code": "Pickup Code", "Pickup Code (8 Digits)": "Pickup Code (8 Digits)", "Pickup Codes": "Pickup Codes", + "Pickup Module": "Pickup Module", "Pickup Recipient (Prescription Slip)": "Pickup Recipient (Prescription Slip)", "Pickup Recipient Info": "Pickup Recipient Info", + "Pickup Sheet (Material No.)": "Pickup Sheet (Material No.)", "Pickup Ticket": "Pickup Ticket", "Pickup Voucher": "Pickup Voucher", "Pickup code cancelled.": "Pickup code cancelled.", @@ -1718,6 +1744,7 @@ "Saving...": "Saving...", "Scale level and access control": "Scale level and access control", "Scan Pay": "Scan Pay", + "Scan Payment": "Scan Payment", "Scan QR Code": "Scan QR Code", "Scan this code at the machine or share the link with the customer.": "Scan this code at the machine or share the link with the customer.", "Scan this code at the machine to authorize testing or maintenance.": "Scan this code at the machine to authorize testing or maintenance.", @@ -1753,6 +1780,7 @@ "Search customers...": "Search customers...", "Search logs...": "Search logs...", "Search machine name or SN...": "Search machine name or SN...", + "Search machine name or code...": "Search machine name or code...", "Search machine name, S/N, or location...": "Search machine name, S/N, or location...", "Search machine name, serial no...": "Search machine name, serial no...", "Search machines by name or serial...": "Search machines by name or serial...", @@ -1774,6 +1802,7 @@ "Security & State": "Security & State", "Security Controls": "Security Controls", "Select All": "Select All", + "Select All / Deselect All": "Select All / Deselect All", "Select Cargo Lane": "Select Cargo Lane", "Select Category": "Select Category", "Select Company": "Select Company", @@ -1825,7 +1854,7 @@ "Setup Brand": "Setup Brand", "Shopping Cart": "Shopping Cart", "Shopping Cart Feature": "Shopping Cart Feature", - "Shopping Cart Function": "Shopping Cart Function", + "Shopping Mode": "Shopping Mode", "Show": "Show", "Show material code field in products": "Show material code field in products", "Show points rules in products": "Show points rules in products", @@ -1984,6 +2013,7 @@ "System super admin accounts cannot be modified via this interface.": "System super admin accounts cannot be modified via this interface.", "Systems Initializing": "Systems Initializing", "Table View": "Table View", + "TapPay": "TapPay", "TapPay Integration": "TapPay Integration", "TapPay Integration Settings Description": "TapPay Integration Settings Description", "Target": "Target", @@ -2252,7 +2282,6 @@ "Welcome Gift Code": "Welcome Gift Code", "Welcome Gift Code (8 Digits)": "Welcome Gift Code (8 Digits)", "Welcome Gift Feature": "Welcome Gift Feature", - "Welcome Gift Function": "Welcome Gift Function", "Welcome Gift Name": "Welcome Gift Name", "Welcome Gift Status": "Welcome Gift Status", "Welcome Gifts": "Welcome Gifts", @@ -2342,6 +2371,8 @@ "fanon": "Fan turned on", "files selected": "files selected", "hours ago": "hours ago", + "iPASS": "iPASS", + "icash": "icash", "image": "image", "image_url": "image_url", "info": "info", diff --git a/lang/ja.json b/lang/ja.json index e0f1933..8795167 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -221,6 +221,8 @@ "Barcode / Material": "バーコード / 資材", "Based on Hours": "時間ベースで計算", "Basic Information": "基本情報", + "Basic Mode": "基本版", + "Basic Mode Features": "基本版ショッピング機能", "Basic Settings": "基本設定", "Basic Specifications": "基本仕様", "Batch": "バッチ", @@ -233,7 +235,12 @@ "Bento heating": "弁当加熱中", "Bento machine cooling water tank empty": "弁当機冷却水タンク空", "Bento not detected": "弁当が検出されません", + "Bill": "紙幣", + "Bill 100": "100元紙幣受入", + "Bill 1000": "1000元紙幣受入", + "Bill 500": "500元紙幣受入", "Bill Acceptor": "紙幣識別機", + "Bill Denominations": "紙幣受入金種", "Bracelet drop not detected": "ブレスレット落下未検出", "Bracelet scan failed": "ブレスレットスキャン失敗", "Branch": "分庫", @@ -263,6 +270,7 @@ "Cannot delete role with active users.": "ユーザーが紐付けられているロールは削除できません。", "Cannot delete warehouse with existing stock": "在庫がある倉庫は削除できません", "Card Machine System": "カードリーダーシステム", + "Card Payment": "カード決済", "Card Reader": "カードリーダー", "Card Reader No": "カードリーダー番号", "Card Reader Reboot": "カードリーダー再起動", @@ -273,9 +281,10 @@ "Card Terminal": "カード端末", "Card Terminal System": "カードリーダーシステム", "Card UID": "カードUID", - "Cash Module": "コイン・紙幣モジュール", + "Cash Module": "現金モジュール", "Cash Module Feature": "現金モジュール機能", "Cash Module Function": "現金モジュール機能", + "Cash Payment": "現金決済", "Category": "カテゴリ", "Category Management": "カテゴリ管理", "Category Name": "カテゴリ名", @@ -312,7 +321,13 @@ "Close Panel": "パネルを閉じる", "Code": "コード", "Code Copied": "コードをコピーしました", + "Coin": "硬貨", + "Coin 1": "1元硬貨受入", + "Coin 10": "10元硬貨受入", + "Coin 5": "5元硬貨受入", + "Coin 50": "50元硬貨受入", "Coin Acceptor": "硬貨機", + "Coin Denominations": "硬貨受入金種", "Coin/Banknote Machine": "硬貨・紙幣機", "Coin/Bill Acceptor": "硬貨・紙幣機", "Command Center": "コマンドセンター", @@ -418,6 +433,7 @@ "Creator": "作成者", "Credit Card": "クレジットカード", "Credit Card / Contactless": "クレジットカード/非接触決済対応", + "Credit Card Payment": "クレジットカード決済", "Critical": "深刻", "Critical failures requiring immediate hands-on attention.": "即座に対処が必要な重大な障害。", "Cross-Company / Headquarter Global Stats": "複数会社間 / 本部グローバル統計", @@ -581,7 +597,7 @@ "During OTA deployment, the device will install directly in the background without user confirmation.": "OTAデプロイ時、デバイスはユーザーの確認なしでバックグラウンドで直接インストールされます。", "E-Ticket (EasyCard/iPass)": "電子チケット (EasyCard/iPass)", "E.SUN Bank Scan": "玉山銀行スキャン", - "E.SUN Pay": "玉山 Pay", + "E.SUN Pay": "玉山ペイ", "E.SUN QR Pay": "玉山銀行QR決済", "E.SUN QR Scan": "玉山銀行ラベル決済", "E.SUN QR Scan Settings Description": "玉山銀行スキャン決済設定", @@ -591,6 +607,8 @@ "ESUN": "玉山銀行", "ESUN Scan Pay": "玉山スキャン決済", "Easy Wallet": "悠遊付 (Easy Wallet)", + "EasyCard": "悠遊カード", + "EasyWallet": "悠遊付", "Edit": "編集", "Edit Account": "アカウント編集", "Edit Advertisement": "広告編集", @@ -604,6 +622,7 @@ "Edit Machine Model": "機器モデル編集", "Edit Machine Name": "機器名編集", "Edit Machine Settings": "機器設定編集", + "Edit Machine System Settings": "機器システム設定編集", "Edit Name": "名前編集", "Edit Pass Code": "パスコード編集", "Edit Payment Config": "決済設定編集", @@ -893,7 +912,7 @@ "Imported with errors. Please check the console.": "Imported with errors. Please check the console.", "In Stock": "現在庫", "Inactive": "停止中", - "Includes Credit Card/Mobile Pay": "クレジット/QR決済を含む", + "Includes Credit Card/Mobile Pay": "クレジット/モバイル決済", "Indefinite": "無期限", "Info": "情報", "Inherit": "継承", @@ -924,6 +943,7 @@ "Item List": "商品リスト", "Items": "件", "JKO Pay": "街口支付 (JKO Pay)", + "JKOPAY": "JKOPAY", "JKO_MERCHANT_ID": "街口支付 (JKO Pay) 加盟店ID", "Japanese": "日本語", "Joined": "加入日", @@ -960,6 +980,7 @@ "Line Members": "LINEメンバー", "Line Official Account": "LINE公式アカウント", "Line Orders": "LINE注文", + "Line Pay": "LINE Pay", "Line Permissions": "LINE権限", "Line Products": "LINE商品", "LinePay": "LinePay", @@ -1174,6 +1195,7 @@ "Microwave push rod retract error (0223)": "電子レンジプッシュロッド引き込みエラー (0223)", "Milk dispense timeout": "牛乳抽出タイムアウト", "Min 8 characters": "最低 8文字", + "Mobile Payment": "モバイル決済", "Model": "機器モデル", "Model Default": "モデルデフォルト", "Model Name": "モデル名", @@ -1430,6 +1452,7 @@ "Pass code deleted.": "パスコードが削除されました。", "Pass code disabled.": "パスコードが無効化されました。", "Pass code updated.": "パスコードが更新されました。", + "Passcode": "通行コード", "Password": "パスワード", "Password updated successfully.": "パスワードが正常に更新されました。", "Payment & Invoice": "決済・領収書", @@ -1459,13 +1482,16 @@ "Phone": "電話番号", "Photo Slot": "写真スロット", "Pi Pay": "Pi 拍錢包 (Pi Pay)", + "Pi Wallet": "Pi Wallet", "Picked up": "受取済み", "Picked up Time": "受取時間", "Pickup Code": "受取コード", "Pickup Code (8 Digits)": "受取コード (8桁)", "Pickup Codes": "受取コード", + "Pickup Module": "受取モジュール", "Pickup Recipient (Prescription Slip)": "受取者(処方箋)", "Pickup Recipient Info": "受取者情報", + "Pickup Sheet (Material No.)": "ピッキングシート(材料番号)", "Pickup Ticket": "商品受取チケット", "Pickup Voucher": "受取票", "Pickup code cancelled.": "受取コードがキャンセルされました。", @@ -1502,7 +1528,7 @@ "Please select an APK file to upload": "Please select an APK file to upload", "Please select warehouse and machine": "倉庫と機器を選択してください", "Please use our standard template to ensure data compatibility.": "データの互換性を確保するために、標準テンプレートを使用してください。", - "PlusPay": "全盈+PAY (PlusPay)", + "PlusPay": "PlusPay", "Point Rules": "ポイントルール", "Point Settings": "ポイント設定", "Points": "ポイント", @@ -1718,6 +1744,7 @@ "Saving...": "保存中...", "Scale level and access control": "スケールレベルとアクセス制御", "Scan Pay": "スキャン決済", + "Scan Payment": "QRコード決済", "Scan QR Code": "QRコードをスキャン", "Scan this code at the machine or share the link with the customer.": "機器でこのコードをスキャンするか、リンクを顧客と共有してください。", "Scan this code at the machine to authorize testing or maintenance.": "機器でこのコードをスキャンして、テストまたはメンテナンスを承認します。", @@ -1753,6 +1780,7 @@ "Search customers...": "顧客を検索...", "Search logs...": "ログを検索...", "Search machine name or SN...": "機器名またはシリアル番号で検索...", + "Search machine name or code...": "機器名またはコードを検索...", "Search machine name, S/N, or location...": "Search machine name, S/N, or location...", "Search machine name, serial no...": "マシン名、シリアル番号で検索...", "Search machines by name or serial...": "機器名またはシリアルで検索...", @@ -1774,6 +1802,7 @@ "Security & State": "セキュリティ・状態", "Security Controls": "セキュリティ制御", "Select All": "すべて選択", + "Select All / Deselect All": "すべて選択 / すべて解除", "Select Cargo Lane": "スロットを選択", "Select Category": "カテゴリを選択", "Select Company": "会社を選択", @@ -1825,7 +1854,7 @@ "Setup Brand": "デザイン設定", "Shopping Cart": "ショッピングカート", "Shopping Cart Feature": "ショッピングカート機能", - "Shopping Cart Function": "ショッピングカート機能", + "Shopping Mode": "ショッピングモード", "Show": "表示", "Show material code field in products": "商品に資材コードフィールドを表示する", "Show points rules in products": "商品にポイントルールフィールドを表示する", @@ -1876,7 +1905,7 @@ "Spring Channel Limit": "スプリングスロット上限", "Spring Limit": "スプリング上限", "Staff": "スタッフ", - "Staff Card": "スタッフカード", + "Staff Card": "社員カード", "Staff Card Info": "スタッフカード情報", "Staff Identification Management": "スタッフ識別管理", "Staff List": "スタッフ一覧", @@ -1984,6 +2013,7 @@ "System super admin accounts cannot be modified via this interface.": "システム特権管理者アカウントはこのインターフェースから変更できません。", "Systems Initializing": "システム初期化中", "Table View": "リストビュー", + "TapPay": "TapPay", "TapPay Integration": "TapPay 連携", "TapPay Integration Settings Description": "TapPay 決済連携設定", "Target": "対象", @@ -2252,7 +2282,6 @@ "Welcome Gift Code": "来店プレゼントコード", "Welcome Gift Code (8 Digits)": "ウェルカムギフトコード (8桁)", "Welcome Gift Feature": "ウェルカムギフト機能", - "Welcome Gift Function": "ウェルカムギフト機能", "Welcome Gift Name": "ウェルカムギフト名", "Welcome Gift Status": "来店ギフトステータス", "Welcome Gifts": "ウェルカムギフト", @@ -2342,6 +2371,8 @@ "fanon": "ファン起動", "files selected": "個のファイルを選択しました", "hours ago": "時間前", + "iPASS": "iPASSカード", + "icash": "icashカード", "image": "画像", "image_url": "image_url", "info": "一般", diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 2f4327d..86c9629 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -221,6 +221,8 @@ "Barcode / Material": "條碼 / 物料編碼", "Based on Hours": "依據時數計算", "Basic Information": "基本資訊", + "Basic Mode": "基礎版", + "Basic Mode Features": "基礎版購物功能", "Basic Settings": "基本設定", "Basic Specifications": "基本規格", "Batch": "批號", @@ -233,7 +235,12 @@ "Bento heating": "盒飯正在加熱", "Bento machine cooling water tank empty": "盒飯機冷卻水箱缺水", "Bento not detected": "沒檢測到盒飯", + "Bill": "鈔", + "Bill 100": "收鈔面額100", + "Bill 1000": "收鈔面額1000", + "Bill 500": "收鈔面額500", "Bill Acceptor": "紙鈔機", + "Bill Denominations": "收鈔面額", "Bracelet drop not detected": "沒檢測到手環掉入取貨斗", "Bracelet scan failed": "沒掃碼到手環", "Branch": "分倉", @@ -263,6 +270,7 @@ "Cannot delete role with active users.": "無法刪除已有綁定帳號的角色。", "Cannot delete warehouse with existing stock": "無法刪除仍有庫存的倉庫", "Card Machine System": "刷卡機系統", + "Card Payment": "卡片支付", "Card Reader": "刷卡機", "Card Reader No": "刷卡機編號", "Card Reader Reboot": "刷卡機重啟", @@ -273,9 +281,10 @@ "Card Terminal": "刷卡機端", "Card Terminal System": "刷卡機系統", "Card UID": "卡片 UID", - "Cash Module": "硬幣機 / 紙鈔機模組", + "Cash Module": "現金模組", "Cash Module Feature": "現金模組功能", "Cash Module Function": "現金模組功能", + "Cash Payment": "現金支付", "Category": "類別", "Category Management": "分類管理", "Category Name": "分類名稱", @@ -312,7 +321,13 @@ "Close Panel": "關閉面板", "Code": "代碼", "Code Copied": "代碼已複製", + "Coin": "幣", + "Coin 1": "收幣面額1", + "Coin 10": "收幣面額10", + "Coin 5": "收幣面額5", + "Coin 50": "收幣面額50", "Coin Acceptor": "硬幣機", + "Coin Denominations": "收幣面額", "Coin/Banknote Machine": "硬幣機/紙鈔機", "Coin/Bill Acceptor": "硬幣機/紙鈔機", "Command Center": "指令中心", @@ -418,6 +433,7 @@ "Creator": "建立者", "Credit Card": "信用卡", "Credit Card / Contactless": "支援信用卡 / 感應支付", + "Credit Card Payment": "信用卡支付", "Critical": "嚴重", "Critical failures requiring immediate hands-on attention.": "需要立即處理的關鍵故障。", "Cross-Company / Headquarter Global Stats": "跨公司 / 總部全域統計", @@ -581,7 +597,7 @@ "During OTA deployment, the device will install directly in the background without user confirmation.": "未來執行 OTA 部署時,機台將跳過詢問並直接自動安裝(靜默安裝)。", "E-Ticket (EasyCard/iPass)": "電子票證 (悠遊卡/一卡通)", "E.SUN Bank Scan": "玉山銀行掃碼", - "E.SUN Pay": "玉山 Pay", + "E.SUN Pay": "玉山支付", "E.SUN QR Pay": "玉山銀行掃碼", "E.SUN QR Scan": "玉山銀行標籤支付", "E.SUN QR Scan Settings Description": "玉山銀行掃碼支付設定", @@ -591,6 +607,8 @@ "ESUN": "玉山銀行", "ESUN Scan Pay": "玉山掃碼支付", "Easy Wallet": "悠遊付", + "EasyCard": "悠遊卡", + "EasyWallet": "悠遊付", "Edit": "編輯", "Edit Account": "編輯帳號", "Edit Advertisement": "編輯廣告", @@ -604,6 +622,7 @@ "Edit Machine Model": "編輯機台型號", "Edit Machine Name": "編輯機台名稱", "Edit Machine Settings": "編輯機台設定", + "Edit Machine System Settings": "編輯機台系統設定", "Edit Name": "編輯名稱", "Edit Pass Code": "編輯通行碼", "Edit Payment Config": "編輯金流配置", @@ -893,7 +912,7 @@ "Imported with errors. Please check the console.": "部分資料匯入失敗,請查看瀏覽器主控台。", "In Stock": "當前庫存", "Inactive": "已停用", - "Includes Credit Card/Mobile Pay": "含信用卡/行動支付", + "Includes Credit Card/Mobile Pay": "刷卡機支付", "Indefinite": "無限期", "Info": "一般", "Inherit": "繼承", @@ -924,6 +943,7 @@ "Item List": "商品清單", "Items": "筆", "JKO Pay": "街口支付", + "JKOPAY": "接口支付", "JKO_MERCHANT_ID": "街口支付 商店代號", "Japanese": "日文", "Joined": "加入日期", @@ -960,6 +980,7 @@ "Line Members": "Line會員", "Line Official Account": "Line生活圈", "Line Orders": "Line訂單", + "Line Pay": "Line pay", "Line Permissions": "Line 管理權限", "Line Products": "Line商品", "LinePay": "LinePay", @@ -1174,6 +1195,7 @@ "Microwave push rod retract error (0223)": "微波爐內推桿收回錯誤", "Milk dispense timeout": "按鍵出奶超時", "Min 8 characters": "至少 8 個字元", + "Mobile Payment": "手機支付", "Model": "機台型號", "Model Default": "型號預設", "Model Name": "型號名稱", @@ -1430,6 +1452,7 @@ "Pass code deleted.": "通行碼已刪除", "Pass code disabled.": "通行碼已取消。", "Pass code updated.": "通行碼已更新", + "Passcode": "通行碼", "Password": "密碼", "Password updated successfully.": "密碼已成功變更。", "Payment & Invoice": "金流與發票", @@ -1459,13 +1482,16 @@ "Phone": "手機號碼", "Photo Slot": "照片欄位", "Pi Pay": "Pi 拍錢包", + "Pi Wallet": "PI 拍錢包", "Picked up": "領取", "Picked up Time": "領取時間", "Pickup Code": "取貨碼", "Pickup Code (8 Digits)": "取貨碼 (8 位數)", "Pickup Codes": "取貨碼", + "Pickup Module": "取貨模組", "Pickup Recipient (Prescription Slip)": "取物人(領藥單)", "Pickup Recipient Info": "取物人資訊", + "Pickup Sheet (Material No.)": "取物單(物料編號)", "Pickup Ticket": "商品領取券", "Pickup Voucher": "取物單", "Pickup code cancelled.": "取貨碼已取消", @@ -1502,7 +1528,7 @@ "Please select an APK file to upload": "請選擇要上傳的 APK 檔案", "Please select warehouse and machine": "請選擇倉庫和機台", "Please use our standard template to ensure data compatibility.": "請使用標準範例檔以確保資料相容性。", - "PlusPay": "全盈+PAY", + "PlusPay": "全盈+Pay", "Point Rules": "點數規則", "Point Settings": "點數設定", "Points": "點數功能", @@ -1718,6 +1744,7 @@ "Saving...": "儲存中...", "Scale level and access control": "層級與存取控制", "Scan Pay": "掃碼支付功能", + "Scan Payment": "掃碼支付", "Scan QR Code": "掃描 QR Code", "Scan this code at the machine or share the link with the customer.": "請在機台掃描此碼,或將連結分享給客戶。", "Scan this code at the machine to authorize testing or maintenance.": "請在機台上掃描此 QR Code 以進行測試或維護授權。", @@ -1753,6 +1780,7 @@ "Search customers...": "搜尋客戶...", "Search logs...": "搜尋紀錄...", "Search machine name or SN...": "搜尋機台名稱或序號...", + "Search machine name or code...": "搜尋機台名稱或代號...", "Search machine name, S/N, or location...": "搜尋機台名稱、序號 (S/N) 或位置...", "Search machine name, serial no...": "搜尋機台名稱、編號...", "Search machines by name or serial...": "搜尋機台名稱或序號...", @@ -1774,6 +1802,7 @@ "Security & State": "安全性與狀態", "Security Controls": "安全控制", "Select All": "全選", + "Select All / Deselect All": "全選/取消全選", "Select Cargo Lane": "選擇貨道", "Select Category": "選擇類別", "Select Company": "選擇公司", @@ -1825,7 +1854,7 @@ "Setup Brand": "設定樣式", "Shopping Cart": "購物車", "Shopping Cart Feature": "購物車功能", - "Shopping Cart Function": "購物車功能", + "Shopping Mode": "購物方式", "Show": "顯示", "Show material code field in products": "在商品資料中顯示物料編號欄位", "Show points rules in products": "在商品資料中顯示點數規則相關欄位", @@ -1984,6 +2013,7 @@ "System super admin accounts cannot be modified via this interface.": "系統超級管理員帳號無法透過此介面修改。", "Systems Initializing": "系統初始化中", "Table View": "列表視圖", + "TapPay": "TapPay", "TapPay Integration": "TapPay 支付串接", "TapPay Integration Settings Description": "喬睿科技支付串接設定", "Target": "目標", @@ -2252,7 +2282,6 @@ "Welcome Gift Code": "來店禮代碼", "Welcome Gift Code (8 Digits)": "來店禮代碼 (8位數)", "Welcome Gift Feature": "迎賓禮功能", - "Welcome Gift Function": "迎賓禮功能", "Welcome Gift Name": "來店禮名稱", "Welcome Gift Status": "來店禮", "Welcome Gifts": "來店禮", @@ -2342,6 +2371,8 @@ "fanon": "風扇開", "files selected": "個檔案已選擇", "hours ago": "小時前", + "iPASS": "一卡通", + "icash": "icash", "image": "圖片", "image_url": "商品圖片", "info": "一般", diff --git a/resources/views/admin/basic-settings/machines/index.blade.php b/resources/views/admin/basic-settings/machines/index.blade.php index f24be32..8d09cb0 100644 --- a/resources/views/admin/basic-settings/machines/index.blade.php +++ b/resources/views/admin/basic-settings/machines/index.blade.php @@ -99,19 +99,99 @@ machineSettings: {}, openMachineSettingsModal(machine) { this.currentMachine = machine; + const settings = machine.settings || {}; this.machineSettings = { + shopping_mode: settings.shopping_mode || 'basic', tax_invoice_enabled: machine.tax_invoice_enabled === true || machine.tax_invoice_enabled === 1 || machine.tax_invoice_enabled === '1', + + // 刷卡機支付 card_terminal_enabled: machine.card_terminal_enabled === true || machine.card_terminal_enabled === 1 || machine.card_terminal_enabled === '1', + credit_card_enabled: settings.credit_card_enabled === true || settings.credit_card_enabled === 1 || settings.credit_card_enabled === '1', + mobile_pay_enabled: settings.mobile_pay_enabled === true || settings.mobile_pay_enabled === 1 || settings.mobile_pay_enabled === '1', + card_pay_enabled: settings.card_pay_enabled === true || settings.card_pay_enabled === 1 || settings.card_pay_enabled === '1', + card_pay_easycard: settings.card_pay_easycard === true || settings.card_pay_easycard === 1 || settings.card_pay_easycard === '1', + card_pay_ipass: settings.card_pay_ipass === true || settings.card_pay_ipass === 1 || settings.card_pay_ipass === '1', + card_pay_icash: settings.card_pay_icash === true || settings.card_pay_icash === 1 || settings.card_pay_icash === '1', + + // 掃碼支付 + scan_pay_enabled: settings.scan_pay_enabled === true || settings.scan_pay_enabled === 1 || settings.scan_pay_enabled === '1', scan_pay_esun_enabled: machine.scan_pay_esun_enabled === true || machine.scan_pay_esun_enabled === 1 || machine.scan_pay_esun_enabled === '1', - scan_pay_linepay_enabled: machine.scan_pay_linepay_enabled === true || machine.scan_pay_linepay_enabled === 1 || machine.scan_pay_linepay_enabled === '1', + scan_pay_tappay_enabled: settings.scan_pay_tappay_enabled === true || settings.scan_pay_tappay_enabled === 1 || settings.scan_pay_tappay_enabled === '1', + tappay_linepay: settings.tappay_linepay === true || settings.tappay_linepay === 1 || settings.tappay_linepay === '1', + tappay_jkopay: settings.tappay_jkopay === true || settings.tappay_jkopay === 1 || settings.tappay_jkopay === '1', + tappay_pipay: settings.tappay_pipay === true || settings.tappay_pipay === 1 || settings.tappay_pipay === '1', + tappay_pluspay: settings.tappay_pluspay === true || settings.tappay_pluspay === 1 || settings.tappay_pluspay === '1', + tappay_easywallet: settings.tappay_easywallet === true || settings.tappay_easywallet === 1 || settings.tappay_easywallet === '1', + + // 現金支付 (預設皆可收,若 JSON 中特別記錄 false 才是 false) + cash_module_enabled: machine.cash_module_enabled === true || machine.cash_module_enabled === 1 || machine.cash_module_enabled === '1', + cash_bill_1000: settings.cash_bill_1000 !== false && settings.cash_bill_1000 !== 0 && settings.cash_bill_1000 !== '0', + cash_bill_500: settings.cash_bill_500 !== false && settings.cash_bill_500 !== 0 && settings.cash_bill_500 !== '0', + cash_bill_100: settings.cash_bill_100 !== false && settings.cash_bill_100 !== 0 && settings.cash_bill_100 !== '0', + cash_coin_50: settings.cash_coin_50 !== false && settings.cash_coin_50 !== 0 && settings.cash_coin_50 !== '0', + cash_coin_10: settings.cash_coin_10 !== false && settings.cash_coin_10 !== 0 && settings.cash_coin_10 !== '0', + cash_coin_5: settings.cash_coin_5 !== false && settings.cash_coin_5 !== 0 && settings.cash_coin_5 !== '0', + cash_coin_1: settings.cash_coin_1 !== false && settings.cash_coin_1 !== 0 && settings.cash_coin_1 !== '0', + + // 取貨模組 + pickup_module_enabled: settings.pickup_module_enabled !== undefined + ? (settings.pickup_module_enabled === true || settings.pickup_module_enabled === 1 || settings.pickup_module_enabled === '1') + : ((settings.pickup_code_enabled === true || settings.pickup_code_enabled === 1 || settings.pickup_code_enabled === '1') || (settings.pass_code_enabled === true || settings.pass_code_enabled === 1 || settings.pass_code_enabled === '1')), + pickup_code_enabled: settings.pickup_code_enabled === true || settings.pickup_code_enabled === 1 || settings.pickup_code_enabled === '1', + pass_code_enabled: settings.pass_code_enabled === true || settings.pass_code_enabled === 1 || settings.pass_code_enabled === '1', + + // 零售附加功能 shopping_cart_enabled: machine.shopping_cart_enabled === true || machine.shopping_cart_enabled === 1 || machine.shopping_cart_enabled === '1', welcome_gift_enabled: machine.welcome_gift_enabled === true || machine.welcome_gift_enabled === 1 || machine.welcome_gift_enabled === '1', - cash_module_enabled: machine.cash_module_enabled === true || machine.cash_module_enabled === 1 || machine.cash_module_enabled === '1', member_system_enabled: machine.member_system_enabled === true || machine.member_system_enabled === 1 || machine.member_system_enabled === '1', + + // 環境監控 ambient_temp_monitoring_enabled: machine.ambient_temp_monitoring_enabled === true || machine.ambient_temp_monitoring_enabled === 1 || machine.ambient_temp_monitoring_enabled === '1' }; this.showMachineSettingsModal = true; }, + toggleAllCardTerminal() { + const keys = ['credit_card_enabled', 'mobile_pay_enabled', 'card_pay_enabled', 'card_pay_easycard', 'card_pay_ipass', 'card_pay_icash']; + const allChecked = keys.every(k => this.machineSettings[k]); + keys.forEach(k => { + this.machineSettings[k] = !allChecked; + }); + }, + toggleAllScanPay() { + const keys = ['scan_pay_esun_enabled', 'scan_pay_tappay_enabled', 'tappay_linepay', 'tappay_jkopay', 'tappay_pipay', 'tappay_pluspay', 'tappay_easywallet']; + const allChecked = keys.every(k => this.machineSettings[k]); + keys.forEach(k => { + this.machineSettings[k] = !allChecked; + }); + }, + toggleAllCash() { + const keys = ['cash_bill_1000', 'cash_bill_500', 'cash_bill_100', 'cash_coin_50', 'cash_coin_10', 'cash_coin_5', 'cash_coin_1']; + const allChecked = keys.every(k => this.machineSettings[k]); + keys.forEach(k => { + this.machineSettings[k] = !allChecked; + }); + }, + toggleAllPickup() { + const keys = ['pickup_code_enabled', 'pass_code_enabled']; + const allChecked = keys.every(k => this.machineSettings[k]); + keys.forEach(k => { + this.machineSettings[k] = !allChecked; + }); + }, + toggleAllPayments() { + const mainKeys = ['card_terminal_enabled', 'scan_pay_enabled', 'cash_module_enabled', 'pickup_module_enabled']; + const subKeys = [ + 'credit_card_enabled', 'mobile_pay_enabled', 'card_pay_enabled', 'card_pay_easycard', 'card_pay_ipass', 'card_pay_icash', + 'scan_pay_esun_enabled', 'scan_pay_tappay_enabled', 'tappay_linepay', 'tappay_jkopay', 'tappay_pipay', 'tappay_pluspay', 'tappay_easywallet', + 'cash_bill_1000', 'cash_bill_500', 'cash_bill_100', 'cash_coin_50', 'cash_coin_10', 'cash_coin_5', 'cash_coin_1', + 'pickup_code_enabled', 'pass_code_enabled' + ]; + const allMainChecked = mainKeys.every(k => this.machineSettings[k]); + const targetValue = !allMainChecked; + + mainKeys.forEach(k => this.machineSettings[k] = targetValue); + subKeys.forEach(k => this.machineSettings[k] = targetValue); + }, openMaintenanceQr(machine) { this.maintenanceQrMachineName = machine.name; const baseUrl = '{{ route('admin.maintenance.create', ['serial_no' => 'SERIAL_NO']) }}'; @@ -437,9 +517,313 @@ @method('PATCH')
- -
+ +
+
+

{{ __('Shopping Mode') }}

+
+
+ + + +
+
+ + +
+ + +
+ + + + + {{ __('Basic Mode Features') }} + +
+ + +
+ {{ __('Payment Type') }} + +
+ + +
+
+
+

{{ __('Includes Credit Card/Mobile Pay') }}

+ +
+ +
+ + +
+
+ + + +
+ + +
+ + + +
+
+
+ + +
+
+
+

{{ __('Scan Payment') }}

+ +
+ +
+ + +
+
+ + +
+ + +
+ + + + + +
+
+
+ + +
+
+
+

{{ __('Cash Payment') }}

+ +
+ +
+ + +
+
+ {{ __('Bill Denominations') }} +
+ + + +
+
+
+ {{ __('Coin Denominations') }} +
+ + + + +
+
+
+
+ + +
+
+
+

{{ __('Pickup Module') }}

+ +
+ +
+
+ + +
+
+ + +
+
+

{{ __('Shopping Cart') }}

+ +
+
+ + +
+
+

{{ __('Welcome Gift') }}

+ +
+
+
+ + +
+
+

{{ __('Member System') }}

+
+
+ +
+
+ + +

{{ __('Tax System') }}

@@ -449,176 +833,15 @@ -
-
+
- {{ - __('Electronic Invoice') }} - -
-
- - -
-
-

{{ __('Card Machine System') }}

-
-
- -
-
- - -
-
-

{{ __('Scan Pay') - }}

-
-
- - -
-
- - -
-
-

{{ __('購物車功能') }} -

-
-
- -
-
- - -
-
-

{{ __('來店禮功能') }} -

-
-
- -
-
- - -
-
-

{{ __('現金模組功能') }} -

-
-
- -
-
- - -
-
-

{{ __('會員系統功能') }} -

-
-
-
-
+

{{ __('Hardware Peripheral Settings') }}

@@ -628,13 +851,9 @@ -
-
+
- {{ - __('Ambient Temperature Monitoring') }} + {{ __('Ambient Temperature Monitoring') }}
diff --git a/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php b/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php index 315f1e2..763c931 100644 --- a/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php +++ b/resources/views/admin/basic-settings/machines/partials/tab-system-settings.blade.php @@ -11,7 +11,7 @@ @@ -84,13 +84,92 @@ @forelse($machines as $machine) @php $activeFeatures = []; - if ($machine->tax_invoice_enabled) $activeFeatures[] = __('Electronic Invoice'); - if ($machine->card_terminal_enabled) $activeFeatures[] = __('Includes Credit Card/Mobile Pay'); - if ($machine->scan_pay_esun_enabled) $activeFeatures[] = __('E.SUN Bank Scan'); - if ($machine->scan_pay_linepay_enabled) $activeFeatures[] = __('LinePay Payment'); - if ($machine->shopping_cart_enabled) $activeFeatures[] = __('Shopping Cart'); - if ($machine->welcome_gift_enabled) $activeFeatures[] = __('Welcome Gift'); - if ($machine->cash_module_enabled) $activeFeatures[] = __('Coin/Banknote Machine'); + $shoppingMode = $machine->settings['shopping_mode'] ?? 'basic'; + + if ($shoppingMode === 'employee_card') { + $activeFeatures[] = __('Staff Card'); + } elseif ($shoppingMode === 'pickup_sheet') { + $activeFeatures[] = __('Pickup Sheet (Material No.)'); + } else { + $activeFeatures[] = __('Basic Mode'); + + if ($machine->tax_invoice_enabled) $activeFeatures[] = __('Electronic Invoice'); + if ($machine->card_terminal_enabled) { + $terminals = []; + if ($machine->settings['credit_card_enabled'] ?? false) { + $terminals[] = __('Credit Card Payment'); + } + if ($machine->settings['mobile_pay_enabled'] ?? false) { + $terminals[] = __('Mobile Payment'); + } + if ($machine->settings['card_pay_enabled'] ?? false) { + $cards = []; + if ($machine->settings['card_pay_easycard'] ?? false) $cards[] = __('EasyCard'); + if ($machine->settings['card_pay_ipass'] ?? false) $cards[] = __('iPASS'); + if ($machine->settings['card_pay_icash'] ?? false) $cards[] = __('icash'); + if (!empty($cards)) { + $terminals[] = __('Card Payment') . ' (' . implode('/', $cards) . ')'; + } else { + $terminals[] = __('Card Payment'); + } + } + if (!empty($terminals)) { + $activeFeatures[] = __('Includes Credit Card/Mobile Pay') . ' (' . implode(', ', $terminals) . ')'; + } else { + $activeFeatures[] = __('Includes Credit Card/Mobile Pay'); + } + } + if ($machine->settings['scan_pay_enabled'] ?? false) { + $scans = []; + if ($machine->scan_pay_esun_enabled) $scans[] = __('E.SUN Pay'); + if ($machine->settings['scan_pay_tappay_enabled'] ?? false) { + $taps = []; + if ($machine->settings['tappay_linepay'] ?? false) $taps[] = __('Line Pay'); + if ($machine->settings['tappay_jkopay'] ?? false) $taps[] = __('JKOPAY'); + if ($machine->settings['tappay_pipay'] ?? false) $taps[] = __('Pi Wallet'); + if ($machine->settings['tappay_pluspay'] ?? false) $taps[] = __('PlusPay'); + if ($machine->settings['tappay_easywallet'] ?? false) $taps[] = __('EasyWallet'); + if (!empty($taps)) { + $scans[] = 'TapPay (' . implode('/', $taps) . ')'; + } + } + if (!empty($scans)) { + $activeFeatures[] = __('Scan Payment') . ' (' . implode(', ', $scans) . ')'; + } + } + if ($machine->cash_module_enabled) { + $bills = []; + if (($machine->settings['cash_bill_1000'] ?? true) !== false) $bills[] = '1000'; + if (($machine->settings['cash_bill_500'] ?? true) !== false) $bills[] = '500'; + if (($machine->settings['cash_bill_100'] ?? true) !== false) $bills[] = '100'; + $coins = []; + if (($machine->settings['cash_coin_50'] ?? true) !== false) $coins[] = '50'; + if (($machine->settings['cash_coin_10'] ?? true) !== false) $coins[] = '10'; + if (($machine->settings['cash_coin_5'] ?? true) !== false) $coins[] = '5'; + if (($machine->settings['cash_coin_1'] ?? true) !== false) $coins[] = '1'; + + $cashStr = __('Cash Module'); + if (!empty($bills) || !empty($coins)) { + $cashStr .= ' ('; + if (!empty($bills)) $cashStr .= __('Bill') . ':' . implode('/', $bills); + if (!empty($bills) && !empty($coins)) $cashStr .= ' '; + if (!empty($coins)) $cashStr .= __('Coin') . ':' . implode('/', $coins); + $cashStr .= ')'; + } + $activeFeatures[] = $cashStr; + } + + $pickups = []; + if ($machine->settings['pickup_code_enabled'] ?? false) $pickups[] = __('Pickup Code'); + if ($machine->settings['pass_code_enabled'] ?? false) $pickups[] = __('Passcode'); + if (!empty($pickups)) { + $activeFeatures[] = __('Pickup Module') . ' (' . implode('/', $pickups) . ')'; + } + + if ($machine->shopping_cart_enabled) $activeFeatures[] = __('Shopping Cart'); + if ($machine->welcome_gift_enabled) $activeFeatures[] = __('Welcome Gift'); + } + if ($machine->member_system_enabled) $activeFeatures[] = __('Member System'); if ($machine->ambient_temp_monitoring_enabled) $activeFeatures[] = __('Ambient Temperature Monitoring'); @endphp @@ -142,13 +221,92 @@ @forelse($machines as $machine) @php $activeFeatures = []; - if ($machine->tax_invoice_enabled) $activeFeatures[] = __('Electronic Invoice'); - if ($machine->card_terminal_enabled) $activeFeatures[] = __('Includes Credit Card/Mobile Pay'); - if ($machine->scan_pay_esun_enabled) $activeFeatures[] = __('E.SUN Bank Scan'); - if ($machine->scan_pay_linepay_enabled) $activeFeatures[] = __('LinePay Payment'); - if ($machine->shopping_cart_enabled) $activeFeatures[] = __('Shopping Cart'); - if ($machine->welcome_gift_enabled) $activeFeatures[] = __('Welcome Gift'); - if ($machine->cash_module_enabled) $activeFeatures[] = __('Coin/Banknote Machine'); + $shoppingMode = $machine->settings['shopping_mode'] ?? 'basic'; + + if ($shoppingMode === 'employee_card') { + $activeFeatures[] = __('Staff Card'); + } elseif ($shoppingMode === 'pickup_sheet') { + $activeFeatures[] = __('Pickup Sheet (Material No.)'); + } else { + $activeFeatures[] = __('Basic Mode'); + + if ($machine->tax_invoice_enabled) $activeFeatures[] = __('Electronic Invoice'); + if ($machine->card_terminal_enabled) { + $terminals = []; + if ($machine->settings['credit_card_enabled'] ?? false) { + $terminals[] = __('Credit Card Payment'); + } + if ($machine->settings['mobile_pay_enabled'] ?? false) { + $terminals[] = __('Mobile Payment'); + } + if ($machine->settings['card_pay_enabled'] ?? false) { + $cards = []; + if ($machine->settings['card_pay_easycard'] ?? false) $cards[] = __('EasyCard'); + if ($machine->settings['card_pay_ipass'] ?? false) $cards[] = __('iPASS'); + if ($machine->settings['card_pay_icash'] ?? false) $cards[] = __('icash'); + if (!empty($cards)) { + $terminals[] = __('Card Payment') . ' (' . implode('/', $cards) . ')'; + } else { + $terminals[] = __('Card Payment'); + } + } + if (!empty($terminals)) { + $activeFeatures[] = __('Includes Credit Card/Mobile Pay') . ' (' . implode(', ', $terminals) . ')'; + } else { + $activeFeatures[] = __('Includes Credit Card/Mobile Pay'); + } + } + if ($machine->settings['scan_pay_enabled'] ?? false) { + $scans = []; + if ($machine->scan_pay_esun_enabled) $scans[] = __('E.SUN Pay'); + if ($machine->settings['scan_pay_tappay_enabled'] ?? false) { + $taps = []; + if ($machine->settings['tappay_linepay'] ?? false) $taps[] = __('Line Pay'); + if ($machine->settings['tappay_jkopay'] ?? false) $taps[] = __('JKOPAY'); + if ($machine->settings['tappay_pipay'] ?? false) $taps[] = __('Pi Wallet'); + if ($machine->settings['tappay_pluspay'] ?? false) $taps[] = __('PlusPay'); + if ($machine->settings['tappay_easywallet'] ?? false) $taps[] = __('EasyWallet'); + if (!empty($taps)) { + $scans[] = 'TapPay (' . implode('/', $taps) . ')'; + } + } + if (!empty($scans)) { + $activeFeatures[] = __('Scan Payment') . ' (' . implode(', ', $scans) . ')'; + } + } + if ($machine->cash_module_enabled) { + $bills = []; + if (($machine->settings['cash_bill_1000'] ?? true) !== false) $bills[] = '1000'; + if (($machine->settings['cash_bill_500'] ?? true) !== false) $bills[] = '500'; + if (($machine->settings['cash_bill_100'] ?? true) !== false) $bills[] = '100'; + $coins = []; + if (($machine->settings['cash_coin_50'] ?? true) !== false) $coins[] = '50'; + if (($machine->settings['cash_coin_10'] ?? true) !== false) $coins[] = '10'; + if (($machine->settings['cash_coin_5'] ?? true) !== false) $coins[] = '5'; + if (($machine->settings['cash_coin_1'] ?? true) !== false) $coins[] = '1'; + + $cashStr = __('Cash Module'); + if (!empty($bills) || !empty($coins)) { + $cashStr .= ' ('; + if (!empty($bills)) $cashStr .= __('Bill') . ':' . implode('/', $bills); + if (!empty($bills) && !empty($coins)) $cashStr .= ' '; + if (!empty($coins)) $cashStr .= __('Coin') . ':' . implode('/', $coins); + $cashStr .= ')'; + } + $activeFeatures[] = $cashStr; + } + + $pickups = []; + if ($machine->settings['pickup_code_enabled'] ?? false) $pickups[] = __('Pickup Code'); + if ($machine->settings['pass_code_enabled'] ?? false) $pickups[] = __('Passcode'); + if (!empty($pickups)) { + $activeFeatures[] = __('Pickup Module') . ' (' . implode('/', $pickups) . ')'; + } + + if ($machine->shopping_cart_enabled) $activeFeatures[] = __('Shopping Cart'); + if ($machine->welcome_gift_enabled) $activeFeatures[] = __('Welcome Gift'); + } + if ($machine->member_system_enabled) $activeFeatures[] = __('Member System'); if ($machine->ambient_temp_monitoring_enabled) $activeFeatures[] = __('Ambient Temperature Monitoring'); @endphp