ui(malaysia): Qty 150px·name 한줄, 재고조사 3분할, 재고현황 낱개/콤보 2분할
- Qty 컬럼 150px 고정, 상품명 줄바꿈 방지(nowrap) - 콤보 Qty(OUT) 헤더 → Qty - 일일 재고조사 상세 3분할(좌 정보/동작·중 낱개·우 콤보) - 재고현황: 좌 낱개 분해 전체 + 우 콤보(최근 재고조사 세트 수량) - db.latest_set_quantities 추가 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,34 +1,71 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<style>
|
||||
.mys-compact .erp-table th,
|
||||
.mys-compact .erp-table td { padding-top:4px; padding-bottom:4px; }
|
||||
.mys-compact td.nm { white-space:nowrap; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="mys">
|
||||
<section class="mys mys-compact">
|
||||
{% set active_tab = 'status' %}
|
||||
{% include "malaysia/_nav.html" %}
|
||||
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head" style="display:flex;justify-content:space-between;align-items:center;">
|
||||
<h2>재고 현황 ({{ rows|length }})</h2>
|
||||
<span class="erp-muted">현재고 = 입고 − 출고 + 조정 + 재고조사반영 (낱개 아이템 기준)</span>
|
||||
<div style="display:grid;grid-template-columns:1fr 420px;gap:16px;align-items:start;">
|
||||
|
||||
<!-- 좌: 낱개로 분리된 전체 재고 -->
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head" style="display:flex;justify-content:space-between;align-items:center;">
|
||||
<h2>재고 현황 — 낱개 기준 ({{ rows|length }})</h2>
|
||||
<span class="erp-muted">현재고 = 입고 − 출고 + 조정 + 재고조사반영 (콤보는 낱개로 분해 반영됨)</span>
|
||||
</div>
|
||||
<div class="erp-table-wrap">
|
||||
<table class="erp-table">
|
||||
<thead>
|
||||
<tr><th>Item Code</th><th>Product Name</th><th style="text-align:right">Current Qty</th><th>Last Stocktake</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in rows %}
|
||||
<tr>
|
||||
<td>{{ r.item_code }}</td>
|
||||
<td class="nm">{{ r.item_name }}</td>
|
||||
<td style="text-align:right;font-weight:600;">{{ r.current_qty }}</td>
|
||||
<td>{{ r.last_stocktake_date or '—' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if not rows %}
|
||||
<tr><td colspan="4" class="erp-muted">표시할 재고가 없습니다.</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-table-wrap">
|
||||
<table class="erp-table">
|
||||
<thead>
|
||||
<tr><th>Item Code</th><th>Product Name</th><th style="text-align:right">Current Qty</th><th>Last Stocktake</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in rows %}
|
||||
<tr>
|
||||
<td>{{ r.item_code }}</td>
|
||||
<td>{{ r.item_name }}</td>
|
||||
<td style="text-align:right;font-weight:600;">{{ r.current_qty }}</td>
|
||||
<td>{{ r.last_stocktake_date or '—' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if not rows %}
|
||||
<tr><td colspan="4" class="erp-muted">표시할 재고가 없습니다.</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 우: 콤보(세트) 단위 재고 -->
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head"><h2>콤보 재고 (세트 단위)</h2></div>
|
||||
<span class="erp-muted">
|
||||
{% if set_stocktake_date %}최근 재고조사 {{ set_stocktake_date }} 기준 입력 수량{% else %}재고조사 입력 없음{% endif %}
|
||||
</span>
|
||||
<div class="erp-table-wrap" style="margin-top:8px;">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Set Code</th><th>Set Name</th><th style="text-align:right">Qty</th></tr></thead>
|
||||
<tbody>
|
||||
{% for s in set_rows %}
|
||||
<tr>
|
||||
<td>{{ s.set_code }}</td>
|
||||
<td class="nm">{{ s.set_name }}</td>
|
||||
<td style="text-align:right;font-weight:600;">{{ s.qty }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if not set_rows %}
|
||||
<tr><td colspan="3" class="erp-muted">콤보 재고 입력이 없습니다.</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
.mys-compact .erp-table th,
|
||||
.mys-compact .erp-table td { padding-top:4px; padding-bottom:4px; }
|
||||
.mys-compact .erp-input { padding-top:4px; padding-bottom:4px; }
|
||||
.mys-compact td.nm { white-space:nowrap; }
|
||||
.mys-compact .qcol { width:150px; }
|
||||
.mys-compact .qcol .erp-input { width:140px; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
@@ -44,13 +47,13 @@
|
||||
<div class="cpg-card-head"><h2>낱개 상품</h2></div>
|
||||
<div class="erp-table-wrap" style="margin-top:8px;">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Code</th><th>Name</th><th style="width:100px">Qty</th></tr></thead>
|
||||
<thead><tr><th>Code</th><th>Name</th><th class="qcol">Qty</th></tr></thead>
|
||||
<tbody>
|
||||
{% for it in individual_items %}
|
||||
<tr>
|
||||
<td>{{ it.item_code }}</td>
|
||||
<td>{{ it.item_name }}</td>
|
||||
<td><input class="erp-input" type="number" name="qty_{{ it.item_code }}" placeholder="—" style="width:90px" /></td>
|
||||
<td class="nm">{{ it.item_name }}</td>
|
||||
<td class="qcol"><input class="erp-input" type="number" name="qty_{{ it.item_code }}" placeholder="—" /></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@@ -63,13 +66,13 @@
|
||||
<div class="cpg-card-head"><h2>콤보 상품</h2></div>
|
||||
<div class="erp-table-wrap" style="margin-top:8px;">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Set Code</th><th>Set Name</th><th style="width:100px">Qty (OUT)</th></tr></thead>
|
||||
<thead><tr><th>Set Code</th><th>Set Name</th><th class="qcol">Qty</th></tr></thead>
|
||||
<tbody>
|
||||
{% for it in set_items %}
|
||||
<tr>
|
||||
<td>{{ it.item_code }}</td>
|
||||
<td>{{ it.item_name }}</td>
|
||||
<td><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}" placeholder="—" style="width:90px" /></td>
|
||||
<td class="nm">{{ it.item_name }}</td>
|
||||
<td class="qcol"><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}" placeholder="—" /></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
@@ -1,61 +1,83 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<style>
|
||||
.mys-compact .erp-table th,
|
||||
.mys-compact .erp-table td { padding-top:4px; padding-bottom:4px; }
|
||||
.mys-compact .erp-input { padding-top:4px; padding-bottom:4px; }
|
||||
.mys-compact td.nm { white-space:nowrap; }
|
||||
.mys-compact .qcol { width:150px; }
|
||||
.mys-compact .qcol .erp-input { width:140px; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="mys">
|
||||
<section class="mys mys-compact">
|
||||
<div class="erp-page-actions">
|
||||
<a class="erp-btn erp-btn-outline" href="/malaysia/stocktakes?wh={{ stocktake.warehouse_code }}">◀◀ 조사 목록</a>
|
||||
</div>
|
||||
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head" style="display:flex;justify-content:space-between;align-items:center;">
|
||||
<h2>재고조사 #{{ stocktake.id }} — {{ stocktake.stocktake_date }} · {{ stocktake.warehouse_code }}</h2>
|
||||
<span>
|
||||
{% if stocktake.status=='finalized' %}<span class="erp-badge erp-badge-success">확정 ({{ stocktake.finalized_at }})</span>
|
||||
{% elif stocktake.status=='cancelled' %}<span class="erp-badge erp-badge-neutral">취소</span>
|
||||
{% else %}<span class="erp-badge erp-badge-inverse">작성중</span>{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% if missing_bom %}
|
||||
<p style="color:#b91c1c;font-weight:600;">⚠ BOM 구성이 없는 세트: {{ missing_bom|join(', ') }} — itemcode_db set_components 확인 필요. 확정 불가.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/lines/bulk">
|
||||
<div style="display:grid;grid-template-columns:280px 1fr 1fr;gap:16px;align-items:start;">
|
||||
|
||||
{% if is_draft %}
|
||||
<!-- 그리드 일괄 입력: 낱개 + 세트 한 폼에서 -->
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/lines/bulk" style="margin-top:16px;">
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;">
|
||||
<!-- 좌: 정보 + 동작 -->
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head"><h2>① 낱개 아이템</h2></div>
|
||||
<span class="erp-muted">세트 안에 든 건 빼고, 낱개 보관분만. 빈칸=미조사, 0 입력 가능.</span>
|
||||
<div class="cpg-card-head"><h2>재고조사 #{{ stocktake.id }}</h2></div>
|
||||
<div style="margin-top:8px;display:flex;flex-direction:column;gap:6px;">
|
||||
<div><span class="erp-muted">날짜</span><br>{{ stocktake.stocktake_date }}</div>
|
||||
<div><span class="erp-muted">창고</span><br>{{ stocktake.warehouse_code }}</div>
|
||||
<div><span class="erp-muted">상태</span><br>
|
||||
{% if stocktake.status=='finalized' %}<span class="erp-badge erp-badge-success">확정</span>
|
||||
{% elif stocktake.status=='cancelled' %}<span class="erp-badge erp-badge-neutral">취소</span>
|
||||
{% else %}<span class="erp-badge erp-badge-inverse">작성중</span>{% endif %}
|
||||
</div>
|
||||
{% if stocktake.finalized_at %}<div><span class="erp-muted">확정시각</span><br>{{ stocktake.finalized_at }}</div>{% endif %}
|
||||
</div>
|
||||
|
||||
{% if missing_bom %}
|
||||
<p style="color:#b91c1c;font-weight:600;margin-top:10px;">⚠ BOM 없는 콤보: {{ missing_bom|join(', ') }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if is_draft %}
|
||||
<div class="erp-page-actions" style="margin-top:12px;">
|
||||
<button type="submit" class="erp-btn erp-btn-primary">입력 저장</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- 중: 낱개 -->
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head"><h2>낱개 상품</h2></div>
|
||||
<div class="erp-table-wrap" style="margin-top:8px;">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Code</th><th>Name</th><th style="width:120px">Qty</th></tr></thead>
|
||||
<thead><tr><th>Code</th><th>Name</th><th class="qcol">Qty</th></tr></thead>
|
||||
<tbody>
|
||||
{% for it in individual_items %}
|
||||
<tr>
|
||||
<td>{{ it.item_code }}</td>
|
||||
<td>{{ it.item_name }}</td>
|
||||
<td><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}"
|
||||
value="{{ entered.get(it.item_code, '') }}" placeholder="—" style="width:100px" /></td>
|
||||
<td class="nm">{{ it.item_name }}</td>
|
||||
<td class="qcol"><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}"
|
||||
value="{{ entered.get(it.item_code, '') }}" placeholder="—" {% if not is_draft %}disabled{% endif %} /></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 우: 콤보 -->
|
||||
<div class="erp-card">
|
||||
<div class="cpg-card-head"><h2>② 세트 아이템</h2></div>
|
||||
<span class="erp-muted">미리 포장된 세트 재고. BOM(itemcode_db)으로 낱개 분해됨.</span>
|
||||
<div class="cpg-card-head"><h2>콤보 상품</h2></div>
|
||||
<div class="erp-table-wrap" style="margin-top:8px;">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Set Code</th><th>Set Name</th><th style="width:120px">Qty</th></tr></thead>
|
||||
<thead><tr><th>Set Code</th><th>Set Name</th><th class="qcol">Qty</th></tr></thead>
|
||||
<tbody>
|
||||
{% for it in set_items %}
|
||||
<tr>
|
||||
<td>{{ it.item_code }}</td>
|
||||
<td>{{ it.item_name }}</td>
|
||||
<td><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}"
|
||||
value="{{ entered.get(it.item_code, '') }}" placeholder="—" style="width:100px" /></td>
|
||||
<td class="nm">{{ it.item_name }}</td>
|
||||
<td class="qcol"><input class="erp-input" type="number" min="0" name="qty_{{ it.item_code }}"
|
||||
value="{{ entered.get(it.item_code, '') }}" placeholder="—" {% if not is_draft %}disabled{% endif %} /></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@@ -63,14 +85,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-page-actions" style="margin-top:12px;"><button type="submit" class="erp-btn erp-btn-primary">입력 저장</button></div>
|
||||
</form>
|
||||
|
||||
<!-- 확정/취소 -->
|
||||
{% if is_draft %}
|
||||
<div class="erp-page-actions" style="margin-top:12px;display:flex;gap:8px;">
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/finalize"
|
||||
onsubmit="return confirm('확정하면 시스템 재고와의 차이가 STOCKTAKE 이동으로 기록되고, 이후 수정 불가합니다. 계속?');">
|
||||
<button type="submit" class="erp-btn erp-btn-primary" {% if missing_bom %}disabled title="BOM 누락 콤보 해결 필요"{% endif %}>확정 (재고 반영)</button>
|
||||
</form>
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/cancel" onsubmit="return confirm('이 조사를 취소합니다. 계속?');">
|
||||
<button type="submit" class="erp-btn erp-btn-danger">취소</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- 최종 계산 결과 -->
|
||||
<!-- 최종 계산 결과 (낱개 기준) -->
|
||||
<div class="erp-card" style="margin-top:16px;">
|
||||
<div class="cpg-card-head"><h2>최종 계산 (낱개 기준)</h2></div>
|
||||
<span class="erp-muted">total_qty = direct_qty(낱개 직접) + from_set_qty(세트 분해)</span>
|
||||
<span class="erp-muted">total_qty = direct_qty(낱개 직접) + from_set_qty(콤보 분해)</span>
|
||||
<div class="erp-table-wrap">
|
||||
<table class="erp-table">
|
||||
<thead><tr><th>Item Code</th><th>Product Name</th><th style="text-align:right">Direct</th><th style="text-align:right">From Set</th><th style="text-align:right">Total</th></tr></thead>
|
||||
@@ -91,17 +124,5 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if is_draft %}
|
||||
<div class="erp-page-actions" style="margin-top:16px;display:flex;gap:8px;">
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/finalize"
|
||||
onsubmit="return confirm('확정하면 시스템 재고와의 차이가 STOCKTAKE 이동으로 기록되고, 이후 수정이 불가합니다. 계속?');">
|
||||
<button type="submit" class="erp-btn erp-btn-primary" {% if missing_bom %}disabled title="BOM 누락 세트 해결 필요"{% endif %}>확정 (재고 반영)</button>
|
||||
</form>
|
||||
<form method="post" action="/malaysia/stocktakes/{{ stocktake.id }}/cancel" onsubmit="return confirm('이 조사를 취소합니다. 계속?');">
|
||||
<button type="submit" class="erp-btn erp-btn-danger">취소</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user