fix(branch-fee): 본사(HQ) 제외 + 계산서 발행 명의(supplier_branch) 기준
Deploy momo-erp / deploy (push) Successful in 2m6s

지사관리:
- WHERE COALESCE(supplier_branch, statement_branch, 'HQ') != 'HQ'
  → 본사 발주 완전 제외, 김포 등 지사 명의 계산서만
- snapshot 우선 (supplier_branch) → 옛 발주 폴백 (user_info.statement_branch)
- UI: 본사 row 표시 분기 제거, '본사 외' 명시

창고이동 통계:
- 본사 계열(HQ_*) → 김포 계열(KIMPO_*) 이동만 필터링
- 같은 본사 내 이동, 같은 김포 내 이동, 김포→본사 역방향 모두 제외
This commit is contained in:
chpark
2026-05-14 15:08:18 +09:00
parent bb21be260f
commit 7977ffff19
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -63,10 +63,10 @@ export default function TransfersPage() {
<div> <div>
<h1 className="text-xl font-bold flex items-center gap-2"> <h1 className="text-xl font-bold flex items-center gap-2">
<ArrowRightLeft size={20} className="text-sky-700" /> <ArrowRightLeft size={20} className="text-sky-700" />
( )
</h1> </h1>
<p className="text-xs text-slate-500 mt-0.5"> <p className="text-xs text-slate-500 mt-0.5">
(TRANSFER). × (cost_price) = . // . <b> </b> <b> </b>(///) . × (cost_price) = .
</p> </p>
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
+7 -1
View File
@@ -11,7 +11,13 @@ export async function POST(req: NextRequest) {
const dateFrom = body.dateFrom as string | undefined; const dateFrom = body.dateFrom as string | undefined;
const dateTo = body.dateTo as string | undefined; const dateTo = body.dateTo as string | undefined;
const conditions: string[] = ["SM.ref_type = 'TRANSFER'", "SM.move_type = 'OUT'"]; // 본사(HQ_*) → 김포(KIMPO_*) 이동만 합산 — 사용자 요구
const conditions: string[] = [
"SM.ref_type = 'TRANSFER'",
"SM.move_type = 'OUT'",
"SW.wh_type LIKE 'HQ_%'",
"TW.wh_type LIKE 'KIMPO_%'",
];
const params: unknown[] = []; const params: unknown[] = [];
let i = 1; let i = 1;
if (dateFrom) { conditions.push(`SM.regdate >= $${i++}::date`); params.push(dateFrom); } if (dateFrom) { conditions.push(`SM.regdate >= $${i++}::date`); params.push(dateFrom); }