fix(performance): 계산식 입력 직후 차감 매출 숫자가 안 보이던 문제

칸 저장 뒤 총매출만 바꾸고 수수료·차감 매출(기본 보기)은 새로고침 때까지
예전 값(–)으로 흐리게 남겼다. 저장 응답에 그날 수수료·차감 매출을 함께
돌려주고 화면이 세 숫자를 바로 바꾼다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 13:15:57 +09:00
parent c655eb100d
commit 34dca7cb76
6 changed files with 22 additions and 8 deletions
+7 -2
View File
@@ -50,7 +50,7 @@ from fastapi.responses import FileResponse, HTMLResponse, JSONResponse
from app.timezone import today_kst
from . import common
from . import calc, common
from .adapters.registry import all_adapters, get_adapter
router = APIRouter(prefix="/performance", tags=["performance"])
@@ -424,8 +424,13 @@ def api_manual_sale(request: Request, code: str, day: str, payload: dict[str, An
except ManualMigrationNeeded:
raise HTTPException(status_code=503, detail=MANUAL_MIGRATION_HELP) from None
api_amount = store.api_amount(code, d)
shown = api_amount if amount is None else amount
# 그날 수수료·수수료 차감 매출도 돌려준다 — 화면이 새로고침 전에도 보고 있는 기준(기본 = 차감 매출) 숫자를 바로 바꾸게
rate_table = getattr(store, "rate_table", None)
money = calc.build_cells({(d, code): shown}, rate_table() if rate_table else {})[(d, code)].as_dict()
return JSONResponse({"ok": True, "code": code, "date": d.isoformat(), "manual": amount, "formula": formula,
"amount": api_amount if amount is None else amount, "api_amount": api_amount})
"amount": shown, "api_amount": api_amount,
"commission": money["commission"], "net": money["net"]})
@router.get("/api/manual-sales/sample.xlsx")