[PROMOTE] dev -> demo: 銷售紀錄付款狀態預設「已完成」+ 新增「待領取」
1. 付款狀態預設「已完成」(避免 failed 被誤會成刷卡失敗);「所有付款狀態」改為 value=all 明確選項 2. 新增 awaiting_pickup(待領取) 至下拉與各狀態顯示(徽章/明細面板/匯出標籤)
This commit is contained in:
commit
2bdad21810
@ -35,7 +35,9 @@ class SalesController extends Controller
|
||||
$search = $request->input('search');
|
||||
$machineId = $request->input('machine_id');
|
||||
$paymentType = $request->input('payment_type');
|
||||
$status = $request->input('status');
|
||||
// 付款狀態預設只看「已完成」:避免客戶把 failed(付款失敗/逾時) 誤會成刷卡失敗。
|
||||
// 「所有付款狀態」為明確選項 status=all(非空值,AJAX 才不會當空值丟掉)。
|
||||
$status = $request->input('status', 'completed');
|
||||
$deliveryStatus = $request->input('delivery_status');
|
||||
$startDate = $request->input('start_date');
|
||||
$endDate = $request->input('end_date');
|
||||
@ -138,7 +140,7 @@ class SalesController extends Controller
|
||||
// 訂單專用過濾器
|
||||
if ($tab === 'orders') {
|
||||
if ($paymentType) $ordersQuery->where('payment_type', $paymentType);
|
||||
if ($status) $ordersQuery->where('status', $status);
|
||||
if ($status && $status !== 'all') $ordersQuery->where('status', $status);
|
||||
// 出貨狀態:唯有付款成功(completed/paid)的單才有出貨結果,需與列表顯示邏輯 (hasDeliveryOutcome) 一致
|
||||
if ($deliveryStatus !== null && $deliveryStatus !== '') {
|
||||
$ordersQuery->whereIn('status', [Order::STATUS_COMPLETED, 'paid'])
|
||||
@ -1545,6 +1547,7 @@ class SalesController extends Controller
|
||||
'pending' => __('Pending'),
|
||||
'paid' => __('Paid'),
|
||||
'completed' => __('Completed'),
|
||||
'awaiting_pickup' => __('Awaiting Pickup'),
|
||||
'failed' => __('Failed'),
|
||||
'abandoned' => __('Unpaid'),
|
||||
'cancelled' => __('Cancelled'),
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
'pending' => 'pending',
|
||||
'paid' => 'active',
|
||||
'completed' => 'active',
|
||||
'awaiting_pickup' => 'pending',
|
||||
'failed' => 'error',
|
||||
'abandoned' => 'disabled',
|
||||
'cancelled' => 'disabled',
|
||||
@ -43,6 +44,7 @@
|
||||
'pending' => __('Pending'),
|
||||
'paid' => __('Paid'),
|
||||
'completed' => __('Completed'),
|
||||
'awaiting_pickup' => __('Awaiting Pickup'),
|
||||
'failed' => __('Failed'),
|
||||
'abandoned' => __('Unpaid'),
|
||||
'cancelled' => __('Cancelled'),
|
||||
|
||||
@ -31,11 +31,14 @@
|
||||
|
||||
{{-- 付款狀態 --}}
|
||||
<div class="w-full lg:w-44">
|
||||
<x-searchable-select name="status" :placeholder="__('All Payment Statuses')" :selected="$filters['status']"
|
||||
{{-- 不傳 placeholder:避免產生 value=" " 的空值選項;「所有付款狀態」改為明確的 value=all 選項,預設為「已完成」 --}}
|
||||
<x-searchable-select name="status" :selected="$filters['status']"
|
||||
:has-search="false" @change="$el.closest('form').dispatchEvent(new Event('submit'))">
|
||||
<option value="all" {{ $filters['status']==='all' ? 'selected' : '' }} data-title="{{ __('All Payment Statuses') }}">{{ __('All Payment Statuses') }}</option>
|
||||
<option value="pending" {{ $filters['status']==='pending' ? 'selected' : '' }} data-title="{{ __('Pending') }}">{{ __('Pending') }}</option>
|
||||
<option value="paid" {{ $filters['status']==='paid' ? 'selected' : '' }} data-title="{{ __('Paid') }}">{{ __('Paid') }}</option>
|
||||
<option value="completed" {{ $filters['status']==='completed' ? 'selected' : '' }} data-title="{{ __('Completed') }}">{{ __('Completed') }}</option>
|
||||
<option value="awaiting_pickup" {{ $filters['status']==='awaiting_pickup' ? 'selected' : '' }} data-title="{{ __('Awaiting Pickup') }}">{{ __('Awaiting Pickup') }}</option>
|
||||
<option value="failed" {{ $filters['status']==='failed' ? 'selected' : '' }} data-title="{{ __('Failed') }}">{{ __('Failed') }}</option>
|
||||
<option value="abandoned" {{ $filters['status']==='abandoned' ? 'selected' : '' }} data-title="{{ __('Unpaid') }}">{{ __('Unpaid') }}</option>
|
||||
<option value="cancelled" {{ $filters['status']==='cancelled' ? 'selected' : '' }} data-title="{{ __('Cancelled') }}">{{ __('Cancelled') }}</option>
|
||||
@ -325,6 +328,8 @@
|
||||
'pending' => ['label' => __('Pending'), 'color' => 'amber'],
|
||||
'paid' => ['label' => __('Paid'), 'color' => 'emerald'],
|
||||
'completed' => ['label' => __('Completed'), 'color' => 'emerald'],
|
||||
'awaiting_pickup' => ['label' => __('Awaiting Pickup'), 'color' => 'amber'],
|
||||
'awaiting_pickup' => ['label' => __('Awaiting Pickup'), 'color' => 'amber'],
|
||||
'failed' => ['label' => __('Failed'), 'color' => 'rose'],
|
||||
'abandoned' => ['label' => __('Unpaid'), 'color' => 'slate'],
|
||||
'cancelled' => ['label' => __('Cancelled'), 'color' => 'slate'],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user