From 622a143e192e69b0f6b76f23a7e7fc8e5035e632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=9C=EA=B3=A8=EC=95=BD=EC=82=AC?= Date: Fri, 23 Jan 2026 19:13:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B1=B0=EB=9E=98=20=EC=84=B8=EB=B6=80?= =?UTF-8?q?=20=EB=82=B4=EC=97=AD=20'=EC=88=98=EA=B8=88'=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EB=A5=BC=20'=EA=B3=B5=EA=B8=89=EA=B0=80=EC=95=A1'?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=B6=80?= =?UTF-8?q?=EA=B0=80=EC=84=B8=20=ED=91=9C=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 부정확한 '수금' 레이블을 '공급가액'으로 수정 - 부가세 (SL_MY_rec_vat) 필드 추가 조회 및 표시 - 공급가액 + 부가세 = 판매 금액 구조로 명확화 Co-Authored-By: Claude Sonnet 4.5 --- backend/app.py | 4 +- backend/check_sale_data.py | 83 ++++++++++++++++++++++++++++++++++++ backend/templates/admin.html | 8 +++- 3 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 backend/check_sale_data.py diff --git a/backend/app.py b/backend/app.py index 6e2c6cc..433e166 100644 --- a/backend/app.py +++ b/backend/app.py @@ -391,6 +391,7 @@ def admin_transaction_detail(transaction_id): SL_MY_sale, SL_MY_credit, SL_MY_recive, + SL_MY_rec_vat, ISNULL(SL_NM_custom, '[비고객]') AS customer_name FROM SALE_MAIN WHERE SL_NO_order = :transaction_id @@ -430,7 +431,8 @@ def admin_transaction_detail(transaction_id): 'discount': int(sale_main.SL_MY_discount or 0), 'sale_amount': int(sale_main.SL_MY_sale or 0), 'credit': int(sale_main.SL_MY_credit or 0), - 'received': int(sale_main.SL_MY_recive or 0), + 'supply_value': int(sale_main.SL_MY_recive or 0), + 'vat': int(sale_main.SL_MY_rec_vat or 0), 'customer_name': sale_main.customer_name }, 'items': [ diff --git a/backend/check_sale_data.py b/backend/check_sale_data.py new file mode 100644 index 0000000..9a53af3 --- /dev/null +++ b/backend/check_sale_data.py @@ -0,0 +1,83 @@ +""" +특정 거래의 SALE_SUB 데이터 확인 +""" + +import sys +import os +sys.path.insert(0, os.path.dirname(__file__)) + +from db.dbsetup import DatabaseManager +from sqlalchemy import text + +def check_sale_sub_data(transaction_id): + """특정 거래의 판매 상세 데이터 확인""" + db_manager = DatabaseManager() + + try: + session = db_manager.get_session('PM_PRES') + + # SALE_SUB 모든 컬럼 조회 + query = text(""" + SELECT * + FROM SALE_SUB + WHERE SL_NO_order = :transaction_id + """) + + result = session.execute(query, {'transaction_id': transaction_id}).fetchone() + + if result: + print("=" * 80) + print(f"거래번호 {transaction_id}의 SALE_SUB 데이터") + print("=" * 80) + + # 모든 컬럼 출력 + for key in result._mapping.keys(): + value = result._mapping[key] + print(f"{key:30} = {value}") + + print("=" * 80) + else: + print(f"거래번호 {transaction_id}를 찾을 수 없습니다.") + + except Exception as e: + print(f"오류 발생: {e}") + finally: + db_manager.close_all() + +def check_sale_main_data(transaction_id): + """특정 거래의 SALE_MAIN 데이터 확인""" + db_manager = DatabaseManager() + + try: + session = db_manager.get_session('PM_PRES') + + query = text(""" + SELECT * + FROM SALE_MAIN + WHERE SL_NO_order = :transaction_id + """) + + result = session.execute(query, {'transaction_id': transaction_id}).fetchone() + + if result: + print("\n" + "=" * 80) + print(f"거래번호 {transaction_id}의 SALE_MAIN 데이터") + print("=" * 80) + + for key in result._mapping.keys(): + value = result._mapping[key] + print(f"{key:30} = {value}") + + print("=" * 80) + else: + print(f"거래번호 {transaction_id}를 찾을 수 없습니다.") + + except Exception as e: + print(f"오류 발생: {e}") + finally: + db_manager.close_all() + +if __name__ == '__main__': + # 스크린샷의 거래번호 + check_sale_sub_data('20260123000261') + check_sale_main_data('20260123000261') diff --git a/backend/templates/admin.html b/backend/templates/admin.html index 416fb40..8f6fd1a 100644 --- a/backend/templates/admin.html +++ b/backend/templates/admin.html @@ -407,8 +407,12 @@
${tx.credit.toLocaleString()}원
-
수금
-
${tx.received.toLocaleString()}원
+
공급가액
+
${tx.supply_value.toLocaleString()}원
+
+
+
부가세
+
${tx.vat.toLocaleString()}원