fix: 거래 세부 내역 '수금' 필드를 '공급가액'으로 변경 및 부가세 표시 추가

- 부정확한 '수금' 레이블을 '공급가액'으로 수정
- 부가세 (SL_MY_rec_vat) 필드 추가 조회 및 표시
- 공급가액 + 부가세 = 판매 금액 구조로 명확화

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
시골약사 2026-01-23 19:13:31 +09:00
parent aa222eec3a
commit 622a143e19
3 changed files with 92 additions and 3 deletions

View File

@ -391,6 +391,7 @@ def admin_transaction_detail(transaction_id):
SL_MY_sale, SL_MY_sale,
SL_MY_credit, SL_MY_credit,
SL_MY_recive, SL_MY_recive,
SL_MY_rec_vat,
ISNULL(SL_NM_custom, '[비고객]') AS customer_name ISNULL(SL_NM_custom, '[비고객]') AS customer_name
FROM SALE_MAIN FROM SALE_MAIN
WHERE SL_NO_order = :transaction_id 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), 'discount': int(sale_main.SL_MY_discount or 0),
'sale_amount': int(sale_main.SL_MY_sale or 0), 'sale_amount': int(sale_main.SL_MY_sale or 0),
'credit': int(sale_main.SL_MY_credit 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 'customer_name': sale_main.customer_name
}, },
'items': [ 'items': [

View File

@ -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')

View File

@ -407,8 +407,12 @@
<div style="color: #212529; font-size: 16px; font-weight: 600;">${tx.credit.toLocaleString()}원</div> <div style="color: #212529; font-size: 16px; font-weight: 600;">${tx.credit.toLocaleString()}원</div>
</div> </div>
<div> <div>
<div style="color: #868e96; font-size: 13px; margin-bottom: 6px;">수금</div> <div style="color: #868e96; font-size: 13px; margin-bottom: 6px;">공급가액</div>
<div style="color: #37b24d; font-size: 16px; font-weight: 600;">${tx.received.toLocaleString()}원</div> <div style="color: #37b24d; font-size: 16px; font-weight: 600;">${tx.supply_value.toLocaleString()}원</div>
</div>
<div>
<div style="color: #868e96; font-size: 13px; margin-bottom: 6px;">부가세</div>
<div style="color: #495057; font-size: 16px; font-weight: 600;">${tx.vat.toLocaleString()}원</div>
</div> </div>
</div> </div>
</div> </div>