feat: 알림톡 발송 로그 시스템 + 현영 표시 + 문서화

- 알림톡 발송 로그: alimtalk_logs SQLite 테이블 + DB 자동 기록
- /admin/alimtalk 페이지: 서버 로그, NHN Cloud 내역 조회, 수동 발송 테스트
- 적립일시 포맷 수정: %Y-%m-%d %H:%M (16자 초과) → %m/%d %H:%M (11자)
- POS GUI 현금영수증(현영) 표시: 청록색 볼드
- 결제수납구조.md: CD_SUNAB/PS_main/SALE_MAIN 3테이블 관계 문서
- 실행구조.md: Flask 서버 + Qt GUI 실행 가이드

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thug0bin
2026-02-26 19:28:29 +09:00
parent 0c52542713
commit a3ff69b67f
10 changed files with 1117 additions and 82 deletions

View File

@@ -78,12 +78,16 @@ class SalesQueryThread(QThread):
ISNULL(S.card_total, 0) AS card_total,
ISNULL(S.cash_total, 0) AS cash_total,
ISNULL(M.SL_MY_total, 0) AS total_amount,
ISNULL(M.SL_MY_discount, 0) AS discount
ISNULL(M.SL_MY_discount, 0) AS discount,
S.cash_receipt_mode,
S.cash_receipt_num
FROM SALE_MAIN M
OUTER APPLY (
SELECT TOP 1
ISNULL(ETC_CARD, 0) + ISNULL(OTC_CARD, 0) AS card_total,
ISNULL(ETC_CASH, 0) + ISNULL(OTC_CASH, 0) AS cash_total
ISNULL(ETC_CASH, 0) + ISNULL(OTC_CASH, 0) AS cash_total,
nCASHINMODE AS cash_receipt_mode,
nAPPROVAL_NUM AS cash_receipt_num
FROM CD_SUNAB
WHERE PRESERIAL = M.SL_NO_order
) S
@@ -96,7 +100,7 @@ class SalesQueryThread(QThread):
sales_list = []
for row in rows:
order_no, insert_time, sale_amount, customer, card_total, cash_total, total_amount, discount = row
order_no, insert_time, sale_amount, customer, card_total, cash_total, total_amount, discount, cash_receipt_mode, cash_receipt_num = row
# 품목 수 조회 (SALE_SUB)
mssql_cursor.execute("""
@@ -136,12 +140,17 @@ class SalesQueryThread(QThread):
# 결제수단 판별
card_amt = float(card_total) if card_total else 0.0
cash_amt = float(cash_total) if cash_total else 0.0
# 현금영수증: nCASHINMODE='1' AND nAPPROVAL_NUM 존재 (mode=2는 카드거래 자동세팅)
has_cash_receipt = (
str(cash_receipt_mode or '').strip() == '1'
and str(cash_receipt_num or '').strip() != ''
)
if card_amt > 0 and cash_amt > 0:
pay_method = '카드+현금'
elif card_amt > 0:
pay_method = '카드'
elif cash_amt > 0:
pay_method = '현금'
pay_method = '' if has_cash_receipt else ''
else:
pay_method = ''
paid = (card_amt + cash_amt) > 0
@@ -862,6 +871,11 @@ class POSSalesGUI(QMainWindow):
pay_item.setTextAlignment(Qt.AlignCenter)
if sale['pay_method'] == '카드':
pay_item.setForeground(QColor('#1976D2'))
elif sale['pay_method'] == '현영':
pay_item.setForeground(QColor('#00897B')) # 청록 (현금영수증)
f = QFont()
f.setBold(True)
pay_item.setFont(f)
elif sale['pay_method'] == '현금':
pay_item.setForeground(QColor('#E65100'))
elif sale['pay_method']: