fix: V2 비급여 매출금액 계산 수정 - EXE_PRICE 사용

비급여(MPRE_TYPE='9') 처방의 매출금액:
- V1: PRICE_T에 비급여 총액이 들어감
- V2: TOT_PRICE는 조제료만, EXE_PRICE에 비급여 총액

수정:
- PRICE_T = CASE WHEN MPRE_TYPE='9' THEN EXE_PRICE ELSE TOT_PRICE END

검증 (2026년 3월):
- V1 비급여 매출: 3,804,250
- V2 비급여 매출: 3,804,250
- 차이: 0 
This commit is contained in:
root
2026-04-01 15:34:56 +00:00
parent fc0f6832c3
commit 9836d2bdab
2 changed files with 5 additions and 1 deletions

View File

@@ -91,7 +91,11 @@ def get_sales_stats(date_from: str, date_to: str) -> dict:
WHEN m.PRES_TIME_GUBUN = '1' THEN '3' WHEN m.PRES_TIME_GUBUN = '1' THEN '3'
ELSE '1' ELSE '1'
END AS Holiday, END AS Holiday,
m.TOT_PRICE AS PRICE_T, -- 비급여(MPRE_TYPE='9')는 TOT_PRICE가 아닌 EXE_PRICE가 매출금액
CASE
WHEN m.MPRE_TYPE = '9' THEN m.EXE_PRICE
ELSE m.TOT_PRICE
END AS PRICE_T,
(ISNULL(m.NON_DRUG_PRICE, 0) + ISNULL(m.EXP_EXE_PRICE, 0)) AS Drug_T4, (ISNULL(m.NON_DRUG_PRICE, 0) + ISNULL(m.EXP_EXE_PRICE, 0)) AS Drug_T4,
m.INS_PREP_PRICE AS S_Prep, m.INS_PREP_PRICE AS S_Prep,
m.INS_PRICE AS PRICE_C, m.INS_PRICE AS PRICE_C,