From f7decfb76efd94b8a1f3e317452f8eedbb4194f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sun, 22 Mar 2026 10:55:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[dev]=20stocks.item=5Ftype=EC=9D=84=20co?= =?UTF-8?q?mmon=5Fcodes=20=EB=8B=A8=EC=B6=95=EC=BD=94=EB=93=9C(PT/RM/SM)?= =?UTF-8?q?=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/V1/ReceivingController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/V1/ReceivingController.php b/app/Http/Controllers/Api/V1/ReceivingController.php index 80fbccdb..7a08e63b 100644 --- a/app/Http/Controllers/Api/V1/ReceivingController.php +++ b/app/Http/Controllers/Api/V1/ReceivingController.php @@ -303,8 +303,8 @@ public function forceCreate(Request $request) */ private function createStockAndLot(Item $item, int $tenantId, int $qty, int $userId, string $date, string $lotNo, Receiving $receiving, string $orderNo, string $supplier): Stock { - $itemTypeMap = ['FG' => 'purchased_part', 'PT' => 'bent_part', 'SM' => 'sub_material', 'RM' => 'raw_material', 'CS' => 'consumable']; - $stockType = $itemTypeMap[$item->item_type] ?? 'raw_material'; + // items.item_type 코드(FG/PT/SM/RM/CS)를 그대로 사용 (common_codes 매핑과 일치) + $stockType = $item->item_type ?: 'RM'; $stock = Stock::withoutGlobalScopes() ->where('tenant_id', $tenantId)