[PROMOTE] dev → demo:領藥單核銷與批價單號掃碼修正晉升驗收
1. 領藥單核銷流程:改由出貨 finalize 處理,B660 回傳批價單號(pricing_slip_no)。 2. 領藥單建立頁批價單號欄位攔截 Enter,避免掃碼器掃完 QR 自動送出誤觸建立。
This commit is contained in:
commit
aecb2f17d1
@ -761,16 +761,14 @@ class MachineController extends Controller
|
|||||||
], 409);
|
], 409);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 標記碼已領(usage_count++;達上限轉 used)——僅領藥單,避免動到既有單貨道核銷流程
|
// 不在「驗證/掃碼」當下核銷領藥碼。核銷統一改由機台實際出貨後的
|
||||||
$pickupCode->usage_count = (int) $pickupCode->usage_count + 1;
|
// MQTT finalize(TransactionService::finalizePharmacyDispense)標記為 used,
|
||||||
$pickupCode->used_at = $pickupCode->used_at ?? now();
|
// 這樣顧客掃碼後若未按「確定取貨」(逾時/取消、未出貨),領藥碼仍維持 active 可再次掃碼領取。
|
||||||
if ($pickupCode->usage_count >= (int) $pickupCode->usage_limit) {
|
// (原本在此處 usage_count++/轉 used 會在尚未取貨時就把碼鎖死,導致再掃顯示「已領」。)
|
||||||
$pickupCode->status = 'used';
|
|
||||||
}
|
|
||||||
$pickupCode->save();
|
|
||||||
|
|
||||||
$data['order_type'] = \App\Models\Transaction\Order::TYPE_PHARMACY_PICKUP;
|
$data['order_type'] = \App\Models\Transaction\Order::TYPE_PHARMACY_PICKUP;
|
||||||
$data['order_no'] = $order->order_no;
|
$data['order_no'] = $order->order_no;
|
||||||
|
$data['pricing_slip_no'] = $order->pricing_slip_no ?? ''; // 批價單號(藥師批價依據);機台「確認領藥」畫面備註欄顯示
|
||||||
$data['items'] = $items; // [{slot_no, product_id, product_name, qty}, ...]
|
$data['items'] = $items; // [{slot_no, product_id, product_name, qty}, ...]
|
||||||
$data['status'] = $pickupCode->status;
|
$data['status'] = $pickupCode->status;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -268,6 +268,7 @@
|
|||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<label class="text-xs font-black text-slate-500 uppercase tracking-widest pl-1">{{ __('Pricing Slip No.') }} <span class="text-slate-300 normal-case font-bold">({{ __('optional') }})</span></label>
|
<label class="text-xs font-black text-slate-500 uppercase tracking-widest pl-1">{{ __('Pricing Slip No.') }} <span class="text-slate-300 normal-case font-bold">({{ __('optional') }})</span></label>
|
||||||
<input type="text" name="pricing_slip_no" x-model="pricingSlipNo" maxlength="64"
|
<input type="text" name="pricing_slip_no" x-model="pricingSlipNo" maxlength="64"
|
||||||
|
@keydown.enter.prevent
|
||||||
class="luxury-input w-full py-3 px-4 text-sm" placeholder="{{ __('e.g. the hospital pricing slip number') }}">
|
class="luxury-input w-full py-3 px-4 text-sm" placeholder="{{ __('e.g. the hospital pricing slip number') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user