feat: 제품 검색 페이지에 재고 컬럼 추가 (초록/빨강 표시)

This commit is contained in:
thug0bin
2026-02-28 11:59:49 +09:00
parent c1c38c68ac
commit 95d7ebab71
6 changed files with 226 additions and 107 deletions

View File

@@ -3067,8 +3067,10 @@ def api_products():
ELSE ''
END as supplier,
CASE WHEN SET_CHK.is_set = 1 THEN 1 ELSE 0 END as is_set,
G.POS_BOON as pos_boon
G.POS_BOON as pos_boon,
ISNULL(IT.IM_QT_sale_debit, 0) as stock
FROM CD_GOODS G
LEFT JOIN IM_total IT ON G.DrugCode = IT.DrugCode
OUTER APPLY (
SELECT TOP 1 CD_CD_BARCODE
FROM CD_ITEM_UNIT_MEMBER
@@ -3108,7 +3110,8 @@ def api_products():
'cost_price': float(row.cost_price) if row.cost_price else 0,
'supplier': row.supplier or '',
'is_set': bool(row.is_set),
'is_animal_drug': is_animal
'is_animal_drug': is_animal,
'stock': int(row.stock) if row.stock else 0
})
return jsonify({