From dc7dd2776b773b65928f64f5b492df6feae28c64 Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 16 Apr 2026 13:41:35 +0900 Subject: [PATCH] feat: Enhance receiving update functionality and clean up imports - Updated the receiving controller to allow for the update of inbound records, including both header and item fields (inbound_qty, unit_price, total_amount). - Cleaned up the import statements in the receiving page by removing a duplicate toast import, improving code clarity and maintainability. --- backend-node/src/controllers/receivingController.ts | 8 +++++++- .../app/(main)/COMPANY_30/logistics/receiving/page.tsx | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend-node/src/controllers/receivingController.ts b/backend-node/src/controllers/receivingController.ts index 06d13b6e..0a40b6e8 100644 --- a/backend-node/src/controllers/receivingController.ts +++ b/backend-node/src/controllers/receivingController.ts @@ -472,7 +472,7 @@ export async function update(req: AuthenticatedRequest, res: Response) { await client.query("BEGIN"); - // 헤더 업데이트 (inbound_mng) — 헤더 레벨 필드만 + // 입고 레코드 업데이트 (헤더 + 품목 필드 모두) const headerResult = await client.query( `UPDATE inbound_mng SET inbound_date = COALESCE($1::date, inbound_date), @@ -482,6 +482,9 @@ export async function update(req: AuthenticatedRequest, res: Response) { inspector = COALESCE($5, inspector), manager = COALESCE($6, manager), memo = COALESCE($7, memo), + inbound_qty = COALESCE($11::numeric, inbound_qty), + unit_price = COALESCE($12::numeric, unit_price), + total_amount = COALESCE($13::numeric, total_amount), updated_date = NOW(), updated_by = $8 WHERE id = $9 AND company_code = $10 @@ -497,6 +500,9 @@ export async function update(req: AuthenticatedRequest, res: Response) { userId, id, companyCode, + inbound_qty || null, + unit_price || null, + total_amount || null, ], ); diff --git a/frontend/app/(main)/COMPANY_30/logistics/receiving/page.tsx b/frontend/app/(main)/COMPANY_30/logistics/receiving/page.tsx index a80f1e07..c6875196 100644 --- a/frontend/app/(main)/COMPANY_30/logistics/receiving/page.tsx +++ b/frontend/app/(main)/COMPANY_30/logistics/receiving/page.tsx @@ -56,7 +56,6 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover import { cn } from "@/lib/utils"; import { toast } from "sonner"; import { apiClient } from "@/lib/api/client"; -import { toast } from "sonner"; import { useTableSettings } from "@/hooks/useTableSettings"; import { TableSettingsModal } from "@/components/common/TableSettingsModal"; import { DynamicSearchFilter, FilterValue } from "@/components/common/DynamicSearchFilter";