feat: POS GUI에 QR 발행 여부 시각적 표시 추가
- claim_tokens 테이블 조회하여 각 거래의 QR 발행 여부 확인 - 테이블에 'QR' 컬럼 추가 (9번째 컬럼, 60px 너비) - 발행됨: 초록색 체크마크(✓) 표시 (폰트 크기 14, 굵게) - 미발행: 회색 하이픈(-) 표시 - 툴팁으로 'QR 발행 완료' / 'QR 미발행' 상태 안내 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3102940c09
commit
77c82f395e
@ -81,6 +81,14 @@ class SalesQueryThread(QThread):
|
||||
item_count_row = mssql_cursor.fetchone()
|
||||
item_count = item_count_row[0] if item_count_row else 0
|
||||
|
||||
# SQLite에서 QR 발행 여부 확인
|
||||
sqlite_cursor.execute("""
|
||||
SELECT id FROM claim_tokens
|
||||
WHERE transaction_id = ?
|
||||
""", (order_no,))
|
||||
qr_record = sqlite_cursor.fetchone()
|
||||
qr_issued = bool(qr_record)
|
||||
|
||||
# SQLite에서 적립 사용자 조회
|
||||
sqlite_cursor.execute("""
|
||||
SELECT u.nickname, u.phone, ct.claimable_points
|
||||
@ -108,7 +116,8 @@ class SalesQueryThread(QThread):
|
||||
'item_count': item_count,
|
||||
'claimed_name': claimed_name,
|
||||
'claimed_phone': claimed_phone,
|
||||
'claimed_points': claimed_points
|
||||
'claimed_points': claimed_points,
|
||||
'qr_issued': qr_issued
|
||||
})
|
||||
|
||||
self.query_complete.emit(sales_list)
|
||||
@ -578,9 +587,9 @@ class POSSalesGUI(QMainWindow):
|
||||
sales_group.setLayout(sales_layout)
|
||||
|
||||
self.sales_table = QTableWidget()
|
||||
self.sales_table.setColumnCount(8)
|
||||
self.sales_table.setColumnCount(9)
|
||||
self.sales_table.setHorizontalHeaderLabels([
|
||||
'주문번호', '시간', '금액', '고객명', '품목수', '적립자명', '전화번호', '적립포인트'
|
||||
'주문번호', '시간', '금액', '고객명', '품목수', '적립자명', '전화번호', '적립포인트', 'QR'
|
||||
])
|
||||
self.sales_table.setColumnWidth(0, 160)
|
||||
self.sales_table.setColumnWidth(1, 70)
|
||||
@ -590,6 +599,7 @@ class POSSalesGUI(QMainWindow):
|
||||
self.sales_table.setColumnWidth(5, 100)
|
||||
self.sales_table.setColumnWidth(6, 120)
|
||||
self.sales_table.setColumnWidth(7, 100)
|
||||
self.sales_table.setColumnWidth(8, 60)
|
||||
self.sales_table.setSelectionBehavior(QTableWidget.SelectRows)
|
||||
self.sales_table.doubleClicked.connect(self.show_sale_detail)
|
||||
self.sales_table.cellClicked.connect(self.on_cell_clicked)
|
||||
@ -720,6 +730,23 @@ class POSSalesGUI(QMainWindow):
|
||||
claimed_points_item.setToolTip('클릭하여 회원 마일리지 내역 보기')
|
||||
self.sales_table.setItem(row, 7, claimed_points_item)
|
||||
|
||||
# QR 발행 여부 (SQLite)
|
||||
qr_status_item = QTableWidgetItem()
|
||||
qr_status_item.setTextAlignment(Qt.AlignCenter)
|
||||
if sale['qr_issued']:
|
||||
qr_status_item.setText('✓')
|
||||
qr_status_item.setForeground(QColor('#4CAF50'))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
font.setPointSize(14)
|
||||
qr_status_item.setFont(font)
|
||||
qr_status_item.setToolTip('QR 발행 완료')
|
||||
else:
|
||||
qr_status_item.setText('-')
|
||||
qr_status_item.setForeground(QColor('#BDBDBD'))
|
||||
qr_status_item.setToolTip('QR 미발행')
|
||||
self.sales_table.setItem(row, 8, qr_status_item)
|
||||
|
||||
def on_query_error(self, error_msg):
|
||||
"""DB 조회 에러 처리"""
|
||||
QMessageBox.critical(self, '오류', f'조회 실패:\n{error_msg}')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user