feat: 整合門市領料日誌、API 文件存取、修改庫存與併發編號問題、供應商商品內聯編輯及日誌 UI 優化
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m0s

This commit is contained in:
2026-03-02 16:42:12 +08:00
parent 7dac2d1f77
commit 0a955fb993
33 changed files with 1424 additions and 853 deletions

View File

@@ -186,8 +186,14 @@ class InventoryController extends Controller
]);
return DB::transaction(function () use ($validated, $warehouse) {
// 修正時間精度:手動入庫亦補上當下時分秒
$inboundDateTime = $validated['inboundDate'] . ' ' . date('H:i:s');
// 修正時間精度:使用 Carbon 解析,若含時間則保留並補上秒數,若只有日期則補上當前時間
$dt = \Illuminate\Support\Carbon::parse($validated['inboundDate']);
if ($dt->hour === 0 && $dt->minute === 0 && $dt->second === 0) {
$dt->setTimeFrom(now());
} else {
$dt->setSecond(now()->second);
}
$inboundDateTime = $dt->toDateTimeString();
$this->inventoryService->processIncomingInventory($warehouse, $validated['items'], [
'inboundDate' => $inboundDateTime,

View File

@@ -284,7 +284,7 @@ class ProductController extends Controller
*/
public function template()
{
return Excel::download(new ProductTemplateExport, 'products_template.xlsx');
return Excel::download(new ProductTemplateExport, '商品匯入範本.xlsx');
}
/**

View File

@@ -143,15 +143,16 @@ class StoreRequisitionController extends Controller
'items.*.requested_qty.min' => '需求數量必須大於 0',
]);
$submitImmediately = $request->boolean('submit_immediately');
$requisition = $this->service->create(
$request->only(['store_warehouse_id', 'remark']),
$request->items,
auth()->id()
auth()->id(),
$submitImmediately
);
// 如果需要直接提交
if ($request->boolean('submit_immediately')) {
$this->service->submit($requisition, auth()->id());
if ($submitImmediately) {
return redirect()->route('store-requisitions.index')
->with('success', '叫貨單已提交審核');
}

View File

@@ -99,6 +99,24 @@ class TransferOrderController extends Controller
auth()->id(),
$transitWarehouseId
);
// 手動發送「已建立」日誌,因為服務層使用了 saveQuietly 抑制自動日誌
activity()
->performedOn($order)
->causedBy(auth()->id())
->event('created')
->withProperties([
'attributes' => [
'doc_no' => $order->doc_no,
'from_warehouse_id' => $order->from_warehouse_id,
'to_warehouse_id' => $order->to_warehouse_id,
'transit_warehouse_id' => $order->transit_warehouse_id,
'remarks' => $order->remarks,
'status' => $order->status,
'created_by' => $order->created_by,
]
])
->log('created');
if ($request->input('instant_post') === true) {
try {